Skip to content

enh(linux-runner): use kernel meta packages - #1813

Merged
Emilgardis merged 1 commit into
cross-rs:mainfrom
MichaIng:linux-runner-kernel-arch
Oct 30, 2026
Merged

Emilgardis merged 1 commit into
cross-rs:mainfrom
MichaIng:linux-runner-kernel-arch

Conversation

@MichaIng

@MichaIng MichaIng commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Main changes

  • Debian kernel packages are released very frequently, especially since LLMs are able to find and exploint vulnerabilities quickly.
  • Debian generally removes old package versions immediately from their repositories.
  • Using a fixed kernel version is hence not applicable for Docker image builds, as this would need to be updated way too regularly.
  • Also using fixed major Linux versions does not have any advantages: It pulls the latest if it matches still the major, else will fail.
  • Debian provides unversioned meta package names, which pull in the only available kernel version, which is the only practicable approach.
  • This meta package differs in its architecture suffix only, which often matches the input architecture, sometimes the DEB package arch.
  • The kernel (version) variable is hence replaced with a kernel arch variable, which holds only that architecture suffix. It is initially assigned the input arch, and adjusted as needed per arch, just like the DEB arch.
  • From the meta package dependencies, the actual content packages are worked out via their recursive dependencies. Until Debian Trixie, there is only a single linux-image-*-<arch> package which contains everything, but from Forky on this package itself is a meta package only, which pulls in versioned linux-binary-*, linux-modules-*, and linux-base-* packages, the latter of which contains mostly device trees.
  • The wildcard matching and Forky package split blocks are thereby obsolete and hence removed.

Additional enhancements

  • For architecutures using the bookworm suite, only the suite is replaced in the original list entries, so that the bookworm-security suite is now used, with obvious security benefits.
  • The 2nd list entry is appended to the string using bash += syntax, to enhance readability a litte.
  • The -d (--download-only) and --no-install-recommends flags have been removed from apt-get download calls, where they have no effect: That commands downloads only the listed packages into the current dir, no dependencies or any such.

Further fixes detected while testing

  • Since Debian Forky, the kernel images are stored below /usr/lib/modules. A postinst hook copies them to /boot, which however does not run as we only extract the packages. It is now copied from that path, if it exists.
  • The duplicate libgcc package (re)install has been removed: It used the wrong array for the wildcard matched kernel packages, hence was a noop. The libgcc packages are reinstalled via dpkg some lines earlier.
  • The NetBSD version has been bumped to 9.5, since all older 9.x subversions have been moved to the NetBSD-archive. The libc version changed, which affected its filename. The cp and ls commands have been updated accordingly.

@MichaIng
MichaIng requested a review from a team as a code owner October 23, 2026 15:25
@MichaIng
MichaIng force-pushed the linux-runner-kernel-arch branch 2 times, most recently from b8fda1c to 67f6ce3 Compare October 23, 2026 15:44
Comment thread docker/linux-image.sh Resolved
@MichaIng
MichaIng marked this pull request as draft October 23, 2026 16:07
@MichaIng
MichaIng force-pushed the linux-runner-kernel-arch branch 4 times, most recently from 5c2e726 to e804fca Compare October 23, 2026 19:17
@MichaIng

Copy link
Copy Markdown
Contributor Author

Expected CI failures

@MichaIng
MichaIng marked this pull request as ready for review October 23, 2026 19:25
@Emilgardis

Copy link
Copy Markdown
Member

/ci try

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@MichaIng
MichaIng force-pushed the linux-runner-kernel-arch branch from e804fca to 5ba094b Compare October 25, 2026 12:49
@Emilgardis

Copy link
Copy Markdown
Member

/ci try

@github-actions

This comment has been minimized.

@MichaIng

MichaIng commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

I just fixed powerpc64le and riscv64 builds, which I accidentally broke with a fix for Forky images, and not retested the already succeeded builds. Those two architectures use /boot/vmlinux-* kernel image names, instead of /boot/vmlinuz-*. I verified that from Forky on, they use /usr/lib/modules/*/vmlinuz with z at the end like every other architecture, so that [xz] is needed for the classic layout up to Trixie only.

The thumbv[678]m targets did succeed on my fork on 2026-10-22, but failed here with some compiler error on 2025-10-23. I see that a nightly (literally) rustc version is used, so I reran one of those tests on my fork, and it fails now with the very same error. So something changed between the Rust compiler nightlies, or there was another change in variable tools. But unrelated to this PR.

EDIT: Remember to not always retrigger the full test matrix, but rerun only the failed tests, or individual ones. They always pull the latest commit.

@Emilgardis

Copy link
Copy Markdown
Member

but rerun only the failed tests, or individual ones. They always pull the latest commit.

Thank you, i keep forgetting :)

I agree this is a upstream issue with the thumbv target

@github-actions

This comment has been minimized.

@MichaIng

MichaIng commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Oh, I missed that NetBSD is still failing, just at a later stage. Overlooked it next to the expected FreeBSD failures.

Let me have a look at that. I guess just some library version changed from v9.3 => v9.5, hence filename needs adjustment.

EDIT: Indeed, it got a .1 suffix. Adjusted the cp and ln commands accordingly.

EDIT2: Yep that fixed it, goes through on my fork now: https://github.com/MichaIng/cross/actions/runs/39981598617/job/121188392849

* Debian kernel packages are released very frequently, especially since LLMs are able to find and exploint vulnerabilities quickly.
* Debian generally removes old package versions immediately from their repositories.
* Using a fixed kernel version is hence not applicable for Docker image builds, as this would need to be updated way too regularly.
* Also using fixed major Linux versions does not have any advantages: It pulls the latest if it matches still the major, else will fail.
* Debian provides unversioned meta package names, which pull in the only available kernel version, which is the only practicable approach.
* This meta package differs in its architecture suffix only, which often matches the input architecture, sometimes the DEB package arch.
* The kernel (version) variable is hence replaced with a kernel arch variable, which holds only that architecture suffix. It is initially assigned the input arch, and adjusted as needed per arch, just like the DEB arch.
* From the meta package dependencies, the actual content packages are worked out via their recursive dependencies. Until Debian Trixie, there is only a single `linux-image-*-<arch>` package which contains everything, but from Forky on this package itself is a meta package only, which pulls in versioned `linux-binary-*`, `linux-modules-*`, and `linux-base-*` packages, the latter of which contains mostly device trees.
* The wildcard matching and Forky package split blocks are thereby obsolete and hence removed.

Additional enhancements:
* For architecutures using the bookworm suite, only the suite is replaced in the original list entries, so that the bookworm-security suite remians in place.
* The 2nd list entry is appended to the string useing bash `+=` syntax, to enhance readability a litte.
* The `-d` (`--download-only`) and `--no-install-recommends` flags have been removed from `apt-get download` calls, where they have no effect: That commands downloads only the listed packages into the current dir, no dependencies or any such.

Further fixes detected while testing:
* Since Debian Forky, the kernel images are stored below /usr/local/modules. A postinst hook copies them to /boot, which however does not run as we only extract the packages. It is now copied from that path, if it exists.
* The duplicate libgcc package (re)install has been removed: It used the wrong array for the wildcard matched kernel packages, hence was a noop. The libgcc packages are reinstalled via dpkg some lines above.
* The NetBSD version has been bumped to 9.5, since all older v9 subversions have been moved to the `NetBSD-archive`.

Signed-off-by: MichaIng <micha@dietpi.com>
@MichaIng
MichaIng force-pushed the linux-runner-kernel-arch branch from 5ba094b to 6115fe1 Compare October 25, 2026 13:54
@Emilgardis

Copy link
Copy Markdown
Member

@github-actions

Copy link
Copy Markdown

Try run for comment

Failed Jobs

Successful Jobs

List

@Emilgardis Emilgardis added the no-ci-targets PRs that do not affect or should skip any cross-compilation targets. label Oct 30, 2026

@Emilgardis Emilgardis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you very much!

@Emilgardis
Emilgardis added this pull request to the merge queue Oct 30, 2026
Merged via the queue into cross-rs:main with commit d5a5ead Oct 30, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-ci-targets PRs that do not affect or should skip any cross-compilation targets.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants