-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallkernel
More file actions
35 lines (30 loc) · 1.02 KB
/
Copy pathinstallkernel
File metadata and controls
35 lines (30 loc) · 1.02 KB
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
# RPI4 Manjaro installkernel script
# Fox Chen <foxhlchen@gmail.com>
#
# Setup:
# copy /boot/config.txt to /boot/config.txt.origin
# copy this script to /sbin/installkernel
#
# Usage:
# git clone <mainline kernel src code>
# cd <mainline kernel src code folder>
# make defconfig
# sudo make modules_install install
#
# Arguments:
# $1 - kernel version
# $2 - kernel image file
# $3 - kernel map file
# $4 - default install path (blank if root directory)
#
echo '>>> Copy the kernel image <<<' &&
cp -v $2 $4/vmlinuz-linux-$1 &&
echo '>>> Create initramfs image <<<' &&
mkinitcpio -k $1 -c /etc/mkinitcpio.conf -g $4/initramfs-linux-$1.img &&
echo '>>> Update dtb <<<' &&
cp -v arch/arm64/boot/dts/broadcom/bcm2711-rpi-4-b.dtb /boot/ &&
echo '>>> Update config.txt <<<' &&
cp -vf /boot/config.txt.origin /boot/config.txt.tmp &&
sed -i "s/initramfs-linux.img/initramfs-linux-$1.img/g" /boot/config.txt.tmp &&
sed -i "s/kernel8.img/vmlinuz-linux-$1/g" /boot/config.txt.tmp &&
mv -vf /boot/config.txt.tmp /boot/config.txt