Following https://wiki.radxa.com/Rockpi4/dev/Debian#Build_kernel I successfully customized kernel and the system boots, but the kernel modules and headers are missing.
For example:
root@rockpi4:~# modprobe cifs
modprobe: ERROR: …/libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file ‘/lib/modules/4.4.154-00002-gc26d93d00149/modules.dep.bin’
modprobe: FATAL: Module cifs not found in directory /lib/modules/4.4.154-00002-gc26d93d00149
The directory /lib/modules is missing.
How to copy the kernel modules and headers to rootfs image?
thank you for clarifying that for me, I thought that this procedure is included in one of the existing scripts, i.e. mk-rootfs.sh.
Next, to build and install headers:
# mkdir -p ~/rockpi4/rockchip-bsp/out/headers
# make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- headers_install INSTALL_HDR_PATH=~/rockpi4/rockchip-bsp/out/headers
That didn’t create the directory structure I expected, so I improvised (on the target machine):
# ls /lib/modules/
4.4.154-00002-gc26d93d00149
# mkdir -p /usr/src/linux-headers-4.4.154-00002-gc26d93d00149
# rsync -aHAXx --no-links [email protected]:/home/zoran/rockpi4/rockchip-bsp/out/headers/include/* /usr/src/linux-headers-4.4.154-00002-gc26d93d00149