WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86: match native behavior of 'make install'
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Tue, 18 Sep 2007 08:50:48 +0100
Delivery-date: Tue, 18 Sep 2007 00:50:28 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86: match native behavior of 'make install', Jan Beulich <=