^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #!/bin/sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # arch/parisc/install.sh, derived from arch/i386/boot/install.sh
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) # This file is subject to the terms and conditions of the GNU General Public
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # License. See the file "COPYING" in the main directory of this archive
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) # for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) # Copyright (C) 1995 by Linus Torvalds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) # Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) # "make install" script for i386 architecture
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) # Arguments:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) # $1 - kernel version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) # $2 - kernel image file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) # $3 - kernel map file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) # $4 - default install path (blank if root directory)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) verify () {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) if [ ! -f "$1" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) echo "" 1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) echo " *** Missing file: $1" 1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) echo ' *** You need to run "make" before "make install".' 1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) echo "" 1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) exit 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) # Make sure the files actually exist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) verify "$2"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) verify "$3"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) # User may have a custom install script
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) if [ -n "${INSTALLKERNEL}" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) # Default install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) if [ "$(basename $2)" = "zImage" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) # Compressed install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) echo "Installing compressed kernel"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) base=vmlinuz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) # Normal install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) echo "Installing normal kernel"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) base=vmlinux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) if [ -f $4/$base-$1 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) mv $4/$base-$1 $4/$base-$1.old
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) cat $2 > $4/$base-$1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) # Install system map file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) if [ -f $4/System.map-$1 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) mv $4/System.map-$1 $4/System.map-$1.old
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) cp $3 $4/System.map-$1