Open pbaetens opened 2 months ago
simplified version linked here: https://forums.raspberrypi.com/viewtopic.php?t=375795
@davidplowman any experience w this? thanks!
@davidplowman any experience w this? thanks!
Sorry, I'm afraid I don't know anything about this. Other folk who monitor these issues would know more.
make[2]: *** No rule to make target '/home/pi/ams_rpi_kernel/imx219/src/imx219-overlay.dtbo', needed by '/home/pi/ams_rpi_kernel/imx219/src/'. Stop.
The rule is at https://github.com/raspberrypi/linux/blob/rpi-6.6.y/scripts/Makefile.lib#L429-L445
For some reason that doesn't appear to have been copied through to the version in /usr/lib/linux-kbuild-6.6.47+rpt/scripts, which is part of the package linux-kbuild-6.6.47+rpt and symlinked into /usr/src/linux-headers-6.6.47+rpt-rpi-[v8|2712].
@XECDesign how is linux-kbuild-6.6.47+rpt built, and is it sourcing a stock kernel tree rather than our tree?
I suspect it's here somewhere, which runs without any rpi patches applied.
So yeah, I think you've hit the nail on the head and it's a packaging issue. I'm not sure what the best way of fixing it is, but I'll give it a go.
any quick workaround you can think of? would upgrading to a newer kernel help? @XECDesign
I believe I have a fix which should be in the next apt kernel update. It also makes the linux-source
package match what's actually shipped.
@pbaetens Does everything work as expected with the latest packages?
now this error pops up..
pi@raspberry5:~/ams_rpi_kernel/imx219 $ make -C /lib/modules/6.6.51+rpt-rpi-v8/build M=$PWD CPATH=/usr/src/linux-headers-6.6.51+rpt-common-rpi/include/
make: Entering directory '/usr/src/linux-headers-6.6.51+rpt-rpi-v8'
DTCO /home/pi/ams_rpi_kernel/imx219/imx219.dtbo
/bin/sh: 1: ./scripts/dtc/dtc: not found
make[2]: *** [/usr/src/linux-headers-6.6.51+rpt-common-rpi/scripts/Makefile.lib:445: /home/pi/ams_rpi_kernel/imx219/imx219.dtbo] Error 127
make[1]: *** [/usr/src/linux-headers-6.6.51+rpt-common-rpi/Makefile:1946: /home/pi/ams_rpi_kernel/imx219] Error 2
make: *** [/usr/src/linux-headers-6.6.51+rpt-common-rpi/Makefile:246: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.6.51+rpt-rpi-v8'
You'll need to run a make ARCH=arm64 dtbs
at least once.
You'll need to run a
make ARCH=arm64 dtbs
at least once.
thanks. Do you have a guide somewhere? In which folder should I run this command? or you probably mean compile the whole kernel according to the raspberry pi docs?
Do you have a guide somewhere?
There is a full kernel compilation guide here: https://www.raspberrypi.com/documentation/computers/linux_kernel.html#building However, it doesn't cover the use of DKMS - it's not really used or supported here.
In which folder should I run this command?
The command would normally be run in the root of the kernel source tree, but I think you don't have one of those in a DKMS scenario. Looking in the gutted source directory (/usr/src/linux-headers-6.6.51+rpt-common-rpi/include/
, in your case), there is no scripts/dtc
, let alone scripts/dtc/dtc
, leading me to think that DKMS does not support the building of dtbs or overlays.
in fact I can just recompile the full kernel each time, but when making small changes to a driver, it is nice if I can only recompile that driver instead of the whole kernel.
the DTC folder does exist, but only for this 6.1.21 headers for some reason..
pi@raspberry5:/usr/src $ find . -type d -name 'dtc'
./linux-headers-6.1.21-v8+/scripts/dtc
pi@raspberry5:/usr/src $ ls -l
total 48
drwxr-xr-x 4 root root 4096 Jan 31 2024 linux-headers-6.1.0-rpi8-common-rpi
drwxr-xr-x 4 root root 4096 Jan 31 2024 linux-headers-6.1.0-rpi8-rpi-2712
drwxr-xr-x 4 root root 4096 Jan 31 2024 linux-headers-6.1.0-rpi8-rpi-v8
drwxr-xr-x 25 root root 4096 Feb 2 2024 linux-headers-6.1.21-v8+
drwxr-xr-x 4 root root 4096 Aug 26 13:35 linux-headers-6.6.31+rpt-common-rpi
drwxr-xr-x 4 root root 4096 Aug 26 16:28 linux-headers-6.6.31+rpt-rpi-2712
drwxr-xr-x 4 root root 4096 Aug 26 13:35 linux-headers-6.6.31+rpt-rpi-v8
drwxr-xr-x 4 root root 4096 Oct 7 11:23 linux-headers-6.6.51+rpt-common-rpi
drwxr-xr-x 4 root root 4096 Oct 7 11:23 linux-headers-6.6.51+rpt-rpi-2712
drwxr-xr-x 4 root root 4096 Oct 7 11:23 linux-headers-6.6.51+rpt-rpi-v8
lrwxrwxrwx 1 root root 23 Jan 25 2024 linux-kbuild-6.1 -> ../lib/linux-kbuild-6.1
lrwxrwxrwx 1 root root 30 May 29 16:04 linux-kbuild-6.6.31+rpt -> ../lib/linux-kbuild-6.6.31+rpt
lrwxrwxrwx 1 root root 30 Oct 1 15:05 linux-kbuild-6.6.51+rpt -> ../lib/linux-kbuild-6.6.51+rpt
drwxr-xr-x 4 root root 4096 Jan 31 2024 python3.11
drwxr-xr-x 3 root root 4096 Jan 31 2024 sense-hat
Do you have a link to the driver you're compiling?
LINK TO FORUM: https://forums.raspberrypi.com/viewtopic.php?p=2248093#p2248093
for a custom camera driver I'm trying to build a dkms module. For sake of simplicity, let's reproduce it with the imx219 driver. basically I have a folder structure like this:
on older kernel versions, this command worked fine for me. (6.1.y headers + imx219.c from that kernel)
more info: I'm using pi4b, 64bit, bookworm. kernel 6.6.31.
contents of the files: Kbuild