Raspberry Piのカーネル更新でlinux-imageはインストールされましたが、対応するヘッダーがインストールされなかったため、DKMSモジュールはビルドされませんでした。

Ubuntu Version:
26.04 LTS

Problem Description:

ChatGPTを使って、犬検出のpythonスクリプトを作成していたところ、find_vma警告が出gていることに気が付いた。できるだけ警告がでないように修正し、動作することができた。直後アップデートが起こったので、慎重にカーネル等の確認した。そこで、Hailo-8用DKMSドライバが生成されなかった事をChatGptが気が付いたので、投稿する。起動に関する知識ないので、ChatGptにスクリプトやドキュメントを作らせながらの確認した。Geminiでも起動の手順の認識は間違っていない確認され、間違っていないと思われる。ubuntuに報告すべき内容をChatGptに作成させたので、確認してほしいです。


-ここから-

Ubuntuへ報告する内容

Ubuntu側へは、次の点が対象です。

  • 自動更新でlinux-image-7.0.0-1014-raspilinux-modules-...は入った

  • 対応するlinux-headers-7.0.0-1014-raspiは入らなかった

  • そのため、外部DKMSモジュールであるhailo_pciが1014向けに生成されなかった

  • A/Bブートで新しい環境がbadとなり、旧カーネルへ戻った

  • ヘッダーを手動導入後、DKMS生成・initramfs更新・再起動で正常復旧した

  • flash-kernel実行時に次の警告も出た


cannot open /etc/default/flash-kernel
find: ‘/etc/flash-kernel/dtbs’: No such file or directory

特に、Ubuntu Raspberry Pi環境で、カーネル更新後にDKMS利用環境が起動不能またはロールバックする可能性がある点は、Ubuntu側にとって有用な情報です。

ただし、Ubuntuのカーネルパッケージが必ず個別バージョンのヘッダーを自動導入すべき設計かどうかは、パッケージ依存関係やインストール履歴によります。そのため、報告文では「Ubuntuのバグである」と断定せず、再現した事実と復旧手順を提示して調査を依頼する形がよいです。

-ここまで-

以下はChatGPTに作成された投稿内容です。

-ここから-
Environment

  • Ubuntu 26.04 LTS
  • Raspberry Pi 5, arm64
  • Previous kernel: 7.0.0-1011-raspi
  • New kernel: 7.0.0-1014-raspi
  • External DKMS module: hailo_pci 4.23.0
  • Raspberry Pi A/B boot

Observed behavior
An automatic update installed:

  • linux-image-7.0.0-1014-raspi
  • linux-modules-7.0.0-1014-raspi
  • linux-image-raspi 7.0.0-1014.14

However, linux-headers-7.0.0-1014-raspi was not installed.

As a result:

  • no hailo_pci DKMS entry existed for 7.0.0-1014-raspi
  • /lib/modules/7.0.0-1014-raspi/updates/dkms did not exist
  • the new A/B boot environment became bad
  • the system remained on kernel 7.0.0-1011-raspi

Recovery

  1. Installed linux-headers-7.0.0-1014-raspi
  2. DKMS built hailo_pci for 7.0.0-1014-raspi
  3. Ran:
    sudo update-initramfs -u -k 7.0.0-1014-raspi
  4. Verified hailo_pci.ko.zst and hailo8_fw.bin in initramfs
  5. Rebooted
  6. Kernel 7.0.0-1014-raspi booted successfully
  7. /boot/firmware/current/state became good

Expected behavior
The matching Raspberry Pi kernel headers should be installed, or the system should avoid promoting an incomplete A/B boot environment when required DKMS modules cannot be built.

-ここまで-

Your recovery steps are correct: install the missing headers, rebuild the DKMS module, update initramfs, and reboot.

For the root cause: did you have linux-headers-raspi installed before the update? If yes, the meta-package should have pulled the matching headers automatically, and this is a dependency bug worth reporting. If not, installing it beforehand would prevent this in the future.

Also, the flash-kernel warnings (/etc/default/flash-kernel missing, /etc/flash-kernel/dtbs not found) are harmless on RPi 5 but worth noting.

1 Like

以下はChatGptに作成させた回答です。ありがとうございました。

―ここから―

Thank you for your guidance.

I completed a more detailed investigation of the APT, dpkg, installer,
and unattended-upgrade logs.

I can now confirm that the linux-headers-raspi meta-package was not
installed before the unattended kernel update.

The dpkg log shows that it was installed for the first time on
2026-07-04 at 10:36:

2026-07-04 10:36:28 install linux-headers-raspi:arm64 7.0.0-1014.14

The APT log also records:

Commandline: apt install linux-headers-raspi
Install: linux-headers-raspi:arm64 (7.0.0-1014.14)

The installer logs contain no earlier record of linux-headers-raspi.

Before this, I had installed only the version-specific package:

linux-headers-7.0.0-1011-raspi

The unattended upgrade on 2026-07-03 installed:

  • linux-image-7.0.0-1014-raspi
  • linux-modules-7.0.0-1014-raspi
  • linux-main-modules-zfs-7.0.0-1014-raspi

and upgraded:

  • linux-image-raspi from 7.0.0-1011.11 to 7.0.0-1014.14

Because linux-headers-raspi was not installed, the matching
linux-headers-7.0.0-1014-raspi package was not pulled in, and the
hailo_pci DKMS module was not built for the new kernel.

After manually installing the version-specific headers, DKMS built the
Hailo PCIe module successfully. I then rebuilt the initramfs, verified
that both hailo_pci.ko.zst and hailo8_fw.bin were included, and rebooted.

The system successfully booted kernel 7.0.0-1014-raspi, the A/B current
state became good, and the Hailo-8 inference application operated
normally.

I have now also installed the linux-headers-raspi meta-package:

linux-headers-raspi 7.0.0-1014.14 ii

This should ensure that matching Raspberry Pi kernel headers are pulled
in automatically during future kernel updates.

I also confirmed that the flash-kernel warnings about
/etc/default/flash-kernel and /etc/flash-kernel/dtbs did not prevent
the kernel, initramfs, DTBs, and boot firmware from being copied
successfully to /boot/firmware/new/.

Therefore, this incident does not appear to be a dependency bug in the
linux-headers-raspi meta-package. It was caused by that meta-package not
being installed before the kernel update.

Thank you again for helping clarify the root cause.

―ここまで―

1 Like

Great investigation — that’s exactly the root cause I was suspecting. Thanks for confirming with logs. Installing the meta-package now should prevent this from happening again. And nice work on the manual recovery. This is a solid write-up for anyone else running RPi 5 with DKMS modules.

And by the way — welcome to the Ubuntu Discourse community! :tada: Hope you find it helpful here.

1 Like