bookworm kernel headers for camera driver kernel module

Open
#6,326 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux, raspberry-pi

Research direction

Start with the reported Kbuild and the external-module command using the 6.6.31 Bookworm headers, then compare it with the successful 6.1.21 build. Reproduce the missing imx219-overlay.dtbo target and inspect the kernel-header build behavior around the listed Kbuild entries. Done means the imx219 module and device-tree overlay build successfully against the Bookworm headers.

Written by the indexing model from the issue text.

Description

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:

    pi@raspberrypi:~/ams_rpi_kernel/imx219/src $ tree
    .
    ├── imx219.c
    ├── imx219.dtsi
    ├── imx219-overlay.dts
    ├── Kbuild
    └── Makefile 

pi@raspberrypi:~/ams_rpi_kernel/imx219/src $ make -C /lib/modules/6.6.31+rpt-rpi-v8/build  M=$PWD CPATH=/usr/src/linux-headers-6.6.31+rpt-common-rpi/include/ 
make: Entering directory '/usr/src/linux-headers-6.6.31+rpt-rpi-v8'
  CC [M]  /home/pi/ams_rpi_kernel/imx219/src/imx219.o
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.
make[1]: *** [/usr/src/linux-headers-6.6.31+rpt-common-rpi/Makefile:1938: /home/pi/ams_rpi_kernel/imx219/src] Error 2
make: *** [/usr/src/linux-headers-6.6.31+rpt-common-rpi/Makefile:246: __sub-make] Error 2
make: Leaving directory '/usr/src/linux-headers-6.6.31+rpt-rpi-v8'

on older kernel versions, this command worked fine for me. (6.1.y headers + imx219.c from that kernel)


pi@raspberrypi:~/ams_rpi_kernel/imx219/src61 $ make -C /lib/modules/6.1.21-v8+/build/  M=$PWD CPATH=/usr/src/linux-headers-6.1.21-v8+/include/
make: Entering directory '/usr/src/linux-headers-6.1.21-v8+'
warning: the compiler differs from the one used to build the kernel
  The kernel was built by: gcc (Debian 10.2.1-6) 10.2.1 20210110
  You are using:           gcc (Debian 12.2.0-14) 12.2.0
  CC [M]  /home/pi/ams_rpi_kernel/imx219/src61/imx219.o
  DTCO    /home/pi/ams_rpi_kernel/imx219/src61/imx219.dtbo
  MODPOST /home/pi/ams_rpi_kernel/imx219/src61/Module.symvers
  CC [M]  /home/pi/ams_rpi_kernel/imx219/src61/imx219.mod.o
  LD [M]  /home/pi/ams_rpi_kernel/imx219/src61/imx219.ko
make: Leaving directory '/usr/src/linux-headers-6.1.21-v8+'

more info:
I'm using pi4b, 64bit, bookworm. kernel 6.6.31.


pi@raspberrypi:~/ams_rpi_kernel/imx219/src $ uname -a
Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux

contents of the files:
Kbuild


obj-m  := imx219.o
dtbo-y += imx219.dtbo
targets += $(dtbo-y)
always  := $(dtbo-y)
always-y        := $(dtbo-y)

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.