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