ia64/xen-unstable

view buildconfigs/Rules.mk @ 11753:bf0deb09facd

[XEND] Fix pygrub when run server-side on a domain with blktap disks.

For some slightly-crazy reason the blktap patches changed the name
of the SEXPR block containing the disk definition 'vbd' to 'tap', even
though merely changing the 'uname' fragement was sufficient. eg

(vbd (backend 0) (dev hda:disk) (uname file:/xen/rhel4x86_64.img)
(mode w) )

changes to

(tap (backend 0) (dev hda:disk) (uname tap:aio:/xen/rhel4x86_64.img)
(mode w) )

If you create a domain with xm, then xm runs pygrub client side which
works fine. If you create a domain by feeding a block of SEXPR to Xend
over its network port, then pygrub is run server side. The code in
XenD which decides which disk to run pygrub against only looks for
'device/vbd' in the SEXPR so fails to see any blktap disks.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
author kfraser@localhost.localdomain
date Thu Oct 05 16:14:50 2006 +0100 (2006-10-05)
parents 8273f730371b
children be8039f8bc14
line source
2 include Config.mk
4 export DESTDIR
6 ALLKERNELS = $(patsubst buildconfigs/mk.%,%,$(wildcard buildconfigs/mk.*))
7 ALLSPARSETREES = $(patsubst %-xen-sparse,%,$(wildcard *-xen-sparse))
9 # Setup pristine search path
10 PRISTINE_SRC_PATH ?= .:..
11 vpath pristine-% $(PRISTINE_SRC_PATH)
13 # Let XEN_TARGET_ARCH override ARCH.
14 ifeq ($(XEN_TARGET_ARCH),x86_32)
15 LINUX_ARCH ?= i386
16 else
17 LINUX_ARCH ?= $(XEN_TARGET_ARCH)
18 endif
20 # Expand Linux series to Linux version
21 LINUX_SERIES ?= 2.6
22 LINUX_VER ?= $(shell grep "^LINUX_VER " buildconfigs/mk.linux-2.6-xen | sed -e 's/.*=[ ]*//')
24 # Setup Linux search path
25 LINUX_SRC_PATH ?= .:..
26 vpath linux-%.tar.bz2 $(LINUX_SRC_PATH)
27 vpath patch-%.bz2 $(LINUX_SRC_PATH)
29 # download a pristine Linux kernel tarball if there isn't one in LINUX_SRC_PATH
30 linux-%.tar.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$*)).$(word 2,$(subst ., ,$*))
31 linux-%.tar.bz2:
32 @echo "Cannot find $@ in path $(LINUX_SRC_PATH)"
33 wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$@ -O./$@
35 patch-%.bz2: override _LINUX_VDIR = $(word 1,$(subst ., ,$(*F))).$(word 2,$(subst ., ,$(*F)))
36 patch-%.bz2: override _LINUX_XDIR = $(if $(word 3,$(subst -, ,$(*F))),snapshots,testing)
37 patch-%.bz2:
38 @echo "Cannot find $(@F) in path $(LINUX_SRC_PATH)"
39 wget $(KERNEL_REPO)/pub/linux/kernel/v$(_LINUX_VDIR)/$(_LINUX_XDIR)/$(@F) -O./$@
41 pristine-%: pristine-%/.valid-pristine
42 @true
44 pristine-%/.valid-pristine: %.tar.bz2
45 rm -rf tmp-pristine-$* $(@D)
46 mkdir -p tmp-pristine-$*
47 tar -C tmp-pristine-$* -jxf $<
48 -@rm -f tmp-pristine-$*/pax_global_header
49 mv tmp-pristine-$*/* $(@D)
50 @rm -rf tmp-pristine-$*
51 touch $(@D)/.hgskip
52 touch $@ # update timestamp to avoid rebuild
54 PATCHDIRS := $(wildcard patches/*-*)
56 ifneq ($(PATCHDIRS),)
57 -include $(patsubst %,%/.makedep,$(PATCHDIRS))
59 $(patsubst patches/%,patches/%/.makedep,$(PATCHDIRS)): patches/%/.makedep:
60 @echo 'ref-$*/.valid-ref: $$(wildcard patches/$*/*.patch)' >$@
62 ref-%/.valid-ref: pristine-%/.valid-pristine
63 set -e
64 rm -rf $(@D)
65 cp -al $(<D) $(@D)
66 if [ -d patches/$* ] ; then \
67 echo Applying patches from patches/$*... ; \
68 for i in $$(cat patches/$*/series) ; do \
69 echo ... $$i ; \
70 patch -d $(@D) -p1 --quiet <patches/$*/$$i || exit 1 ; \
71 done ; \
72 fi
73 touch $@ # update timestamp to avoid rebuild
74 endif
76 %-install:
77 $(MAKE) -f buildconfigs/mk.$* build
79 %-dist: DESTDIR=$(DISTDIR)/install
80 %-dist: %-install
81 @: # do nothing
83 # Legacy dist target
84 %-build: %-dist
85 @: # do nothing
87 %-prep: DESTDIR=$(DISTDIR)/install
88 %-prep:
89 $(MAKE) -f buildconfigs/mk.$* prep
91 %-config: DESTDIR=$(DISTDIR)/install
92 %-config:
93 $(MAKE) -f buildconfigs/mk.$* config
95 %-delete:
96 $(MAKE) -f buildconfigs/mk.$* delete
98 %-clean:
99 $(MAKE) -f buildconfigs/mk.$* clean
101 linux-2.6-xen.patch: ref-linux-$(LINUX_VER)/.valid-ref
102 rm -rf tmp-$@
103 cp -al $(<D) tmp-$@
104 ( cd linux-2.6-xen-sparse && bash ./mkbuildtree ../tmp-$@ )
105 diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
106 rm -rf tmp-$@
108 %-xen.patch: ref-%/.valid-ref
109 rm -rf tmp-$@
110 cp -al $(<D) tmp-$@
111 ( cd $*-xen-sparse && bash ./mkbuildtree ../tmp-$@ )
112 diff -Nurp $(patsubst ref%,pristine%,$(<D)) tmp-$@ > $@ || true
113 rm -rf tmp-$@
115 %-mrproper:
116 $(MAKE) -f buildconfigs/mk.$*-xen mrpropper
117 rm -rf pristine-$(*)* ref-$(*)*
118 rm -rf $*-xen.patch
120 .PHONY: config-update-pae
121 config-update-pae:
122 ifeq ($(XEN_TARGET_X86_PAE),y)
123 sed -e 's!^CONFIG_HIGHMEM4G=y$$!\# CONFIG_HIGHMEM4G is not set!;s!^\# CONFIG_HIGHMEM64G is not set$$!CONFIG_HIGHMEM64G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE)
124 else
125 grep '^CONFIG_HIGHMEM64G=y' $(CONFIG_FILE) >/dev/null && ( sed -e 's!^CONFIG_HIGHMEM64G=y$$!\# CONFIG_HIGHMEM64G is not set!;s!^\# CONFIG_HIGHMEM4G is not set$$!CONFIG_HIGHMEM4G=y!' $(CONFIG_FILE) > $(CONFIG_FILE)- && mv $(CONFIG_FILE)- $(CONFIG_FILE) ) || true
126 endif
128 # never delete any intermediate files.
129 .SECONDARY: