kbuild: drop vmlinux dependency from "make install"

This removes the dependency from vmlinux to install, thus avoiding the
current situation where "make install" has a nasty tendency to leave
root-turds in the working directory.

It also updates x86-64 to be in sync with i386.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

authored by

H. Peter Anvin and committed by
Sam Ravnborg
0d20babd 63b794bf

+23 -45
+2 -3
arch/i386/Makefile
··· 103 boot := arch/i386/boot 104 105 .PHONY: zImage bzImage compressed zlilo bzlilo \ 106 - zdisk bzdisk fdimage fdimage144 fdimage288 install kernel_install 107 108 all: bzImage 109 ··· 125 fdimage fdimage144 fdimage288: vmlinux 126 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ 127 128 - install: vmlinux 129 - install kernel_install: 130 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install 131 132 archclean:
··· 103 boot := arch/i386/boot 104 105 .PHONY: zImage bzImage compressed zlilo bzlilo \ 106 + zdisk bzdisk fdimage fdimage144 fdimage288 install 107 108 all: bzImage 109 ··· 125 fdimage fdimage144 fdimage288: vmlinux 126 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@ 127 128 + install: 129 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install 130 131 archclean:
+1 -1
arch/i386/boot/Makefile
··· 100 cp System.map $(INSTALL_PATH)/ 101 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 102 103 - install: $(BOOTIMAGE) 104 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
··· 100 cp System.map $(INSTALL_PATH)/ 101 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 102 103 + install: 104 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $< System.map "$(INSTALL_PATH)"
+14
arch/i386/boot/install.sh
··· 19 # $4 - default install path (blank if root directory) 20 # 21 22 # User may have a custom install script 23 24 if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
··· 19 # $4 - default install path (blank if root directory) 20 # 21 22 + verify () { 23 + if [ ! -f "$1" ]; then 24 + echo "" 1>&2 25 + echo " *** Missing file: $1" 1>&2 26 + echo ' *** You need to run "make" before "make install".' 1>&2 27 + echo "" 1>&2 28 + exit 1 29 + fi 30 + } 31 + 32 + # Make sure the files actually exist 33 + verify "$2" 34 + verify "$3" 35 + 36 # User may have a custom install script 37 38 if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi
+4 -1
arch/x86_64/Makefile
··· 80 bzdisk: vmlinux 81 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk 82 83 - install fdimage fdimage144 fdimage288: vmlinux 84 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 85 86 archclean: 87 $(Q)$(MAKE) $(clean)=$(boot)
··· 80 bzdisk: vmlinux 81 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) zdisk 82 83 + fdimage fdimage144 fdimage288: vmlinux 84 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 85 + 86 + install: 87 + $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ 88 89 archclean: 90 $(Q)$(MAKE) $(clean)=$(boot)
+1 -1
arch/x86_64/boot/Makefile
··· 98 cp System.map $(INSTALL_PATH)/ 99 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 100 101 - install: $(BOOTIMAGE) 102 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
··· 98 cp System.map $(INSTALL_PATH)/ 99 if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi 100 101 + install: 102 sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"
+1 -39
arch/x86_64/boot/install.sh
··· 1 #!/bin/sh 2 - # 3 - # arch/x86_64/boot/install.sh 4 - # 5 - # This file is subject to the terms and conditions of the GNU General Public 6 - # License. See the file "COPYING" in the main directory of this archive 7 - # for more details. 8 - # 9 - # Copyright (C) 1995 by Linus Torvalds 10 - # 11 - # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin 12 - # 13 - # "make install" script for i386 architecture 14 - # 15 - # Arguments: 16 - # $1 - kernel version 17 - # $2 - kernel image file 18 - # $3 - kernel map file 19 - # $4 - default install path (blank if root directory) 20 - # 21 - 22 - # User may have a custom install script 23 - 24 - if [ -x ~/bin/${CROSS_COMPILE}installkernel ]; then exec ~/bin/${CROSS_COMPILE}installkernel "$@"; fi 25 - if [ -x /sbin/${CROSS_COMPILE}installkernel ]; then exec /sbin/${CROSS_COMPILE}installkernel "$@"; fi 26 - 27 - # Default install - same as make zlilo 28 - 29 - if [ -f $4/vmlinuz ]; then 30 - mv $4/vmlinuz $4/vmlinuz.old 31 - fi 32 - 33 - if [ -f $4/System.map ]; then 34 - mv $4/System.map $4/System.old 35 - fi 36 - 37 - cat $2 > $4/vmlinuz 38 - cp $3 $4/System.map 39 - 40 - if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
··· 1 #!/bin/sh 2 + . $srctree/arch/i386/boot/install.sh