Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^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/riscv/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) # Adapted from code in arch/i386/boot/install.sh by Russell King
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) # "make install" script for the RISC-V Linux port
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) # Arguments:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #   $1 - kernel version
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #   $2 - kernel image file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #   $3 - kernel map file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #   $4 - default install path (blank if root directory)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) verify () {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	if [ ! -f "$1" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 		echo ""                                                   1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 		echo " *** Missing file: $1"                              1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 		echo ' *** You need to run "make" before "make install".' 1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 		echo ""                                                   1>&2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 		exit 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) # Make sure the files actually exist
^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) if [ -x ~/bin/${INSTALLKERNEL} ]; then exec ~/bin/${INSTALLKERNEL} "$@"; fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) if [ -x /sbin/${INSTALLKERNEL} ]; then exec /sbin/${INSTALLKERNEL} "$@"; fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) if [ "$(basename $2)" = "Image.gz" ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) # Compressed install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)   echo "Installing compressed kernel"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)   base=vmlinuz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) # Normal install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)   echo "Installing normal kernel"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)   base=vmlinux
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) if [ -f $4/$base-$1 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)   mv $4/$base-$1 $4/$base-$1.old
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) cat $2 > $4/$base-$1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) # Install system map file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) if [ -f $4/System.map-$1 ]; then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)   mv $4/System.map-$1 $4/System.map-$1.old
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) fi
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) cp $3 $4/System.map-$1