debuggers.hg

view Makefile @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents 2bedffabbcab
children
line source
1 #
2 # Grand Unified Makefile for Xen.
3 #
5 # Default target must appear before any include lines
6 .PHONY: all
7 all: dist
9 export XEN_ROOT=$(CURDIR)
10 include Config.mk
12 SUBARCH := $(subst x86_32,i386,$(XEN_TARGET_ARCH))
13 export XEN_TARGET_ARCH SUBARCH XEN_SYSTYPE
14 include buildconfigs/Rules.mk
16 # build and install everything into the standard system directories
17 .PHONY: install
18 install: install-xen install-kernels install-tools install-stubdom install-docs
20 .PHONY: build
21 build: kernels
22 $(MAKE) -C xen build
23 $(MAKE) -C tools build
24 $(MAKE) -C stubdom build
25 ifeq (x86_64,$(XEN_TARGET_ARCH))
26 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom pv-grub
27 endif
28 $(MAKE) -C docs build
30 # The test target is for unit tests that can run without an installation. Of
31 # course, many tests require a machine running Xen itself, and these are
32 # handled elsewhere.
33 .PHONY: test
34 test:
35 $(MAKE) -C tools/python test
37 # build and install everything into local dist directory
38 .PHONY: dist
39 dist: DESTDIR=$(DISTDIR)/install
40 dist: dist-xen dist-kernels dist-tools dist-stubdom dist-docs dist-misc
42 dist-misc:
43 $(INSTALL_DIR) $(DISTDIR)/check
44 $(INSTALL_DATA) ./COPYING $(DISTDIR)
45 $(INSTALL_DATA) ./README $(DISTDIR)
46 $(INSTALL_PROG) ./install.sh $(DISTDIR)
47 $(INSTALL_PROG) tools/check/chk tools/check/check_* tools/check/funcs.sh $(DISTDIR)/check
48 dist-%: DESTDIR=$(DISTDIR)/install
49 dist-%: install-%
50 @: # do nothing
52 # Legacy dist targets
53 .PHONY: xen tools stubdom kernels docs
54 xen: dist-xen
55 tools: dist-tools
56 kernels: dist-kernels
57 stubdom: dist-stubdom
58 docs: dist-docs
60 .PHONY: prep-kernels
61 prep-kernels:
62 for i in $(XKERNELS) ; do $(MAKE) $$i-prep || exit 1; done
64 .PHONY: install-xen
65 install-xen:
66 $(MAKE) -C xen install
68 .PHONY: install-tools
69 install-tools: tools/ioemu-dir
70 $(MAKE) -C tools install
72 .PHONY: install-kernels
73 install-kernels:
74 for i in $(XKERNELS) ; do $(MAKE) $$i-install || exit 1; done
76 .PHONY: install-stubdom
77 install-stubdom: tools/ioemu-dir install-tools
78 $(MAKE) -C stubdom install
79 ifeq (x86_64,$(XEN_TARGET_ARCH))
80 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom install-grub
81 endif
83 tools/ioemu-dir:
84 $(MAKE) -C tools ioemu-dir-find
86 .PHONY: tools/ioemu-dir-force-update
87 tools/ioemu-dir-force-update:
88 $(MAKE) -C tools ioemu-dir-force-update
90 .PHONY: install-docs
91 install-docs:
92 sh ./docs/check_pkgs && $(MAKE) -C docs install || true
94 .PHONY: dev-docs
95 dev-docs:
96 $(MAKE) -C docs dev-docs
98 # Build all the various kernels and modules
99 .PHONY: kbuild
100 kbuild: kernels
102 # Delete the kernel build trees entirely
103 .PHONY: kdelete
104 kdelete:
105 for i in $(XKERNELS) ; do $(MAKE) $$i-delete ; done
107 # Clean the kernel build trees
108 .PHONY: kclean
109 kclean:
110 for i in $(XKERNELS) ; do $(MAKE) $$i-clean ; done
112 # build xen, the tools, and a domain 0 plus unprivileged linux-xen images,
113 # and place them in the install directory. 'make install' should then
114 # copy them to the normal system directories
115 .PHONY: world
116 world:
117 $(MAKE) clean
118 $(MAKE) kdelete
119 $(MAKE) dist
121 # clean doesn't do a kclean
122 .PHONY: clean
123 clean::
124 $(MAKE) -C xen clean
125 $(MAKE) -C tools clean
126 $(MAKE) -C stubdom crossclean
127 ifeq (x86_64,$(XEN_TARGET_ARCH))
128 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom crossclean
129 endif
130 $(MAKE) -C docs clean
132 # clean, but blow away kernel build tree plus tarballs
133 .PHONY: distclean
134 distclean:
135 $(MAKE) -C xen distclean
136 $(MAKE) -C tools distclean
137 $(MAKE) -C stubdom distclean
138 ifeq (x86_64,$(XEN_TARGET_ARCH))
139 XEN_TARGET_ARCH=x86_32 $(MAKE) -C stubdom distclean
140 endif
141 $(MAKE) -C docs distclean
142 rm -rf dist patches/tmp
143 for i in $(ALLKERNELS) ; do $(MAKE) $$i-delete ; done
144 rm -rf patches/*/.makedep
146 # Linux name for GNU distclean
147 .PHONY: mrproper
148 mrproper: distclean
150 # Prepare for source tarball
151 .PHONY: src-tarball
152 src-tarball: distclean
153 $(MAKE) -C xen .banner
154 rm -rf xen/tools/figlet .[a-z]*
155 $(MAKE) -C xen distclean
157 .PHONY: help
158 help:
159 @echo 'Installation targets:'
160 @echo ' install - build and install everything'
161 @echo ' install-xen - build and install the Xen hypervisor'
162 @echo ' install-tools - build and install the control tools'
163 @echo ' install-kernels - build and install guest kernels'
164 @echo ' install-stubdom - build and install the stubdomain images'
165 @echo ' install-docs - build and install user documentation'
166 @echo ''
167 @echo 'Building targets:'
168 @echo ' dist - build and install everything into local dist directory'
169 @echo ' world - clean everything, delete guest kernel build'
170 @echo ' trees then make dist'
171 @echo ' xen - build and install Xen hypervisor'
172 @echo ' tools - build and install tools'
173 @echo ' stubdom - build and install the stubdomain images'
174 @echo ' kernels - build and install guest kernels'
175 @echo ' kbuild - synonym for make kernels'
176 @echo ' docs - build and install user documentation'
177 @echo ' dev-docs - build developer-only documentation'
178 @echo ''
179 @echo 'Cleaning targets:'
180 @echo ' clean - clean the Xen, tools and docs (but not guest kernel trees)'
181 @echo ' distclean - clean plus delete kernel build trees and'
182 @echo ' local downloaded files'
183 @echo ' kdelete - delete guest kernel build trees'
184 @echo ' kclean - clean guest kernel build trees'
185 @echo ''
186 @echo 'Miscellaneous targets:'
187 @echo ' prep-kernels - prepares kernel directories, does not build'
188 @echo ' uninstall - attempt to remove installed Xen tools'
189 @echo ' (use with extreme care!)'
190 @echo
191 @echo 'Trusted Boot (tboot) targets:'
192 @echo ' build-tboot - download and build the tboot module'
193 @echo ' install-tboot - download, build, and install the tboot module'
194 @echo ' clean-tboot - clean the tboot module if it exists'
195 @echo
196 @echo 'Environment:'
197 @echo ' [ this documentation is sadly not complete ]'
199 # Use this target with extreme care!
200 .PHONY: uninstall
201 uninstall: D=$(DESTDIR)
202 uninstall:
203 [ -d $(D)$(XEN_CONFIG_DIR) ] && mv -f $(D)$(XEN_CONFIG_DIR) $(D)$(XEN_CONFIG_DIR).old-`date +%s` || true
204 rm -rf $(D)$(CONFIG_DIR)/init.d/xend*
205 rm -rf $(D)$(CONFIG_DIR)/hotplug/xen-backend.agent
206 rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xen-backend.rules
207 rm -f $(D)$(CONFIG_DIR)/udev/xen-backend.rules
208 rm -f $(D)$(CONFIG_DIR)/udev/rules.d/xend.rules
209 rm -f $(D)$(CONFIG_DIR)/udev/xend.rules
210 rm -f $(D)$(SYSCONFIG_DIR)/xendomains
211 rm -rf $(D)/var/run/xen* $(D)/var/lib/xen*
212 rm -rf $(D)/boot/*xen*
213 rm -rf $(D)/lib/modules/*xen*
214 rm -rf $(D)$(LIBDIR)/xen* $(D)$(BINDIR)/lomount
215 rm -rf $(D)$(BINDIR)/cpuperf-perfcntr $(D)$(BINDIR)/cpuperf-xen
216 rm -rf $(D)$(BINDIR)/xc_shadow
217 rm -rf $(D)$(BINDIR)/pygrub
218 rm -rf $(D)$(BINDIR)/setsize $(D)$(BINDIR)/tbctl
219 rm -rf $(D)$(BINDIR)/xsls
220 rm -rf $(D)$(INCLUDEDIR)/xenctrl.h $(D)$(INCLUDEDIR)/xenguest.h
221 rm -rf $(D)$(INCLUDEDIR)/xs_lib.h $(D)$(INCLUDEDIR)/xs.h
222 rm -rf $(D)$(INCLUDEDIR)/xen
223 rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
224 rm -rf $(D)$(LIBDIR)/libxenstore*
225 rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
226 rm -rf $(D)$(LIBDIR)/xen/
227 rm -rf $(D)$(LIBEXEC)/xen*
228 rm -rf $(D)$(SBINDIR)/setmask
229 rm -rf $(D)$(SBINDIR)/xen* $(D)$(SBINDIR)/netfix $(D)$(SBINDIR)/xm
230 rm -rf $(D)$(SHAREDIR)/doc/xen
231 rm -rf $(D)$(SHAREDIR)/xen
232 rm -rf $(D)$(MAN1DIR)/xen*
233 rm -rf $(D)$(MAN8DIR)/xen*
234 rm -rf $(D)/boot/tboot*
236 # Legacy targets for compatibility
237 .PHONY: linux26
238 linux26:
239 $(MAKE) 'KERNELS=linux-2.6*' kernels
242 #
243 # tboot targets
244 #
246 TBOOT_TARFILE = tboot-20090330.tar.gz
247 #TBOOT_BASE_URL = http://downloads.sourceforge.net/tboot
248 TBOOT_BASE_URL = $(XEN_EXTFILES_URL)
250 .PHONY: build-tboot
251 build-tboot: download_tboot
252 $(MAKE) -C tboot build
254 .PHONY: install-tboot
255 install-tboot: download_tboot
256 $(MAKE) -C tboot install
258 .PHONY: dist-tboot
259 dist-tboot: download_tboot
260 $(MAKE) DESTDIR=$(DISTDIR)/install -C tboot dist
262 .PHONY: clean-tboot
263 clean-tboot:
264 [ ! -d tboot ] || $(MAKE) -C tboot clean
266 .PHONY: distclean-tboot
267 distclean-tboot:
268 [ ! -d tboot ] || $(MAKE) -C tboot distclean
270 .PHONY: download_tboot
271 download_tboot: tboot/Makefile
273 tboot/Makefile: tboot/$(TBOOT_TARFILE)
274 [ -e tboot/Makefile ] || tar -xzf tboot/$(TBOOT_TARFILE) -C tboot/ --strip-components 1
276 tboot/$(TBOOT_TARFILE):
277 mkdir -p tboot
278 wget -O tboot/$(TBOOT_TARFILE) $(TBOOT_BASE_URL)/$(TBOOT_TARFILE)