Files
xen/tools/hotplug/Linux/Makefile
T
Keir Fraser 0cc54b151a Add xl init scripts
this patch adds an init script for xl, so that it can be used without
xend installed on the system.  In cases in which both toolstacks are
present, only one init script will be run, dependening on the value of
xen_toolstack in /etc/sysconfig/xen_toolstack.  Please note that a
correct value of xen_toolstack (either xl or xend), is required now.
The network script and the vif script to be used with xl can be
specified in /etc/sysconfig/xenlightdaemons.  Xl sets the vif script
to xl-vif-script by default, that reads /etc/sysconfig/xenlightdaemons
and calls the vif script set there.  A port to a debian system should
be straightforward, just replacing /etc/sysconfig with /etc/default
everywhere.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2010-06-07 07:05:54 +01:00

113 lines
3.5 KiB
Makefile

XEN_ROOT = ../../..
include $(XEN_ROOT)/tools/Rules.mk
# Init scripts.
XEND_INITD = init.d/xend
XEND_SYSCONFIG = init.d/sysconfig.xend
XENDOMAINS_INITD = init.d/xendomains
XENDOMAINS_SYSCONFIG = init.d/sysconfig.xendomains
XLD_INITD = init.d/xenlightdaemons
XLD_SYSCONFIG = init.d/sysconfig.xenlightdaemons
XENTOOLSTACK_SYSCONFIG = init.d/sysconfig.xen_toolstack
# Xen script dir and scripts to go there.
XEN_SCRIPTS = network-bridge vif-bridge
XEN_SCRIPTS += network-route vif-route
XEN_SCRIPTS += network-nat vif-nat
XEN_SCRIPTS += xl-vif-script
XEN_SCRIPTS += vif2
XEN_SCRIPTS += block
XEN_SCRIPTS += block-enbd block-nbd
XEN_SCRIPTS += blktap
XEN_SCRIPTS += vtpm vtpm-delete
XEN_SCRIPTS += xen-hotplug-cleanup
XEN_SCRIPTS += external-device-migrate
XEN_SCRIPTS += vscsi
XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
XEN_HOTPLUG_SCRIPTS = xen-backend.agent
UDEVVER = 0
ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
UDEVVER = $(shell /sbin/udevadm info -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
endif
ifeq ($(shell [ -x /usr/bin/udevinfo ] && echo 1),1)
UDEVVER = $(shell /usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/' )
endif
UDEV_RULES_DIR = $(CONFIG_DIR)/udev
UDEV_RULES = xen-backend.rules xend.rules
DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
ifeq ($(findstring $(DI),$(DE)),$(DI))
HOTPLUGS=install-hotplug install-udev
else
ifeq ($(shell [ $(UDEVVER) -ge 059 ] && echo 1),1)
HOTPLUGS=install-udev
else
HOTPLUGS=install-hotplug
endif
endif
.PHONY: all
all:
.PHONY: build
build:
.PHONY: install
install: all install-initd install-scripts $(HOTPLUGS)
.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
$(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
$(INSTALL_PROG) $(XEND_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xend
$(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
$(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains
$(INSTALL_PROG) $(XLD_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
$(INSTALL_PROG) $(XLD_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xenlightdaemons
$(INSTALL_PROG) $(XENTOOLSTACK_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xen_toolstack
.PHONY: install-scripts
install-scripts:
[ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
$(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
set -e; for i in $(XEN_SCRIPTS); \
do \
$(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
done
set -e; for i in $(XEN_SCRIPT_DATA); \
do \
$(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
done
.PHONY: install-hotplug
install-hotplug:
[ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
$(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
do \
$(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
done
.PHONY: install-udev
install-udev:
[ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
$(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
set -e; for i in $(UDEV_RULES); \
do \
$(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
ln -sf ../$$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \
done
.PHONY: clean
clean: