Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

kernel: add opt-in linux-image-dbg package with debug info - #192

#192
Open
iav wants to merge 1 commit into
mainiav/armbian:mainfrom
kernel-dbg-packageiav/armbian:kernel-dbg-packageCopy head branch name to clipboard
Open

kernel: add opt-in linux-image-dbg package with debug info#192
iav wants to merge 1 commit into
mainiav/armbian:mainfrom
kernel-dbg-packageiav/armbian:kernel-dbg-packageCopy head branch name to clipboard

Conversation

@iav

@iav iav commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Description

Kernels built with CONFIG_DEBUG_INFO produce a vmlinux with full debug info, but only the stripped Image is packaged — vmlinux is discarded with the build tree, leaving nothing to analyze kdump vmcores with. Debian ships it as linux-image-*-dbg, Ubuntu as -dbgsym ddebs, Fedora as kernel-debuginfo.

This adds KERNEL_DBG_PACKAGE=yes (default no) producing a linux-image-<BRANCH>-<LINUXFAMILY>-dbg package (Debian-style -dbg suffix) with vmlinux at /usr/lib/debug/lib/modules/<version>/vmlinux — the standard search path of crash, drgn and gdb.

Exact build pairing: linux-image declares a versioned virtual Provides: linux-image-<BRANCH>-<LINUXFAMILY>-build (= artifact_version), and the dbg package carries a versioned Depends on it. artifact_version encodes every build input (source SHA1, patches, .config, hooks, toolchain), and deployment reversioning rewrites only the Version: field — so the pairing survives reversioning and dpkg refuses to install debug symbols for a kernel built from any other inputs.

Why a build variable and not an extension: there is currently no hook point to add a package to the kernel artifact — artifact_map_packages is built after the last extension hook runs, and without an entry in that map the deb would not be part of the deb-tar artifact and thus invisible to the ORAS cache. The dbg package's siblings (dtb, headers, libc-dev) are all gated by core variables; this follows the same pattern.

Cache correctness: the variable is hashed into the artifact version only when enabled — dbg-enabled builds get a cache entry distinct from regular builds (a cached tarball without the dbg deb would otherwise poison them).

Cost: vmlinux with DWARF5 is ~0.5–1 GB unpacked (measured deb: ~520 MB for meson64-edge) — hence opt-in.

How Has This Been Tested?

  • ./compile.sh kernel BOARD=odroidn2 BRANCH=edge KERNEL_DBG_PACKAGE=yes — deb produced; vmlinux is with debug_info, not stripped (12 .debug_* sections, BuildID present)
  • Reversioned control verified: Version: 26.08.0-trunk, Depends: linux-image-edge-meson64, linux-image-edge-meson64-build (= 7.1.4-S7a5c-...) — the versioned pairing survives reversioning

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Note

Medium Risk
Touches kernel artifact versioning, deb control Provides/Depends, and packaging of large debug binaries; mistakes could break cache correctness or allow mismatched kernel/dbg installs, but the feature is off by default.

Overview
Introduces an opt-in KERNEL_DBG_PACKAGE=yes path that adds a linux-image-<branch>-<family>-dbg deb containing unstripped vmlinux under /usr/lib/debug/lib/modules/<version>/vmlinux for crash/drgn/gdb.

Packaging and pairing: When enabled, the build also emits the dbg deb from a new packaging callback (requires vmlinux, warns without CONFIG_DEBUG_INFO, fails on CONFIG_DEBUG_INFO_SPLIT). linux-image gains a versioned virtual provide linux-image-*-build (= artifact_version); the dbg package depends on that same version so debug symbols stay tied to one kernel build through reversioning.

Artifacts and cache: The kernel artifact map includes linux-dbg, reducer inputs record dbg vs non-dbg (plus compiler, extra cflags, and make-hook hashes when dbg is on), and artifact_kernel_prepare_version folds those into the version hash so ORAS/cache cannot serve dbg-less tarballs to dbg builds or mix toolchain/hook-distinct pairs.

Config: After family config, KERNEL_DBG_PACKAGE=yes auto-enables the kernel-version-toolchain extension for visible version differentiation.

Reviewed by Cursor Bugbot for commit 3bb38b8. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb29c6257e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/functions/artifacts/artifact-kernel.sh Outdated
@iav
iav force-pushed the kernel-dbg-package branch from cb29c62 to 68f3998 Compare July 19, 2026 23:43
Comment thread lib/functions/configuration/main-config.sh Outdated
@iav
iav force-pushed the kernel-dbg-package branch from 68f3998 to dce11eb Compare July 19, 2026 23:48

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dce11eb7d4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/functions/artifacts/artifact-kernel.sh
Comment thread lib/functions/configuration/main-config.sh
@iav
iav force-pushed the kernel-dbg-package branch from dce11eb to 9f49ec2 Compare July 20, 2026 00:31

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 9f49ec2. Configure here.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f49ec2518

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/functions/compilation/kernel-debs.sh
Comment thread lib/functions/configuration/main-config.sh
Comment thread lib/functions/artifacts/artifact-kernel.sh
Comment thread lib/functions/compilation/kernel-debs.sh
@iav
iav force-pushed the kernel-dbg-package branch 2 times, most recently from 1511121 to 4768089 Compare July 20, 2026 02:32

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4768089ea0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/functions/artifacts/artifact-kernel.sh
Comment thread lib/functions/compilation/kernel-debs.sh
Comment thread lib/functions/artifacts/artifact-kernel.sh
@iav
iav force-pushed the kernel-dbg-package branch from 4768089 to d0025a4 Compare July 20, 2026 03:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d0025a478d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/functions/compilation/kernel-debs.sh

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c1e0d19fbf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/functions/compilation/kernel-debs.sh
Comment thread lib/functions/artifacts/artifact-kernel.sh
@iav
iav force-pushed the kernel-dbg-package branch from c1e0d19 to ec96553 Compare July 24, 2026 16:32
Repository owner deleted a comment from cursor Bot Jul 24, 2026
Repository owner deleted a comment from cursor Bot Jul 24, 2026
@iav
iav force-pushed the kernel-dbg-package branch from ec96553 to 2afb8da Compare July 24, 2026 17:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2afb8da4c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/functions/artifacts/artifact-kernel.sh
@iav
iav force-pushed the kernel-dbg-package branch from 2afb8da to f3541b9 Compare July 24, 2026 18:04
Repository owner deleted a comment from cursor Bot Jul 24, 2026
Repository owner deleted a comment from chatgpt-codex-connector Bot Jul 24, 2026
Repository owner deleted a comment from cursor Bot Jul 24, 2026
@iav
iav force-pushed the kernel-dbg-package branch from f3541b9 to 0340785 Compare July 24, 2026 18:13
Repository owner deleted a comment from cursor Bot Jul 24, 2026
Kernels built with CONFIG_DEBUG_INFO produce a vmlinux with full debug
info, but only the stripped Image is packaged; vmlinux is discarded with
the build tree, leaving nothing to analyze kdump vmcores with. Debian
ships it as linux-image-*-dbg, Ubuntu as -dbgsym ddebs, Fedora as
kernel-debuginfo.

Add KERNEL_DBG_PACKAGE=yes (default no) producing a
linux-image-BRANCH-FAMILY-dbg deb (Debian-style -dbg suffix) with
vmlinux at /usr/lib/debug/lib/modules/<version>/vmlinux — the standard
search path of crash, drgn and gdb.

The debug package is pinned to its exact kernel build via a versioned
virtual package: linux-image provides
linux-image-BRANCH-FAMILY-build (= artifact_version), and the dbg
package depends on it. artifact_version encodes every build input
(source SHA1, patches, .config, hooks, toolchain), and reversioning
rewrites only the Version: field, so the pairing survives deployment
reversioning and dpkg refuses to install debug symbols for a kernel
built from any other inputs.

The variable is hashed into the artifact version only when enabled, so
dbg-enabled builds get a cache entry distinct from regular builds (a
cached tarball without the dbg deb would otherwise poison them).

Compiler identity and version are made part of the artifact version by
force-enabling the kernel-version-toolchain extension for dbg builds, and
KERNEL_EXTRA_CFLAGS is hashed in as well — compiler-distinct builds must
not share a version, or debug symbols from one could pair with an image
from another.

Disabled by default: vmlinux with DWARF5 is ~0.5-1 GB unpacked
(~150-300 MB deb).

Assisted-by: Claude:claude-fable-5
@iav
iav force-pushed the kernel-dbg-package branch from 0340785 to 3bb38b8 Compare July 25, 2026 19:24
Repository owner deleted a comment from cursor Bot Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.