[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] linux/x86: match native behavior of 'make install'



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 <jbeulich@xxxxxxxxxx>

Index: head-2007-09-03/arch/i386/Makefile
===================================================================
--- head-2007-09-03.orig/arch/i386/Makefile     2007-09-17 14:22:09.000000000 
+0200
+++ head-2007-09-03/arch/i386/Makefile  2007-09-17 13:55:57.000000000 +0200
@@ -124,20 +124,18 @@ AFLAGS += $(mflags-y)
 
 boot := arch/i386/boot
 
-PHONY += zImage bzImage compressed zlilo bzlilo \
+PHONY += zImage bzImage vmlinuz compressed zlilo bzlilo \
          zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install
 
 ifdef CONFIG_XEN
 CPPFLAGS := -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
-boot := arch/i386/boot-xen
-.PHONY: vmlinuz
 all: vmlinuz
 
-vmlinuz: vmlinux
-       $(Q)$(MAKE) $(build)=$(boot) $@
+# KBUILD_IMAGE specifies the target image being built
+KBUILD_IMAGE := $(boot)/vmlinuz
 
-install:
-       $(Q)$(MAKE) $(build)=$(boot) $@
+vmlinuz: vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
 else
 all: bzImage
 
@@ -158,10 +156,10 @@ zdisk bzdisk: vmlinux
 
 fdimage fdimage144 fdimage288 isoimage: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
+endif
 
 install:
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
-endif
 
 archclean:
        $(Q)$(MAKE) $(clean)=arch/i386/boot
@@ -180,4 +178,3 @@ endef
 CLEAN_FILES += arch/$(ARCH)/boot/fdimage \
               arch/$(ARCH)/boot/image.iso \
               arch/$(ARCH)/boot/mtools.conf
-CLEAN_FILES += vmlinuz vmlinux-stripped
Index: head-2007-09-03/arch/i386/boot/Makefile
===================================================================
--- 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.000000000 
+0200
@@ -26,7 +26,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
 #RAMDISK := -DRAMDISK=512
 
 targets                := vmlinux.bin bootsect bootsect.o \
-                  setup setup.o zImage bzImage
+                  setup setup.o zImage bzImage vmlinuz vmlinux-stripped
 subdir-        := compressed
 
 hostprogs-y    := 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
 
+$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
+       $(call if_changed,gzip)
+       @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
+
+$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -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
===================================================================
--- 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 := -g --strip-unneeded
-
-vmlinuz: vmlinux-stripped FORCE
-       $(call if_changed,gzip)
-
-vmlinux-stripped: vmlinux FORCE
-       $(call if_changed,objcopy)
-
-INSTALL_ROOT := $(patsubst %/boot,%,$(INSTALL_PATH))
-
-XINSTALL_NAME ?= $(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-$(XINSTALL_NAME)$(INSTALL_SUFFIX)
-       ln -f -s vmlinuz-$(XINSTALL_NAME)$(INSTALL_SUFFIX) 
$(INSTALL_ROOT)/boot/vmlinuz-$(VERSION).$(PATCHLEVEL)$(shell [ -e 
$(objtree)/localversion-xen ] && cat 
$(objtree)/localversion-xen)$(INSTALL_SUFFIX)
Index: head-2007-09-03/arch/x86_64/Makefile
===================================================================
--- head-2007-09-03.orig/arch/x86_64/Makefile   2007-09-17 14:22:54.000000000 
+0200
+++ head-2007-09-03/arch/x86_64/Makefile        2007-09-17 14:12:40.000000000 
+0200
@@ -88,22 +88,20 @@ drivers-$(CONFIG_KDB)                       += arch/x86_64/k
 
 boot := arch/x86_64/boot
 
-PHONY += bzImage bzlilo install archmrproper \
+PHONY += bzImage bzlilo vmlinuz install archmrproper \
         fdimage fdimage144 fdimage288 isoimage archclean
 
 ifdef CONFIG_XEN
 CPPFLAGS := -Iinclude$(if $(KBUILD_SRC),2)/asm/mach-xen $(CPPFLAGS)
 LDFLAGS_vmlinux := -e startup_64
-boot := arch/i386/boot-xen
-.PHONY: vmlinuz
 #Default target when executing "make"
 all: vmlinuz
 
-vmlinuz: vmlinux
-       $(Q)$(MAKE) $(build)=$(boot) $@
+BOOTIMAGE                     := $(boot)/vmlinuz
+KBUILD_IMAGE                  := $(BOOTIMAGE)
 
-install:
-       $(Q)$(MAKE) $(build)=$(boot) $@
+vmlinuz: vmlinux
+       $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
 else
 #Default target when executing "make"
 all: bzImage
@@ -122,10 +120,10 @@ bzdisk: vmlinux
 
 fdimage fdimage144 fdimage288 isoimage: vmlinux
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
+endif
 
 install:
        $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 
-endif
 
 archclean:
        $(Q)$(MAKE) $(clean)=$(boot)
Index: head-2007-09-03/arch/x86_64/boot/Makefile
===================================================================
--- 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.000000000 
+0200
@@ -26,7 +26,7 @@ SVGA_MODE := -DSVGA_MODE=NORMAL_VGA
 #RAMDISK := -DRAMDISK=512
 
 targets                := vmlinux.bin bootsect bootsect.o \
-                  setup setup.o bzImage mtools.conf
+                  setup setup.o bzImage mtools.conf vmlinuz vmlinux-stripped
 
 EXTRA_CFLAGS := -m32
 
@@ -131,5 +131,13 @@ zlilo: $(BOOTIMAGE)
        cp System.map $(INSTALL_PATH)/
        if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
 
+$(obj)/vmlinuz: $(obj)/vmlinux-stripped FORCE
+       $(call if_changed,gzip)
+       @echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
+
+$(obj)/vmlinux-stripped: OBJCOPYFLAGS := -g --strip-unneeded
+$(obj)/vmlinux-stripped: vmlinux FORCE
+       $(call if_changed,objcopy)
+
 install:
        sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) 
System.map "$(INSTALL_PATH)"



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.