Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions lib/functions/compilation/kernel-debs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,24 @@ function kernel_package_callback_linux_headers() {
rm -f include/generated/.armbian-build.tar.gz
fi
EOT_POSTINST_FINISH

# Now that the header tree is compiled, run the same header hooks Debian runs
# from its linux-headers postinst. dkms ships /etc/kernel/header_postinst.d/dkms,
# which (re)builds DKMS modules for this kernel version. This is the safety net
# that makes the linux-image / linux-headers configure ORDER irrelevant: if the
# image is configured first (e.g. in a single apt transaction), its DKMS
# autoinstall runs with no headers present and fails; building here, when the
# headers land, completes the module on the first pass. Without this hook Armbian
# only ever built DKMS from the linux-image postinst, so a transaction that
# configured the image before its headers left the module unbuilt -- and,
# pre-#10766, could abort the image postinst before the boot-symlink relink and
# leave the board unbootable. Non-fatal: a broken out-of-tree module must not
# stop the headers package from installing.
cat <<- EOT_POSTINST_HEADER_HOOKS
if [ -d /etc/kernel/header_postinst.d ]; then
DEB_MAINT_PARAMS="\$*" run-parts --arg="${kernel_version_family}" /etc/kernel/header_postinst.d || true
fi
EOT_POSTINST_HEADER_HOOKS
)
}

Expand Down
Loading