Skip to content

build: ship fixparts, which runFixparts() calls - #195

Merged
mastacontrola merged 1 commit into
masterfrom
fix/fixparts-binary
Oct 21, 2026
Merged

mastacontrola merged 1 commit into
masterfrom
fix/fixparts-binary

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Fixes #194.

Problem. Every init since 2023-12 lacks fixparts. runFixparts() calls it when sfdisk refuses a table, so the task stops at Could not fix partition layout (runFixparts).

Cause. Buildroot's gptfdisk package has no fixparts option. FOS carried its own copy of the package with one; 89c901f deleted that copy during a Buildroot update, and Kconfig dropped BR2_PACKAGE_GPTFDISK_FIXPARTS silently. The released init EXP_20261019-150930 has gdisk and sgdisk in /usr/sbin, and no fixparts.

Fix. fs.patch adds the fixparts option and build target to Buildroot's own gptfdisk package. All three fs configs set it. A Buildroot bump that moves those lines makes the patch fail at build time, not silently.

Verified.

  • fs.patch applies cleanly to pristine Buildroot 2026.02.1.
  • In the x64 tree, the symbol survives olddefconfig, and make gptfdisk installs /usr/sbin/fixparts.
  • That binary, given EOFFIXPARTS, cleared stale GPT data from an MBR disk image and kept the MBR partition. sgdisk -v then reported no problems.
  • New tests/checks/fixparts-binary-present.sh: red against master (5 failures), green here. Full suite 29 passed, 0 failed.

🤖 Generated with Claude Code

runFixparts() repairs a partition table that sfdisk refuses:

    fixparts $disk </usr/share/fog/lib/EOFFIXPARTS >/dev/null 2>&1

No init since 2023-12 has contained fixparts. Buildroot's gptfdisk
package builds gdisk, sgdisk and cgdisk only. FOS carried its own copy
of the package with a fixparts option, and 89c901f deleted that copy
during a Buildroot update. Kconfig then dropped the symbol silently. The
call fails with "command not found", and the task stops at "Could not
fix partition layout (runFixparts)". Verified against the released init
EXP_20261019-150930: /usr/sbin has gdisk and sgdisk, no fixparts.

fs.patch now adds BR2_PACKAGE_GPTFDISK_FIXPARTS to Buildroot's own
gptfdisk package, rather than restoring a full copy of the package that
drifts from upstream. A later Buildroot bump that moves those lines
makes the patch fail loudly at build time. All three fs configs set it.

Verified: fs.patch applies cleanly to pristine Buildroot 2026.02.1. In
the x64 tree the symbol survives olddefconfig, and make gptfdisk
installs output/target/usr/sbin/fixparts. That binary, fed
EOFFIXPARTS, cleared stale GPT data from an MBR disk image and kept the
MBR partition; sgdisk -v reported no problems afterward.

tests/checks/fixparts-binary-present.sh asserts the patch defines the
symbol and the build target, and every config sets it. Proved red
against master: 5 failures. Full suite 29 passed, 0 failed.

Fixes #194

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mastacontrola
mastacontrola merged commit 01e8743 into master Oct 21, 2026
1 check passed
@mastacontrola
mastacontrola deleted the fix/fixparts-binary branch October 21, 2026 15:26
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.

FOS init.xz missing fixparts binary while runFixparts() still depends on it

1 participant