Kernel headers missing build folder after updating to 9.10

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version
    G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=10
    G_DIETPI_VERSION_RC=0
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’
    G_LIVE_PATCH_STATUS[0]=‘applied’
  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN
    bookworm 0
  • Kernel version | uname --all
    Linux raspberrypi 6.6.74+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.74-1+rpt1 (2025-01-27) aarch64 GNU/Linux
  • Architecture | dpkg --print-architecture
    arm64
  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)
    RPi 4 Model B (aarch64)
  • Power supply used | (EG: 5V 1A RAVpower)
    Original raspberry pi power supply
  • SD card used | (EG: SanDisk ultra)
    SanDisk ultra

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)
  • Was the software title installed freshly or updated/migrated?
  • Can this issue be replicated on a fresh installation of DietPi?
    ← If you sent a “dietpi-bugreport”, please paste the ID here →
  • Bug report ID | echo $G_HW_UUID

Steps to reproduce

  1. Upgrade to dietpi 9.10
  2. cd /lib/modules/6.6.74+rpt-rpi-v8
  3. ls

Expected behaviour

  • there should be a build folder

Actual behaviour

  • There is no build folder

Extra details

Running sudo apt update; sudo apt upgrade; sudo apt reinstall raspberrypi-kernel-headersdoesn’t solve the issue, furthermore the reinstall command complains about kernels headers not being installed :

run-parts: executing /etc/kernel/header_postinst.d/dkms 6.1.21+
dkms: autoinstall for kernel 6.1.21+ was skipped since the kernel headers for this kernel do not seem to be installed.
run-parts: executing /etc/kernel/header_postinst.d/dkms 6.1.21-v7+
dkms: autoinstall for kernel 6.1.21-v7+ was skipped since the kernel headers for this kernel do not seem to be installed.
run-parts: executing /etc/kernel/header_postinst.d/dkms 6.1.21-v7l+
dkms: autoinstall for kernel 6.1.21-v7l+ was skipped since the kernel headers for this kernel do not seem to be installed.
run-parts: executing /etc/kernel/header_postinst.d/dkms 6.1.21-v8+
dkms: running auto installation service for kernel 6.1.21-v8+.
dkms: autoinstall for kernel: 6.1.21-v8+.

I’d appreciate help regarding this as it is necessary to install the drivers for my wifi card

this is a mismatch, your system is 64bit but it tries to install for 32bit kernel??

as well the version 6.1.21-v7l+ vs 6.6.74+rpt-rpi-v8 installed on your system. Are you sure you are running correct build script?

Interesting, on my RPi 4B it’s there:

root@RPi4:~# ls /lib/modules/6.6.74+rpt-rpi-v8
insgesamt 2828
drwxr-xr-x 11 root root   4096 10. Feb 17:57 kernel
-rw-r--r--  1 root root 684457 10. Feb 17:57 modules.alias
-rw-r--r--  1 root root 705633 10. Feb 17:57 modules.alias.bin
-rw-r--r--  1 root root  16607 27. Jan 18:19 modules.builtin
-rw-r--r--  1 root root   8122 10. Feb 17:57 modules.builtin.alias.bin
-rw-r--r--  1 root root  18824 10. Feb 17:57 modules.builtin.bin
-rw-r--r--  1 root root  97013 27. Jan 18:19 modules.builtin.modinfo
-rw-r--r--  1 root root 234008 10. Feb 17:57 modules.dep
-rw-r--r--  1 root root 316409 10. Feb 17:57 modules.dep.bin
-rw-r--r--  1 root root    384 10. Feb 17:57 modules.devname
-rw-r--r--  1 root root  72303 27. Jan 18:19 modules.order
-rw-r--r--  1 root root    989 10. Feb 17:57 modules.softdep
-rw-r--r--  1 root root 318100 10. Feb 17:57 modules.symbols
-rw-r--r--  1 root root 385098 10. Feb 17:57 modules.symbols.bin

I remember installing kernel headers manually in the past, but not raspberrypi-kernel-headers, this package is not present on my system.

I found linux-headers-6.6.74+rpt-rpi-v8, maybe the package changed with RPi 5? Btw also this package is not present in my system.
Maybe @MichaIng can bring some light into this case.

Yes, it’s the very same script I used on previous dietpi versions.
Fwiw /boot/config.txtdoes include the arm_64bit=1line

I also have the /lib/modules/6.6.74+rpt-rpi-v8folder but it’s missing the required buildsubfolder

it seems to check for the incorrect kernel? You are running 6.6.74.

The network card install script includes the following code that checks for headers.
I think the script is correct as it checks using uname -r

# check to see if the correct header files are installed
if [ ! -d "/lib/modules/$(uname -r)/build" ]; then
        echo "Your kernel header files aren't properly installed."
        echo "Please consult your distro documentation or user support forums."
        echo "Once the header files are properly installed, please run \"sudo ./${SCRIPT_NAME}\""
        exit 1
fi

But unfortunately the /buildsubfolder is missing.
Result from uname -r: 6.6.74+rpt-rpi-v8
Contents of /lib/modules/6.6.74+rpt-rpi-v8:

ls -l /lib/modules/6.6.74+rpt-rpi-v8/i 
drwxr-xr-x    - root 12 févr. 15:33  kernel
.rw-r--r-- 684k root 12 févr. 15:33  modules.alias
.rw-r--r-- 706k root 12 févr. 15:33  modules.alias.bin
.rw-r--r--  17k root 27 janv. 18:19  modules.builtin
.rw-r--r-- 8,1k root 12 févr. 15:33  modules.builtin.alias.bin
.rw-r--r--  19k root 12 févr. 15:33  modules.builtin.bin
.rw-r--r--  97k root 27 janv. 18:19  modules.builtin.modinfo
.rw-r--r-- 234k root 12 févr. 15:33  modules.dep
.rw-r--r-- 316k root 12 févr. 15:33  modules.dep.bin
.rw-r--r--  384 root 12 févr. 15:33  modules.devname
.rw-r--r--  72k root 27 janv. 18:19  modules.order
.rw-r--r--  989 root 12 févr. 15:33  modules.softdep
.rw-r--r-- 318k root 12 févr. 15:33  modules.symbols
.rw-r--r-- 385k root 12 févr. 15:33  modules.symbols.bin

The /lib/modules folder contains also the subfolder for kernel 6.1.21 (the previous kernel I assume) and this folder does contain the build subfolder (but nothing else) :

ls -l /lib/modules/6.1.21-v8+/
lrwxrwxrwx 33 root  5 avril  2023  build -> /usr/src/linux-headers-6.1.21-v8+

Did you already tried this one

1 Like

I’ve found it too but I’d rather have a solution that keeps working with future kernel versions.
If I’m not mistaken if I install manually this one I’ll have to do it again for every future kernel upgrade.
Not sure If I should do it regardless or not.

Sorry for the late reply. For the new Linux 6.6, the package linux-headers-rpi-v8 contains the needed headers and build link. It is a meta package like linux-image-rpi-v8, depending on the actual latest versioned headers package, linux-headers-6.6.74+rpt-rpi-v8 at the moment. When a new kernel is pushed to the APT servers, the dependencies will move to new versioned packages.

raspberrypi-kernel-headers is the old headers package for Linux 6.1.

1 Like

Thanks a lot !

1 Like