Skip to content
Snippets Groups Projects
  • Sam Ravnborg's avatar
    caa27b66
    kbuild: use INSTALLKERNEL to select customized installkernel script · caa27b66
    Sam Ravnborg authored
    
    Replace the use of CROSS_COMPILE to select a customized
    installkernel script with the possibility to set INSTALLKERNEL
    to select a custom installkernel script when running make:
    
        make INSTALLKERNEL=arm-installkernel install
    
    With this patch we are now more consistent across
    different architectures - they did not all support use
    of CROSS_COMPILE.
    
    The use of CROSS_COMPILE was a hack as this really belongs
    to gcc/binutils and the installkernel script does not change
    just because we change toolchain.
    
    The use of CROSS_COMPILE caused troubles with an upcoming patch
    that saves CROSS_COMPILE when a kernel is built - it would no
    longer be installable.
    [Thanks to Peter Z. for this hint]
    
    This patch undos what Ian did in commit:
    
      0f8e2d62
      ("use ${CROSS_COMPILE}installkernel in arch/*/boot/install.sh")
    
    The patch has been lightly tested on x86 only - but all changes
    looks obvious.
    
    Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
    Acked-by: Mike Frysinger <vapier@gentoo.org> [blackfin]
    Acked-by: Russell King <linux@arm.linux.org.uk> [arm]
    Acked-by: Paul Mundt <lethal@linux-sh.org> [sh]
    Acked-by: "H. Peter Anvin" <hpa@zytor.com> [x86]
    Cc: Ian Campbell <icampbell@arcom.com>
    Cc: Tony Luck <tony.luck@intel.com> [ia64]
    Cc: Fenghua Yu <fenghua.yu@intel.com> [ia64]
    Cc: Hirokazu Takata <takata@linux-m32r.org> [m32r]
    Cc: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
    Cc: Kyle McMartin <kyle@mcmartin.ca> [parisc]
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> [powerpc]
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390]
    Cc: Thomas Gleixner <tglx@linutronix.de> [x86]
    Cc: Ingo Molnar <mingo@redhat.com> [x86]
    Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
    caa27b66
    History
    kbuild: use INSTALLKERNEL to select customized installkernel script
    Sam Ravnborg authored
    
    Replace the use of CROSS_COMPILE to select a customized
    installkernel script with the possibility to set INSTALLKERNEL
    to select a custom installkernel script when running make:
    
        make INSTALLKERNEL=arm-installkernel install
    
    With this patch we are now more consistent across
    different architectures - they did not all support use
    of CROSS_COMPILE.
    
    The use of CROSS_COMPILE was a hack as this really belongs
    to gcc/binutils and the installkernel script does not change
    just because we change toolchain.
    
    The use of CROSS_COMPILE caused troubles with an upcoming patch
    that saves CROSS_COMPILE when a kernel is built - it would no
    longer be installable.
    [Thanks to Peter Z. for this hint]
    
    This patch undos what Ian did in commit:
    
      0f8e2d62
      ("use ${CROSS_COMPILE}installkernel in arch/*/boot/install.sh")
    
    The patch has been lightly tested on x86 only - but all changes
    looks obvious.
    
    Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
    Acked-by: Mike Frysinger <vapier@gentoo.org> [blackfin]
    Acked-by: Russell King <linux@arm.linux.org.uk> [arm]
    Acked-by: Paul Mundt <lethal@linux-sh.org> [sh]
    Acked-by: "H. Peter Anvin" <hpa@zytor.com> [x86]
    Cc: Ian Campbell <icampbell@arcom.com>
    Cc: Tony Luck <tony.luck@intel.com> [ia64]
    Cc: Fenghua Yu <fenghua.yu@intel.com> [ia64]
    Cc: Hirokazu Takata <takata@linux-m32r.org> [m32r]
    Cc: Geert Uytterhoeven <geert@linux-m68k.org> [m68k]
    Cc: Kyle McMartin <kyle@mcmartin.ca> [parisc]
    Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> [powerpc]
    Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> [s390]
    Cc: Thomas Gleixner <tglx@linutronix.de> [x86]
    Cc: Ingo Molnar <mingo@redhat.com> [x86]
    Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
install.sh 1.40 KiB
#!/bin/sh
#
# arch/blackfin/boot/install.sh
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1995 by Linus Torvalds
#
# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
# Adapted from code in arch/i386/boot/install.sh by Mike Frysinger
#
# "make install" script for Blackfin architecture
#
# Arguments:
#   $1 - kernel version
#   $2 - kernel image file
#   $3 - kernel map file
#   $4 - default install path (blank if root directory)
#

verify () {
	if [ ! -f "$1" ]; then
		echo ""                                                   1>&2
		echo " *** Missing file: $1"                              1>&2
		echo ' *** You need to run "make" before "make install".' 1>&2
		echo ""                                                   1>&2
		exit 1
 	fi
}

# Make sure the files actually exist
verify "$2"
verify "$3"

# User may have a custom install script

if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
if which ${INSTALLKERNEL} >/dev/null 2>&1; then
	exec ${INSTALLKERNEL} "$@"
fi

# Default install - same as make zlilo

back_it_up() {
	local file=$1
	[ -f ${file} ] || return 0
	local stamp=$(stat -c %Y ${file} 2>/dev/null)
	mv ${file} ${file}.${stamp:-old}
}

back_it_up $4/uImage
back_it_up $4/System.map

cat $2 > $4/uImage
cp $3 $4/System.map