-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_rt_kernel.sh
More file actions
40 lines (32 loc) · 1.22 KB
/
Copy pathbuild_rt_kernel.sh
File metadata and controls
40 lines (32 loc) · 1.22 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
35
36
37
38
39
40
#!/bin/bash
set -e
echo "[*] Installing dependencies..."
sudo apt update && sudo apt install -y \
git bc bison flex libssl-dev make libncurses5-dev raspberrypi-kernel-headers
echo "[*] Cloning Raspberry Pi 6.15.y kernel..."
cd ~
[ -d linux ] && sudo rm -rf linux
git clone --depth 1 --branch rpi-6.15.y https://github.com/raspberrypi/linux
cd linux
echo "[*] Configuring kernel..."
make bcm2712_defconfig
yes "" | make menuconfig
echo "[*] Building kernel..."
make prepare
make CFLAGS='-O3 -march=native' -j6 Image.gz modules dtbs
sudo make -j6 modules_install
echo "[*] Setting up boot directories..."
sudo mkdir -p /boot/firmware/NTP/overlays-NTP
echo "[*] Copying kernel and device trees..."
sudo cp arch/arm64/boot/dts/broadcom/*.dtb /boot/firmware/NTP/
sudo cp arch/arm64/boot/dts/overlays/*.dtb* /boot/firmware/NTP/overlays-NTP/
sudo cp arch/arm64/boot/dts/overlays/README /boot/firmware/NTP/overlays-NTP/
sudo cp arch/arm64/boot/Image.gz /boot/firmware/kernel_2712-NTP.img
echo "[*] Updating /boot/firmware/config.txt..."
sudo tee -a /boot/firmware/config.txt > /dev/null <<EOL
os_prefix=NTP/
overlay_prefix=overlays-NTP/
kernel=/kernel_2712-NTP.img
EOL
echo "[*] Build complete. Rebooting into PREEMPT_RT kernel..."
sudo reboot now