Skip to content

[14.5-stable] Fixes newc initrd filename null termination - #6881

Merged
eriknordmark merged 1 commit into
lf-edge:14.5-stablefrom
milan-zededa:14.5-backport-5412-grub-newc-nul
Oct 28, 2026
Merged

eriknordmark merged 1 commit into
lf-edge:14.5-stablefrom
milan-zededa:14.5-backport-5412-grub-newc-nul

Conversation

@milan-zededa

Copy link
Copy Markdown
Contributor

Description

Backport of #5412 to 14.5-stable.

Clean cherry-pick with -x from 76a86d0eee, no conflicts. Only the two GRUB patches of the PR are backported (pkg/grub/patches/0015-... for amd64 and pkg/grub/patches-2.06/0014-... for arm64 and riscv64). They make the newc pathname in the initrd cpio header NUL-terminated, as the format requires.

This is needed, otherwise installation over iPXE (netboot) is broken. The installer ISO is loaded by GRUB as newc:/installer.iso:.... Kernels since 6.1.120 (the 14.5-stable generic amd64 kernel is 6.1.177) refuse to unpack such an entry:

initramfs name without nulterm: installer.iso
rootfs image is not initramfs (malformed archive); looks like an initrd
...
/installer.iso: Can't open blockdev
/rootfs_installer.img image not found!

The installer never starts. Kernels without the check are not affected by the fix: it only makes the header conform to the cpio format.

Without this fix the evetest test TestBootstrapWithNetworkBoot fails.

PR dependencies

None.

How to test and validate this PR

Covered by the evetest test TestBootstrapWithNetworkBoot (added to 14.5-stable by #6873):

EVETEST_EVE_VERSION=<14.5-stable build with this PR> make evetest NAME=TestBootstrapWithNetworkBoot

Changelog notes

Fixed installation over iPXE: the installer ISO is now loaded with a NUL-terminated name in the initrd, which kernels 6.1.120 and later require.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

For backport PRs (remove it if it's not a backport):

  • I've added a reference link to the original PR
  • PR's title follows the template

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

@eriknordmark

Copy link
Copy Markdown
Contributor

Go Tests fails here because the bpftrace-compiler tests run past their 1h timeout on the self-hosted runners. #6936 raised the timeout to 5h on 14.5-stable. Re-running doesn't help, because the job tests the PR head. Please rebase onto the current 14.5-stable.

The newc CPIO format requires filenames to be null-terminated.
Calculates namesize to include the null terminator, preventing
"initramfs name without nulterm" errors with newer kernels.

Signed-off-by: Othonas Soultatos <othonas.s@gmail.com>
(cherry picked from commit 76a86d0)
Signed-off-by: Milan Lenco <milan@zededa.com>
@milan-zededa
milan-zededa force-pushed the 14.5-backport-5412-grub-newc-nul branch from ff0b433 to 75ebe9c Compare October 28, 2026 07:45
@milan-zededa

Copy link
Copy Markdown
Contributor Author

Go Tests fails here because the bpftrace-compiler tests run past their 1h timeout on the self-hosted runners. #6936 raised the timeout to 5h on 14.5-stable. Re-running doesn't help, because the job tests the PR head. Please rebase onto the current 14.5-stable.

Done

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 25.60%. Comparing base (272ffae) to head (75ebe9c).
⚠️ Report is 286 commits behind head on 14.5-stable.

Additional details and impacted files
@@               Coverage Diff               @@
##           14.5-stable    #6881      +/-   ##
===============================================
+ Coverage        24.97%   25.60%   +0.62%     
===============================================
  Files                8       14       +6     
  Lines             1185     2882    +1697     
===============================================
+ Hits               296      738     +442     
- Misses             820     1992    +1172     
- Partials            69      152      +83     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eriknordmark eriknordmark left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@github-actions

Copy link
Copy Markdown
Contributor

Based on the diff, this PR only patches GRUB's newc initrd header generation (pkg/grub/patches/0015-... and pkg/grub/patches-2.06/0014-...), which is used solely by pkg/eve/installer/grub_installer.cfg when isnetboot=true (loading the installer ISO over network boot). That exact path is exercised by TestBootstrapWithNetworkBoot, which is explicitly named in the PR description as the regression test for this fix and is kept running.

Skipping the following for this PR run (the nightly job re-runs the full suite regardless, so this only trims this PR's own CI):

Unrelated to GRUB/initrd/boot behavior:

  • TestApplicationConnectivitySuite
  • TestAppsSuite
  • TestControllerFaultsSuite
  • TestDatastoreSuite
  • TestDeviceConnectivitySuite
  • TestDiagSuite
  • TestHardwareSuite
  • TestLPSSuite
  • TestPcibackErrorSuite
  • TestPortScanSuite
  • TestSecuritySuite
  • TestStorageSuite
  • TestTelemetrySuite
  • TestUpgradeSuite (EVE version upgrades don't go through the netboot installer's newc initrd path)

Redundant with TestBootstrapWithNetworkBoot (these bootstrap variants onboard normally or via the non-netboot ISO installer path, never setting isnetboot=true, so they never touch the changed code):

  • TestBootstrapWithLastResort (incl. its TestBootstrapWithInstaller variant)
  • TestBootstrapWithStaticIP
  • TestBootstrapWithProxy
  • TestBootstrapWithMgmtVLAN

An engineer can comment /evetest all to force the full suite to run instead, or /evetest <name> <name> ... to run only specific tests/suites.

@eriknordmark
eriknordmark merged commit d83a1e0 into lf-edge:14.5-stable Oct 28, 2026
59 of 63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants