Description: Adapt init.d and sysconfig files to Debian based systems An attempt to assess that the build is to be made for Debian based systems. Based on the assessment adapt init.d and sysconfig files * Config.mk: DEBIANBASE - guess if the target system is debian based * tools/hotplug/Linux/Makefile: target install-initd: if DEBIANBASE=y - use /etc/default instead for /etc/sysconfig as destination folder - replace references of /etc/sysconfig for /etc/default in init.d-files Author: User Virtual Origin: http://virtualusr.wordpress.com Index: xen-4.0-4.0.1/Config.mk =================================================================== --- xen-4.0-4.0.1.orig/Config.mk 2010-08-25 10:22:42.000000000 +0200 +++ xen-4.0-4.0.1/Config.mk 2011-01-04 19:08:17.816312723 +0100 @@ -185,5 +185,6 @@ PYTHON_TOOLS ?= y CONFIG_MINITERM ?= n CONFIG_LOMOUNT ?= n +DEBIANBASE ?= $(shell test ! -d /etc/sysconfig && test -d /etc/default && echo y || echo n) -include $(XEN_ROOT)/.config Index: xen-4.0-4.0.1/tools/hotplug/Linux/Makefile =================================================================== --- xen-4.0-4.0.1.orig/tools/hotplug/Linux/Makefile 2010-08-25 10:22:42.000000000 +0200 +++ xen-4.0-4.0.1/tools/hotplug/Linux/Makefile 2011-01-04 19:08:17.816312723 +0100 @@ -59,14 +59,22 @@ .PHONY: install install: all install-initd install-scripts $(HOTPLUGS) +SYSCONF_DIR = $(if $(filter y,$(DEBIANBASE)),default,sysconfig) .PHONY: install-initd install-initd: [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d - [ -d $(DESTDIR)$(CONFIG_DIR)/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/sysconfig + [ -d $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR) ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR) $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d - $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xend + $(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR)/xend $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d - $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains + $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/$(SYSCONF_DIR)/xendomains +ifeq ($(DEBIANBASE),y) + set -e; for i in $(DESTDIR)$(CONFIG_DIR)/$(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/$(XENDOMAINS_INITD) ; do \ + cp -a $$i $$i.tmp ; cp /dev/null $$i ; \ + sed -e 's|/etc/sysconfig\b|/etc/default|g' $$i.tmp >> $$i ; \ + rm -f $$i.tmp ; \ + done +endif .PHONY: install-scripts install-scripts: