ia64/xen-unstable

view tools/hotplug/Linux/Makefile @ 19497:2f6ed9318c03

network-bridge: Fix do_ifup in the case of ${bridge} != ${netdev}

On RHEL5.2, ifup ${bridge} fails if ${bridge} != ${netdev},
because RHEL5.2's ifup ${bridge} runs the following sequence:

1. Search CONFIG that has the same mac address of ${bridge}.=20
ifcfg-${netdev} is found.
2. Run "ip link set dev ${netdev} up".
# ${bridge} is expected.
3. Output "Failed to bring up ${netdev}."
Because ${netdev} does not exist.

Thus, do_ifup() should not use ifup if ${bridge} != ${netdev}.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Apr 02 11:48:10 2009 +0100 (2009-04-02)
parents 57327f3334b4
children 887337323bd8
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 configuration dir and configs to go there.
10 XEN_CONFIG_DIR = /etc/xen
12 # Xen script dir and scripts to go there.
13 XEN_SCRIPT_DIR = /etc/xen/scripts
14 XEN_SCRIPTS = network-bridge vif-bridge
15 XEN_SCRIPTS += network-route vif-route
16 XEN_SCRIPTS += network-nat vif-nat
17 XEN_SCRIPTS += block
18 XEN_SCRIPTS += block-enbd block-nbd
19 XEN_SCRIPTS += vtpm vtpm-delete
20 XEN_SCRIPTS += xen-hotplug-cleanup
21 XEN_SCRIPTS += external-device-migrate
22 XEN_SCRIPTS += vscsi
23 XEN_SCRIPT_DATA = xen-script-common.sh locking.sh logging.sh
24 XEN_SCRIPT_DATA += xen-hotplug-common.sh xen-network-common.sh vif-common.sh
25 XEN_SCRIPT_DATA += block-common.sh vtpm-common.sh vtpm-hotplug-common.sh
26 XEN_SCRIPT_DATA += vtpm-migration.sh vtpm-impl
28 XEN_HOTPLUG_DIR = /etc/hotplug
29 XEN_HOTPLUG_SCRIPTS = xen-backend.agent
31 UDEV_RULES_DIR = /etc/udev
32 UDEV_RULES = xen-backend.rules xend.rules
34 DI = $(if $(DISTDIR),$(shell readlink -f $(DISTDIR)),)
35 DE = $(if $(DESTDIR),$(shell readlink -f $(DESTDIR)),)
36 ifeq ($(findstring $(DI),$(DE)),$(DI))
37 HOTPLUGS=install-hotplug install-udev
38 else
39 ifeq ($(shell [ -x /usr/bin/udevinfo ] && [ `/usr/bin/udevinfo -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/'` -ge 059 ] && echo 1),1)
40 HOTPLUGS=install-udev
41 else
42 HOTPLUGS=install-hotplug
43 endif
44 endif
46 .PHONY: all
47 all:
49 .PHONY: build
50 build:
52 .PHONY: install
53 install: all install-initd install-scripts $(HOTPLUGS)
55 .PHONY: install-initd
56 install-initd:
57 [ -d $(DESTDIR)/etc/init.d ] || $(INSTALL_DIR) $(DESTDIR)/etc/init.d
58 [ -d $(DESTDIR)/etc/sysconfig ] || $(INSTALL_DIR) $(DESTDIR)/etc/sysconfig
59 $(INSTALL_PROG) $(XEND_INITD) $(DESTDIR)/etc/init.d
60 $(INSTALL_PROG) $(XENDOMAINS_INITD) $(DESTDIR)/etc/init.d
61 $(INSTALL_PROG) $(XENDOMAINS_SYSCONFIG) $(DESTDIR)/etc/sysconfig/xendomains
63 .PHONY: install-scripts
64 install-scripts:
65 [ -d $(DESTDIR)$(XEN_SCRIPT_DIR) ] || \
66 $(INSTALL_DIR) $(DESTDIR)$(XEN_SCRIPT_DIR)
67 set -e; for i in $(XEN_SCRIPTS); \
68 do \
69 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
70 done
71 set -e; for i in $(XEN_SCRIPT_DATA); \
72 do \
73 $(INSTALL_DATA) $$i $(DESTDIR)$(XEN_SCRIPT_DIR); \
74 done
76 .PHONY: install-hotplug
77 install-hotplug:
78 [ -d $(DESTDIR)$(XEN_HOTPLUG_DIR) ] || \
79 $(INSTALL_DIR) $(DESTDIR)$(XEN_HOTPLUG_DIR)
80 set -e; for i in $(XEN_HOTPLUG_SCRIPTS); \
81 do \
82 $(INSTALL_PROG) $$i $(DESTDIR)$(XEN_HOTPLUG_DIR); \
83 done
85 .PHONY: install-udev
86 install-udev:
87 [ -d $(DESTDIR)$(UDEV_RULES_DIR) ] || \
88 $(INSTALL_DIR) $(DESTDIR)$(UDEV_RULES_DIR)/rules.d
89 set -e; for i in $(UDEV_RULES); \
90 do \
91 $(INSTALL_DATA) $$i $(DESTDIR)$(UDEV_RULES_DIR); \
92 ln -sf ../$$i $(DESTDIR)$(UDEV_RULES_DIR)/rules.d; \
93 done
95 .PHONY: clean
96 clean: