-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_kernel.sh
executable file
·34 lines (31 loc) · 1017 Bytes
/
install_kernel.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
###################################################################
# A simple helper script for installing cross-builded RISC-V #
# kernel generated by "rv_cross_building_kernel.sh". Install #
# a ${VERSION} kernel by putting ${VERSION}_kernel_install.tar.gz #
# to the same directory of this script and typing "./install_ker- #
# -nel ${VERSION}" #
###################################################################
if [ $# -eq 1 ];
then
VERSION=$1
echo "installing kernel version [$1]..."
if [ ! -f "$1_kernel_install.tar.gz" ];then
echo "[ERROR] target kernel zipfile not exist!"
exit
fi
tar -xzf $1_kernel_install.tar.gz
mv *$1 /boot
OLDPATH=$(pwd)
cd _install/lib/modules
mv ./$1 /lib/modules
cd ${OLDPATH}
rm -r _install
update-initramfs -c -k $1
u-boot-update
echo "install kernel version [$1] complete!"
else
echo "[ERROR] invalid arguement!"
echo "usage: (somewhere)/install_kernel.sh [\$kernel_version]"
exit
fi