我正在尝试在 raspberry pi 4b 上从源代码构建内核 uname -a 显示
Linux ubuntu-pi-kit 5.13.0-1025-raspi #27-Ubuntu SMP PREEMPT Tue Apr 5 12:08:41 UTC 2022 armv7l armv7l armv7l GNU/Linux
我下载了内核源代码
fakeroot apt-get source linux-image-$(uname -r)
内核已构建,但当我尝试安装它时,似乎存在版本错误,例如内核模块
/kernel/linux-raspi-5.13.0$ sudo make install
然后出现错误
sh ./arch/arm/boot/install.sh "5.13.19" \
arch/arm/boot/Image System.map "/boot"
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 5.13.19 /boot/vmlinuz-5.13.19
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 5.13.19 /boot/vmlinuz-5.13.19
update-initramfs: Generating /boot/initrd.img-5.13.19
W: missing /lib/modules/5.13.19
W: Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/5.13.19: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
cat: /var/tmp/mkinitramfs_hWlPd7/lib/modules/5.13.19/modules.builtin: No such file or directory
W: Can't find modules.builtin.modinfo (for locating built-in drivers' firmware, supported in Linux >=5.2)
depmod: WARNING: could not open modules.order at /var/tmp/mkinitramfs_hWlPd7/lib/modules/5.13.19: No such file or directory
depmod: WARNING: could not open modules.builtin at /var/tmp/mkinitramfs_hWlPd7/lib/modules/5.13.19: No such file or directory
Using DTB: bcm2711-rpi-4-b.dtb
Couldn't find DTB bcm2711-rpi-4-b.dtb on the following paths: /etc/flash-kernel/dtbs /usr/lib/linux-image-5.13.19 /lib/firmware/5.13.19/device-tree/
Installing into /boot/dtbs/5.13.19/./bcm2711-rpi-4-b.dtb
cp: cannot stat '': No such file or directory
run-parts: /etc/initramfs/post-update.d//flash-kernel exited with return code 1
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
make[1]: *** [arch/arm/boot/Makefile:107: install] Error 1
当我编译内核时,确实花费了大量时间来编译内核模块。
好的,我发现我需要添加 make_install,如下所示
sudo make modules_install install
烧毁模块并将其放置在正确的位置。但是 dtb 文件仍然缺失。
任何帮助均感激不尽。