From: "Jan Beulich" Subject: [PATCH] linux/x86: match native behavior of 'make install' Date: Tue, 18 Sep 2007 08:50:48 +0100 Message-ID: <46EF9F78.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org Placement of the final image and handling of the install process should match native (whether to implicitly create an initrd is just one example). This includes there not being a need for a special boot-xen subdirectory and more unification of arch/*/Makefile pieces. Signed-off-by: Jan Beulich Index: head-2007-09-03/arch/i386/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-09-03.orig/arch/i386/Makefile 2007-09-17 14:22:09.0000000= 00 +0200 +++ head-2007-09-03/arch/i386/Makefile 2007-09-17 13:55:57.000000000 = +0200 @@ -124,20 +124,18 @@ AFLAGS +=3D $(mflags-y) =20 boot :=3D arch/i386/boot =20 -PHONY +=3D zImage bzImage compressed zlilo bzlilo \ +PHONY +=3D zImage bzImage vmlinuz compressed zlilo bzlilo \ zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install =20 ifdef CONFIG_XEN CPPFLAGS :=3D -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS) -boot :=3D arch/i386/boot-xen -.PHONY: vmlinuz all: vmlinuz =20 -vmlinuz: vmlinux - $(Q)$(MAKE) $(build)=3D$(boot) $@ +# KBUILD_IMAGE specifies the target image being built +KBUILD_IMAGE :=3D $(boot)/vmlinuz =20 -install: - $(Q)$(MAKE) $(build)=3D$(boot) $@ +vmlinuz: vmlinux + $(Q)$(MAKE) $(build)=3D$(boot) $(KBUILD_IMAGE) else all: bzImage =20 @@ -158,10 +156,10 @@ zdisk bzdisk: vmlinux =20 fdimage fdimage144 fdimage288 isoimage: vmlinux $(Q)$(MAKE) $(build)=3D$(boot) BOOTIMAGE=3D$(KBUILD_IMAGE) $@ +endif =20 install: $(Q)$(MAKE) $(build)=3D$(boot) BOOTIMAGE=3D$(KBUILD_IMAGE) install -endif =20 archclean: $(Q)$(MAKE) $(clean)=3Darch/i386/boot @@ -180,4 +178,3 @@ endef CLEAN_FILES +=3D arch/$(ARCH)/boot/fdimage \ arch/$(ARCH)/boot/image.iso \ arch/$(ARCH)/boot/mtools.conf -CLEAN_FILES +=3D vmlinuz vmlinux-stripped Index: head-2007-09-03/arch/i386/boot/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-09-03.orig/arch/i386/boot/Makefile 2007-07-09 = 01:32:17.000000000 +0200 +++ head-2007-09-03/arch/i386/boot/Makefile 2007-09-17 14:05:15.0000000= 00 +0200 @@ -26,7 +26,7 @@ SVGA_MODE :=3D -DSVGA_MODE=3DNORMAL_VGA #RAMDISK :=3D -DRAMDISK=3D512 =20 targets :=3D vmlinux.bin bootsect bootsect.o \ - setup setup.o zImage bzImage + setup setup.o zImage bzImage vmlinuz vmlinux-stripped subdir- :=3D compressed =20 hostprogs-y :=3D tools/build @@ -133,5 +133,13 @@ zlilo: $(BOOTIMAGE) cp System.map $(INSTALL_PATH)/ if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi =20 +$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE + $(call if_changed,gzip) + @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' + +$(obj)/vmlinux-stripped: OBJCOPYFLAGS :=3D -g --strip-unneeded +$(obj)/vmlinux-stripped: vmlinux FORCE + $(call if_changed,objcopy) + install: sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) = System.map "$(INSTALL_PATH)" Index: head-2007-09-03/arch/i386/boot-xen/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-09-03.orig/arch/i386/boot-xen/Makefile 2007-09-17 = 14:22:09.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,19 +0,0 @@ - -OBJCOPYFLAGS :=3D -g --strip-unneeded - -vmlinuz: vmlinux-stripped FORCE - $(call if_changed,gzip) - -vmlinux-stripped: vmlinux FORCE - $(call if_changed,objcopy) - -INSTALL_ROOT :=3D $(patsubst %/boot,%,$(INSTALL_PATH)) - -XINSTALL_NAME ?=3D $(KERNELRELEASE) -install: - mkdir -p $(INSTALL_ROOT)/boot - install -m0644 vmlinuz $(INSTALL_ROOT)/boot/vmlinuz-$(XINSTALL_NAME= )$(INSTALL_SUFFIX) - install -m0644 vmlinux $(INSTALL_ROOT)/boot/vmlinux-syms-$(XINSTALL= _NAME)$(INSTALL_SUFFIX) - install -m0664 .config $(INSTALL_ROOT)/boot/config-$(XINSTALL_NAME)= $(INSTALL_SUFFIX) - install -m0664 System.map $(INSTALL_ROOT)/boot/System.map-$(XINSTAL= L_NAME)$(INSTALL_SUFFIX) - ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) $(INSTALL_ROOT)/= boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(shell [ -e $(objtree)/localversion-x= en ] && cat $(objtree)/localversion-xen)$(INSTALL_SUFFIX) Index: head-2007-09-03/arch/x86_64/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-09-03.orig/arch/x86_64/Makefile 2007-09-17 14:22:54.0000000= 00 +0200 +++ head-2007-09-03/arch/x86_64/Makefile 2007-09-17 14:12:40.0000000= 00 +0200 @@ -88,22 +88,20 @@ drivers-$(CONFIG_KDB) +=3D = arch/x86_64/k =20 boot :=3D arch/x86_64/boot =20 -PHONY +=3D bzImage bzlilo install archmrproper \ +PHONY +=3D bzImage bzlilo vmlinuz install archmrproper \ fdimage fdimage144 fdimage288 isoimage archclean =20 ifdef CONFIG_XEN CPPFLAGS :=3D -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS) LDFLAGS_vmlinux :=3D -e startup_64 -boot :=3D arch/i386/boot-xen -.PHONY: vmlinuz #Default target when executing "make" all: vmlinuz =20 -vmlinuz: vmlinux - $(Q)$(MAKE) $(build)=3D$(boot) $@ +BOOTIMAGE :=3D $(boot)/vmlinuz +KBUILD_IMAGE :=3D $(BOOTIMAGE) =20 -install: - $(Q)$(MAKE) $(build)=3D$(boot) $@ +vmlinuz: vmlinux + $(Q)$(MAKE) $(build)=3D$(boot) $(BOOTIMAGE) else #Default target when executing "make" all: bzImage @@ -122,10 +120,10 @@ bzdisk: vmlinux =20 fdimage fdimage144 fdimage288 isoimage: vmlinux $(Q)$(MAKE) $(build)=3D$(boot) BOOTIMAGE=3D$(BOOTIMAGE) $@ +endif =20 install: $(Q)$(MAKE) $(build)=3D$(boot) BOOTIMAGE=3D$(BOOTIMAGE) $@=20 -endif =20 archclean: $(Q)$(MAKE) $(clean)=3D$(boot) Index: head-2007-09-03/arch/x86_64/boot/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-09-03.orig/arch/x86_64/boot/Makefile 2007-07-09 = 01:32:17.000000000 +0200 +++ head-2007-09-03/arch/x86_64/boot/Makefile 2007-09-17 14:09:13.0000000= 00 +0200 @@ -26,7 +26,7 @@ SVGA_MODE :=3D -DSVGA_MODE=3DNORMAL_VGA #RAMDISK :=3D -DRAMDISK=3D512 =20 targets :=3D vmlinux.bin bootsect bootsect.o \ - setup setup.o bzImage mtools.conf + setup setup.o bzImage mtools.conf vmlinuz vmlinux-stripp= ed =20 EXTRA_CFLAGS :=3D -m32 =20 @@ -131,5 +131,13 @@ zlilo: $(BOOTIMAGE) cp System.map $(INSTALL_PATH)/ if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi =20 +$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE + $(call if_changed,gzip) + @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' + +$(obj)/vmlinux-stripped: OBJCOPYFLAGS :=3D -g --strip-unneeded +$(obj)/vmlinux-stripped: vmlinux FORCE + $(call if_changed,objcopy) + install: sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) = System.map "$(INSTALL_PATH)"