qemu-rpi-kernel
qemu-rpi-kernel copied to clipboard
build failed for kernel modules on qemu-rpi
i want to do some dev on qemu-rpi with kernel modules support. but it seems the linux-headers could not be installed.
first the boot log:
systemd[1]: Started Remount Root and Kernel File Systems.
[ OK ] Started Remount Root and Kernel File Systems.
systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: Failed to start Load Kernel Modules.
[FAILED] Failed to start Load Kernel Modules.
See 'systemctl status systemd-modules-load.service' for details.
the headers install log:
$ sudo apt install linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-headers-4.4.34
E: Couldn't find any package by glob 'linux-headers-4.4.34'
E: Couldn't find any package by regex 'linux-headers-4.4.34'
You have the same problem with me, I guess this kernel will change the version of $(uname -r).
I believe when you use this kernel with for example raspbian, modules from raspbian will not match version of this kernel. Raspbian buster kernel in this moment is 4.19.57+/
and qemu-rpi-kernel
is just 4.19.50+
.
You can try to install exactly same kernel version with rpi-update commit-hash
, but modules will probably not be compatible and will not load (linux has not stable ABI). Only solution that might work is to compile kernel modules for exact qemu-rpi-kernel
and copy then to /lib/modules
of your image.