HW : 树梅派4b 4G
OS : ubuntu-20.04.2-server ARM64
下载 树梅派 的linux kernel
https://github.com/raspberrypi/linux
$git clone --depth=1 -b VERSION https://github.com/raspberrypi/linux.git
其中VERSION替换为对应的版本号.
加上--depth=1参数使得只会下载最新的一次commit. 查不到code 提交的历史。
也可下载直接unzip
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig
make -j8 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
在 linux-rpi-5.10.y/arch/arm64/boot/ 生成Image.gz
目前baidu上能收到的替换方法好像都是树梅派系统的方法。
唉,只能呢个生弄了
sd 会有两个分区system-boot writable. 注意如果把这个sd 挂载在windows上,就只能看到system-boot.
我pc 用的ubuntu 18
其中writable 的boot 下 vmlinuz , 感觉应该替换这个。但证明不行。
writable/boot$ ls -lh
total 90M
-rw------- 1 root root 4.0M Jan 20 18:27 System.map-5.4.0-1028-raspi
-rw------- 1 root root 4.0M May 13 00:44 System.map-5.4.0-1036-raspi
-rw-r--r-- 1 root root 214K Jan 20 18:27 config-5.4.0-1028-raspi
-rw-r--r-- 1 root root 215K May 13 00:44 config-5.4.0-1036-raspi
lrwxrwxrwx 1 root root 43 Jun 20 20:21 dtb -> dtbs/5.4.0-1036-raspi/./bcm2711-rpi-4-b.dtb
lrwxrwxrwx 1 root root 43 Jun 19 14:48 dtb-5.4.0-1028-raspi -> dtbs/5.4.0-1028-raspi/./bcm2711-rpi-4-b.dtb
lrwxrwxrwx 1 root root 43 Jun 20 20:21 dtb-5.4.0-1036-raspi -> dtbs/5.4.0-1036-raspi/./bcm2711-rpi-4-b.dtb
drwxr-xr-x 4 root root 4.0K Jun 20 20:21 dtbs
drwxr-xr-x 2 root root 4.0K Feb 1 19:19 firmware
lrwxrwxrwx 1 root root 27 Jun 20 20:20 initrd.img -> initrd.img-5.4.0-1036-raspi
-rw-r--r-- 1 root root 29M Jun 19 14:48 initrd.img-5.4.0-1028-raspi
-rw-r--r-- 1 root root 29M Jun 20 20:21 initrd.img-5.4.0-1036-raspi
lrwxrwxrwx 1 root root 27 Feb 1 19:16 initrd.img.old -> initrd.img-5.4.0-1028-raspi
lrwxrwxrwx 1 root root 14 Jun 22 19:14 vmlinuz -> vmlinuz-5.10.y
-rw-r--r-- 1 root root 7.7M Jun 22 19:13 vmlinuz-5.10.y
-rw------- 1 root root 8.0M Jan 20 18:27 vmlinuz-5.4.0-1028-raspi
-rw-r--r-- 1 root root 7.7M Jun 22 19:19 vmlinuz-5.4.0-1036-raspi
lrwxrwxrwx 1 root root 24 Feb 1 19:16 vmlinuz.old -> vmlinuz-5.4.0-1028-raspi
最后发现 system-boot 也有一个 vmlinuz。
linux-rpi-5.10.y/arch/arm64/boot/Image.gz
cp 到
system-boot/vmlinz.
在插回卡,重启动,发现kernel 版本已经更换,成功。
但我没改动dts所以那部分不用更新。