Skip to content

feat(e2fsprogs): add e2fsprogs package#205

Open
norrietaylor wants to merge 4 commits into
mainfrom
pkg/add-e2fsprogs
Open

feat(e2fsprogs): add e2fsprogs package#205
norrietaylor wants to merge 4 commits into
mainfrom
pkg/add-e2fsprogs

Conversation

@norrietaylor
Copy link
Copy Markdown
Member

@norrietaylor norrietaylor commented May 29, 2026

Adds the e2fsprogs package, providing mke2fs (and the ext2/3/4 family). Needed to build ext4 root-partition images (mke2fs -d <tree>) for the upcoming minimal-vm-image assembly package.

Source: e2fsprogs 1.47.4 from the canonical tytso kernel.org mirror, sha256 fd5bf388cbdbe006a3d3b318d983b2948382440acc85a87f1e7d108653e8db0b (downloaded + hashed locally).

Build: autotools, modeled on util-linux. ./configure --bindir=/usr/bin --sbindir=/usr/sbin --libdir=/usr/lib --enable-elf-shlibs --disable-defrag, make, make DESTDIR=$OUTPUT_DIR install. Builds its own libuuid/libblkid (no util-linux dep). Deps: base-bootstrap, make, toolchain (build) + glibc (runtime).

Outputs: usr/{bin,sbin}/* bins + e2fsprogs shared libs.

Validation: builds from source in the Linux sandbox — minimal package e2fsprogs completes successfully and minimal check --packages e2fsprogs passes all 14 checkers; the minimal build CI check (external Linux build) is green. (Source download+sha and ./configure layout were also verified on a macOS dev host.)

Summary by CodeRabbit

  • Chores
    • Added e2fsprogs package version 1.47.4 with filesystem utilities, shared libraries, development headers, and pkg-config support for system integration.

Review Change Stack

Adds an e2fsprogs package (v1.47.4) providing mke2fs / mkfs.ext4 so the
registry can build ext4 images with mke2fs -d. Follows the util-linux
autotools template (base-bootstrap + make + toolchain build deps, glibc
runtime dep, manual tarball extraction, make DESTDIR=$OUTPUT_DIR install).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

📝 Walkthrough

Walkthrough

This PR adds a new e2fsprogs v1.47.4 package to the build system. It includes a build specification that declares the source tarball, shared module dependencies, and output artifact mapping, plus a shell script that implements extraction, configuration, compilation, and installation.

Changes

e2fsprogs Package

Layer / File(s) Summary
Build specification contract and wiring
packages/e2fsprogs/build.ncl
Build.ncl defines the BuildSpec: imports shared build modules and runtime dependencies (glibc, bash), declares the fetched source tarball with pinned sha256, configures the build command to call build.sh with version injection, maps install paths to output artifacts (binaries, shared libraries, headers, pkg-config files), and records package metadata including upstream version.
Build implementation
packages/e2fsprogs/build.sh
Build.sh extracts the e2fsprogs source tarball, sets architecture-specific compiler flags (CFLAGS, CXXFLAGS, LDFLAGS), runs configure with fixed options for directory layout and feature selection, compiles with parallel make, and installs to DESTDIR for packaging.

🎯 2 (Simple) | ⏱️ ~10 minutes

🐰 A spec and script join the fold,

E2fsprogs packaged, tested, bold!
Filesystems tamed with configure's dance,
Build flags set with careful stance.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: adding the e2fsprogs package to the repository.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 pkg/add-e2fsprogs

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/e2fsprogs/build.sh (1)

23-24: ⚡ Quick win

Quote command substitution and variable to prevent word splitting.

While unlikely to cause issues in practice, shellcheck correctly flags that $(nproc) and $OUTPUT_DIR should be quoted to prevent word splitting and globbing.

🔧 Proposed fix
-make -j$(nproc)
-make DESTDIR=$OUTPUT_DIR install
+make -j"$(nproc)"
+make DESTDIR="$OUTPUT_DIR" install
🤖 Prompt for 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.

In `@packages/e2fsprogs/build.sh` around lines 23 - 24, In build.sh fix the two
make invocations to quote the command substitution and variable: change the
parallel build call that uses make -j$(nproc) to use make -j"$(nproc)" and
change the install call that uses make DESTDIR=$OUTPUT_DIR install to use make
DESTDIR="$OUTPUT_DIR" install so command substitution and the OUTPUT_DIR
variable are protected from word splitting and globbing.
🤖 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 47-51: Update the source_provenance block so it reflects the
canonical kernel.org upstream instead of GitHub: edit the source_provenance
entry (the category field and the owner/repo details currently under
source_provenance) to point to the kernel.org e2fsprogs repository (use the
kernel.org git URL or the appropriate category used for kernel.org/git repos in
this repo’s NCL schema) or, if GitHub is actually intended, change the fetch
mechanism to use GitHub consistently; specifically modify the
source_provenance::category and the accompanying identifier fields currently set
to 'GithubRepo'/owner="tytso"/repo="e2fsprogs" to match the kernel.org upstream
(git://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git) or swap the fetch target to
GitHub to preserve consistency.

---

Nitpick comments:
In `@packages/e2fsprogs/build.sh`:
- Around line 23-24: In build.sh fix the two make invocations to quote the
command substitution and variable: change the parallel build call that uses make
-j$(nproc) to use make -j"$(nproc)" and change the install call that uses make
DESTDIR=$OUTPUT_DIR install to use make DESTDIR="$OUTPUT_DIR" install so command
substitution and the OUTPUT_DIR variable are protected from word splitting and
globbing.
🪄 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: 380216a7-58c6-43cf-89fd-828f8bee0c62

📥 Commits

Reviewing files that changed from the base of the PR and between 3ae4553 and 59577c8.

📒 Files selected for processing (3)
  • packages/e2fsprogs/NOTES.md
  • packages/e2fsprogs/build.ncl
  • packages/e2fsprogs/build.sh

Comment thread packages/e2fsprogs/build.ncl Outdated
The source tarball is fetched from kernel.org
(mirrors.edge.kernel.org/.../tytso/e2fsprogs), not github.com. e2fsprogs'
canonical upstream is Ted Ts'o's dev tree on kernel.org; the
github.com/tytso/e2fsprogs repo is a mirror. Per repo guidance, omit
source_provenance rather than point it at a mirror, since there is no
kernel.org provenance category and the project is neither a GNU nor a
GitHub-canonical project.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@norrietaylor
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@norrietaylor
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

The minimal-build CI failed on post-build checkers:
- missing runtime_deps: the e2scrub/e2scrub_all scripts need /bin/bash
  and compile_et/mk_cmds need /bin/sh, so add bash to runtime_deps.
- enumerate bins: usr/bin/ has only 5 binaries, so enumerate them as
  explicit outputs (chattr, lsattr, uuidgen, compile_et, mk_cmds)
  instead of a catch-all glob.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread packages/e2fsprogs/NOTES.md Outdated
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant