Skip to content

e2fsprogs: defer libblkid/libuuid to util-linux (drop bundled forks) - #366

Merged
bryan-minimal merged 5 commits into
mainfrom
e2fsprogs-drop-bundled-libblkid-libuuid
Jul 8, 2026
Merged

e2fsprogs: defer libblkid/libuuid to util-linux (drop bundled forks)#366
bryan-minimal merged 5 commits into
mainfrom
e2fsprogs-drop-bundled-libblkid-libuuid

Conversation

@norrietaylor

@norrietaylor norrietaylor commented Jul 8, 2026

Copy link
Copy Markdown
Member

Follow-up to #365 (per Bryan's suggestion to do it now). Stacked on #365 — base this on main once #365 merges.

Why

e2fsprogs bundles its own older forks of libblkid and libuuid with the same soname (libblkid.so.1, libuuid.so.1) as util-linux's maintained, symbol-versioned libraries. Any image shipping both — like microvm-rootfs after #365 — has the dynamic loader resolve util-linux's libmount against e2fsprogs's unversioned libblkid, warning libblkid.so.1: no version information available on every fstrim/mount/blkid.

#365 worked around this in the image by repointing symlinks in microvm-rootfs/build.sh. This fixes it at the source: e2fsprogs stops building its forks and links util-linux's libs instead — the standard distro configuration (Debian/Fedora/Arch all build e2fsprogs --disable-libblkid --disable-libuuid).

What

  • e2fsprogs/build.sh: configure --disable-libblkid --disable-libuuid --disable-uuidd; set PKG_CONFIG_PATH so configure locates util-linux's libs.
  • e2fsprogs/build.ncl: add pkgconf + full util-linux to build deps (configure needs util-linux's headers and .pc files — OutputData outputs, which subsetOf can't express — and build deps don't propagate to consumers' runtime closures). Add subsetOf util-linux ["libblkid", "libuuid"] to runtime deps — only those .sos load at runtime. Drop the libblkid/libuuid/uuidgen outputs — no longer built.
  • microvm-rootfs/build.sh: remove the now-redundant libblkid/libuuid symlink-canonicalization block introduced in microvm-rootfs: ship e2fsprogs + util-linux and /var/lib/minimal mountpoint #365.

e2fsprogs now builds no libblkid/libuuid/blkid/findfs/uuidgen; util-linux is the sole provider.

Cycle-safe: microvm-rootfs is the only package in the repo that imports e2fsprogs (grep-confirmed), so nothing in util-linux's closure can reach it. Blast radius is exactly these two packages.

Verification

minimal package e2fsprogs + minimal patched-build microvm-rootfs, then loopback-mounted the guest image:

e2fsprogs artifact:

  • Ships none of libblkid*/libuuid*/blkid/findfs/uuidgen; keeps its own libext2fs/libe2p/libss/libcom_err.
  • readelf -d mke2fsNEEDED libblkid.so.1, NEEDED libuuid.so.1 (resolved to util-linux's at runtime).
  • min check --packages e2fsprogs all Pass — including missing runtime_deps, which confirms every DT_NEEDED lib is satisfied by the declared closure.

Guest image:

  • Exactly one libblkid.so.1 → libblkid.so.1.1.0 and one libuuid.so.1 → libuuid.so.1.3.0 (util-linux); e2fsprogs forks gone.
  • blkid --versionblkid from util-linux 2.42.1 (modern binary, not e2fsprogs's 2003-era one).
  • fstrim --help → exit 0, zero stderr.
  • Real mkfs.ext4 -qF on a scratch image → exit 0, zero stderr, produces valid ext4 (TYPE="ext4"), fsck.ext4 -fn reports it clean.
  • /var/lib/minimal empty; ip + nsenter intact; TYPE="ext4".

Downstream

Same handoff as #365 — after this and #365 merge and the artifact publishes, gominimal/minimal re-pins microvm-rootfs in .minimal/minimal.toml [outputs.minvmd-rootfs]. No separate re-pin needed for e2fsprogs (it has no other consumer).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved compatibility for file-system tools by using the system-provided versions of shared libraries.
    • Reduced the risk of library loading conflicts during package use and system startup.
    • Adjusted the root filesystem packaging to keep existing library links intact.

norrietaylor and others added 4 commits July 7, 2026 18:30
…tpoint

Unblocks Unit 1 of the per-VM writable ext4 volume spec (gominimal/minimal
#583, PR #658 R1.7). The guest minimald mounts a per-VM writable volume
(/dev/vdb) at /var/lib/minimal, formats it with mkfs.ext4 on first boot, and
reclaims space via discard/fstrim. The rootfs was missing all three pieces:

- Promote e2fsprogs from a build-only dep (its files were stripped from the
  image) to the runtime closure, so mkfs.ext4/mke2fs ship in the guest. mke2fs
  stays on the build PATH via the injected runtime closure, so it still packs
  the image — the separate build_deps entry is now redundant and removed.
- Add util-linux to the runtime closure for fstrim (space reclaim).
- Stage /var/lib/minimal as an empty directory. The root is mounted read-only,
  so minimald cannot mkdir the mountpoint at runtime; it must ship in the image
  or the mount fails with ENOENT/EROFS.

Image stays raw ext4 (rootfs.img); size grows ~26 MiB (from ~444 MB to
~472 MB). Verified in the built image: /var/lib/minimal is empty, mkfs.ext4 -V
and fstrim --help resolve, filesystem TYPE=ext4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ed libs

e2fsprogs and util-linux both ship a libblkid.so.1 and libuuid.so.1 with the
same soname; the staging composition resolved them to e2fsprogs's older,
unversioned forks. util-linux's libmount then loaded those and warned
"libblkid.so.1: no version information available" on every fstrim/mount/blkid.

Repoint both sonames at util-linux's versioned libs (an ABI superset —
e2fsprogs's own mke2fs/e2fsck link them fine, verified by running a real
mkfs.ext4 format) and drop the e2fsprogs forks. A guard fails the build if a
package bump renames the util-linux targets so this can't silently regress.

Verified in the rebuilt image: fstrim --help and mount -V emit zero stderr
lines, mkfs.ext4 -V still resolves. Net image size drops ~175 KB.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…le-volume-support

# Conflicts:
#	packages/microvm-rootfs/build.ncl
#	packages/microvm-rootfs/build.sh
e2fsprogs bundles its own older forks of libblkid and libuuid with the same
soname (libblkid.so.1, libuuid.so.1) as util-linux's maintained, symbol-
versioned libraries. Any image that ships both — like microvm-rootfs — has the
dynamic loader resolve util-linux's libmount against the wrong libblkid, warning
"libblkid.so.1: no version information available" on every fstrim/mount/blkid.

Configure e2fsprogs with --disable-libblkid --disable-libuuid --disable-uuidd
(the standard distro config) so its tools link util-linux's libs — an ABI
superset, verified by building and running a real mkfs.ext4 format + fsck.ext4
against them. e2fsprogs now builds no libblkid/libuuid/blkid/findfs/uuidgen;
util-linux is the sole provider. pkgconf is added to build_deps because
configure locates the system libs via pkg-config, and util-linux to build+
runtime deps. Cycle-safe: microvm-rootfs is the only importer of e2fsprogs, so
nothing in util-linux's closure can reach it.

This makes the microvm-rootfs libblkid/libuuid symlink-repointing hack from the
previous commit redundant, so it's removed — the guest now gets a single,
correct libblkid/libuuid and util-linux's modern blkid binary with no build.sh
fixups.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: e2fsprogs now uses util-linux for libblkid/libuuid instead of bundled forks.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch e2fsprogs-drop-bundled-libblkid-libuuid

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/e2fsprogs/build.ncl`:
- Around line 24-34: The `runtime_deps` in `e2fsprogs` are pulling in the full
`util-linux` package even though only `libblkid`, `libuuid`, and `pkgconfig` are
needed. Update the dependency to use `subsetOf` on `util-linux` inside
`build.ncl` so `e2fsprogs` references only the required outputs, and keep the
existing `runtime_deps` list focused on just those subsets rather than the whole
package.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6f3521d0-3af5-47ed-bab6-465423f4a63b

📥 Commits

Reviewing files that changed from the base of the PR and between d7077bc and 96e8d59.

📒 Files selected for processing (3)
  • packages/e2fsprogs/build.ncl
  • packages/e2fsprogs/build.sh
  • packages/microvm-rootfs/build.sh
💤 Files with no reviewable changes (1)
  • packages/microvm-rootfs/build.sh

Comment thread packages/e2fsprogs/build.ncl Outdated
Address CodeRabbit review on #366: e2fsprogs's tools only DT_NEED
libblkid.so.1 and libuuid.so.1 from util-linux at runtime, so pull just those
two outputs via subsetOf instead of the whole ~18 MB toolset — consumers of
e2fsprogs no longer transitively inherit all of util-linux.

build_deps keeps the full util-linux: configure detects the libs via pkg-config
and needs the headers + .pc files (OutputData outputs, which subsetOf does not
support), and build_deps do not propagate to consumers' runtime closures.

Verified: min check missing_runtime_deps passes (DT_NEEDED satisfied by the
subset), and the microvm-rootfs guest still has a single util-linux
libblkid/libuuid, modern blkid, and a clean mkfs.ext4 + fsck.ext4.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@bryan-minimal bryan-minimal 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.

LGTM

Base automatically changed from microvm-rootfs-writable-volume-support to main July 8, 2026 04:11
@bryan-minimal
bryan-minimal added this pull request to the merge queue Jul 8, 2026
Merged via the queue into main with commit 12f324d Jul 8, 2026
2 checks passed
@bryan-minimal
bryan-minimal deleted the e2fsprogs-drop-bundled-libblkid-libuuid branch July 8, 2026 04:14
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.

2 participants