ia64/xen-unstable

view tools/hotplug/Linux/Makefile @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 887337323bd8
children
line source
1 XEN_ROOT = ../../../
2 include $(XEN_ROOT)/tools/Rules.mk
4 # Init scripts.
5 XEND_INITD = init.d/xend
6 XENDOMAINS_INITD = init.d/xendomains
7 XENDOMAINS_SYSCONFIG = init.d/sysconfig.xendomains
9 # Xen script dir and scripts to go there.
10 XEN_SCRIPTS = network-bridge vif-bridge
11 XEN_SCRIPTS += network-route vif-route
12 XEN_SCRIPTS += network-nat vif-nat
13 XEN_SCRIPTS += block
14 XEN_SCRIPTS += block-enbd block-nbd
15 XEN_SCRIPTS += vtpm vtpm-delete
16 XEN_SCRIPTS += xen-hotplug-cleanup
17 XEN_SCRIPTS += external-device-migrate
18 XEN_SCRIPTS += vscsi
19 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
20 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
21 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
22 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
24 XEN_HOTPLUG_DIR = $(CONFIG_DIR)/hotplug
25 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
27 ifeq ($(shell [ -x /sbin/udevadm ] && echo 1),1)
28 UDEVINFO = /sbin/udevadm
29 else
30 UDEVINFO = /usr/bin/udevinfo
31 endif
33 UDEV_RULES_DIR = $(CONFIG_DIR)/udev
34 UDEV_RULES = xen-backend.rules xend.rules
36 DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
37 DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
38 ifeq ($(findstring $(DI),$(DE)),$(DI))
39 HOTPLUGS=install-hotplug install-udev
40 else
41 ifeq ($(shell [ -x $(UDEVINFO) -a `$(UDEVINFO) -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
42 HOTPLUGS=install-udev
43 else
44 HOTPLUGS=install-hotplug
45 endif
46 endif
48 .PHONY: all
49 all:
51 .PHONY: build
52 build:
54 .PHONY: install
55 install: all install-initd install-scripts $(HOTPLUGS)
57 .PHONY: install-initd
58 install-initd:
59 [ -d $(DESTDIR)$(CONFIG_DIR)/init.d ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/init.d
60 [ -d $(DESTDIR)$(CONFIG_DIR)/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)$(CONFIG_DIR)/sysconfig
61 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
62 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)$(CONFIG_DIR)/init.d
63 $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)$(CONFIG_DIR)/sysconfig/xendomains
65 .PHONY: install-scripts
66 install-scripts:
67 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
68 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
69 set -e; for i in $(XEN_SCRIPTS); \
70 do \
71 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
72 done
73 set -e; for i in $(XEN_SCRIPT_DATA); \
74 do \
75 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
76 done
78 .PHONY: install-hotplug
79 install-hotplug:
80 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
81 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
82 set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
83 do \
84 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
85 done
87 .PHONY: install-udev
88 install-udev:
89 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
90 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
91 set -e; for i in $(UDEV_RULES); \
92 do \
93 $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
94 ln -sf ../$$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \
95 done
97 .PHONY: clean
98 clean: