ia64/xen-unstable

view buildconfigs/mk.linux-2.6-xen @ 13341:3040ba0f2d3d

When booting via xm, only run the bootloader if it's in non-interactive mode:
otherwise we lose the user's named kernel and try to bootload the temporary
file pygrub returned.

Signed-off-by: John Levon <john.levon@sun.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Tue Jan 09 13:24:45 2007 +0000 (2007-01-09)
parents 1e7bbecdc0a2
children 7c653e58cbe4 4fad820a2233
line source
1 LINUX_SERIES = 2.6
2 LINUX_VER = 2.6.16.33
4 EXTRAVERSION ?= xen
6 LINUX_SRCDIR = linux-$(LINUX_VER)-xen
7 LINUX_DIR = build-linux-$(LINUX_VER)-$(EXTRAVERSION)_$(XEN_TARGET_ARCH)
9 IMAGE_TARGET ?= vmlinuz
10 INSTALL_BOOT_PATH ?= $(DESTDIR)
12 LINUX_VER3 := $(LINUX_SERIES).$(word 3, $(subst ., ,$(LINUX_VER)))
14 include buildconfigs/Rules.mk
16 # The real action starts here!
17 .PHONY: build
18 build: $(LINUX_DIR)/include/linux/autoconf.h
19 if grep "^CONFIG_MODULES=" $(LINUX_DIR)/.config ; then \
20 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) modules ; \
21 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_MOD_PATH=$(DESTDIR) modules_install ; \
22 fi
23 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(DESTDIR) $(IMAGE_TARGET)
24 mkdir -p $(INSTALL_BOOT_PATH)
25 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) INSTALL_PATH=$(INSTALL_BOOT_PATH) install
27 $(LINUX_SRCDIR)/.valid-src: ref-linux-$(LINUX_VER)/.valid-ref
28 rm -rf $(LINUX_SRCDIR)
29 cp -al $(<D) $(LINUX_SRCDIR)
30 # Apply arch-xen patches
31 ( cd linux-$(LINUX_SERIES)-xen-sparse && \
32 LINUX_ARCH=$(LINUX_ARCH) bash ./mkbuildtree ../$(LINUX_SRCDIR) )
33 # Patch kernel Makefile to set EXTRAVERSION
34 ( cd $(LINUX_SRCDIR) ; \
35 sed -e 's,^EXTRAVERSION.*,&$$(XENGUEST),' \
36 -e 's,^KERNELRELEASE,XENGUEST := $$(shell [ -r $$(objtree)/.xenguest ] \&\& cat $$(objtree)/.xenguest)\n&,' Makefile >Mk.tmp ; \
37 rm -f Makefile ; mv Mk.tmp Makefile )
38 touch $@
40 $(LINUX_DIR)/include/linux/autoconf.h: $(LINUX_SRCDIR)/.valid-src
41 rm -rf $(LINUX_DIR)
42 mkdir -p $(LINUX_DIR)
43 # Re-use config from install dir if one exits else use default config
44 CONFIG_VERSION=$$(sed -ne 's/$$(XENGUEST)//; s/^EXTRAVERSION = //p' $(LINUX_SRCDIR)/Makefile); \
45 [ -r $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) ] && \
46 cp $(DESTDIR)/boot/config-$(LINUX_VER3)$$CONFIG_VERSION-$(EXTRAVERSION) $(LINUX_DIR)/.config \
47 || sh buildconfigs/create_config.sh $(LINUX_DIR)/.config $(EXTRAVERSION) $(XEN_TARGET_ARCH) $(XEN_SYSTYPE)
48 # See if we need to munge config to enable PAE
49 $(MAKE) CONFIG_FILE=$(LINUX_DIR)/.config -f buildconfigs/Rules.mk config-update-pae
50 echo "-$(EXTRAVERSION)" >$(LINUX_DIR)/.xenguest
51 $(MAKE) -C $(LINUX_SRCDIR) ARCH=$(LINUX_ARCH) oldconfig O=$$(/bin/pwd)/$(LINUX_DIR)
53 .PHONY: prep
54 prep: $(LINUX_DIR)/include/linux/autoconf.h
56 .PHONY: config
57 config: CONFIGMODE = menuconfig
58 config: $(LINUX_DIR)/include/linux/autoconf.h
59 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) $(CONFIGMODE)
61 .PHONY: clean
62 clean::
63 [ ! -d $(LINUX_DIR) ] || \
64 $(MAKE) -C $(LINUX_DIR) ARCH=$(LINUX_ARCH) clean
67 .PHONY: delete
68 delete:
69 rm -rf tmp-linux-$(LINUX_VER) $(LINUX_DIR)
71 .PHONY: mrpropper
72 mrpropper:
73 rm -rf $(LINUX_SRCDIR)
74 rm -f linux-$(LINUX_VER).tar.bz2