-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrpi5rt.txt
More file actions
51 lines (30 loc) · 2.01 KB
/
rpi5rt.txt
File metadata and controls
51 lines (30 loc) · 2.01 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
41
42
43
44
45
46
47
48
49
50
Building real-time kernel for Raspberry Pi 5
============================================
These are the commands I used immediately after installing RaspiOS and setting my wifi password.
The exact OS image I used was 2024-11-19-raspios-bookworm-arm64.img, which shows as kernel version 6.6.78 but if you want to use a newer version, you'll have to replace the patch file names below with the apporopriate matching version. You can find other patch files by looking around under https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt and replacing the 'wget' call with the matching file (use the one with 'patch.gz' extension).
---------------------------------------------------
sudo apt update
sudo apt upgrade
sudo reboot now
---- After reboot ----
sudo apt install bc bison flex libssl-dev make libncurses5-dev
git clone --depth=1 https://github.com/raspberrypi/linux
wget https://mirrors.edge.kernel.org/pub/linux/kernel/projects/rt/6.6/patch-6.6.78-rt52-rc1.patch.gz
cd linux
zcat ../patch-6.6.78-rt52-rc1.patch.gz | patch -p1
KERNEL=kernel_2712
make bcm2712_defconfig
make menuconfig # General -> Preemption Model select Real Time option
# Edit the .config file to add a personalised suffix to CONFIG_LOCALVERSION (not required but helps to identify which kernel is running later)
make -j4 Image.gz modules dtbs # takes about 40 minutes on Pi5
sudo make -j6 modules_install
sudo cp arch/arm64/boot/Image.gz /boot/firmware/kernel_2712_rt.img
sudo cp arch/arm64/boot/dts/broadcom/*.dtb /boot/firmware/
sudo cp arch/arm64/boot/dts/overlays/*.dtb* /boot/firmware/overlays/
sudo cp arch/arm64/boot/dts/overlays/README /boot/firmware/overlays/
# Edit /boot/firmware/config.txt to add "kernel=kernel_2712_rt.img" in the [all] section
sudo reboot now
---- After reboot ----
uname -a # should show PREEMPT_RT and the kernel suffix you set
---- To save yourself enormous confusion and frustration later, prevent apt from updating any kernel components back to the standard ones like this:
sudo apt-mark hold raspberrypi-kernel