本人经过多次踩坑,反复安装数次,总结如下
====================================================
树莓派3b+装实时补丁,(直接对树莓派上操作)
写在前面,如果觉得下东西慢,可以先换个源,网上教程很多,不过换源要注意自己版本就行。
详情看: https://mirrors.tuna.tsinghua.edu.cn/help/raspberrypi/
https://mirrors.tuna.tsinghua.edu.cn/help/raspbian/
有说明。
====================================================
装一些必要的工具
sudo apt-get install bc
sudo apt-get install libncurses-dev libssl-dev
sudo apt-get install build-essential kmod cpio flex cpio bison
创建文件夹
mkdir ~/kernel && cd ~/kernel
把源码压缩包下载好放到该路径下,我是提前下好的,用mobaxterm直接粘过去的(很方便)
我下载的是4.19这个rt
解压:
unzip linux-rpi-4.19.y-rt
到linux-rpi-4.19.y-rt路径下来
cd linux-rpi-4.19.y-rt
对照内核配置型号(看官方的)
网址如下https://www.raspberrypi.com/documentation/computers/linux_kernel.html
找到对应型号和位数
我的是32位
KERNEL=kernel7
make bcm2709_defconfig
然后确保实时内核好了:
make menuconfig
选择General setup–>
选择Preemption Model(Fully Preemptible Kernel (RT))–>
选择Fully Preemptible Kernel (RT)保存退出。
开始编译(32位与64位指令有差异)
make -j4 zImage modules dtbs
大概等几个小时吧
编译完成后,安装模块:
sudo make modules_install
复制内容到boot:
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
最后替换内核:
sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
重启:
sudo reboot
再uname -a
看看版本中是否含rt,有就好了
========================================================
12-27
05-07
1788
01-02
2562
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交