Skip to content

fix(config): skip host filesystem compatibility check for ROOTFS_TYPE=nfs#9759

Merged
igorpecovnik merged 1 commit intoarmbian:mainfrom
iav:fix/skip-host-fs-check-for-nfs
May 5, 2026
Merged

fix(config): skip host filesystem compatibility check for ROOTFS_TYPE=nfs#9759
igorpecovnik merged 1 commit intoarmbian:mainfrom
iav:fix/skip-host-fs-check-for-nfs

Conversation

@iav
Copy link
Copy Markdown
Contributor

@iav iav commented May 4, 2026

Summary

  • `do_main_configuration()` calls `check_filesystem_compatibility_on_host` for any `$ROOTFS_TYPE`, including `nfs`/`nfs-root`. The check greps `/proc/filesystems` and modprobes `nfs`, aborting if neither succeeds.
  • For `ROOTFS_TYPE=nfs` (and the `nfs-root` variant added by the netboot extension) this is a false positive: `rootfs-to-image.sh` produces a tarball via `tar | gzip` and never mounts NFS on the host. The target's kernel mounts NFS at boot time — host FS support is irrelevant.
  • Aggravated under docker-launcher: `/lib/modules` is not forwarded into the container, so even when the host kernel ships `nfs.ko` the in-container `modprobe nfs` fails. Skipping for nfs is the right fix regardless.
  • Skip is encoded at the call site (knows `ROOTFS_TYPE` semantics), not inside the function (which stays narrowly responsible).

Same one-line gate already lives on the netboot extension PR (#9656). This patch lifts it to `main` as a standalone core armbian fix.

Test plan

  • Build with `ROOTFS_TYPE=nfs` on a host whose kernel/container has no `nfs.ko` — should now proceed (previously aborted).
  • Build with `ROOTFS_TYPE=ext4` (default) — `check_filesystem_compatibility_on_host` runs as before.

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Enhanced NFS rootfs handling by skipping unnecessary filesystem compatibility checks when NFS or NFS-root configurations are selected, improving configuration accuracy and build process efficiency.

…=nfs

The check_filesystem_compatibility_on_host() call in do_main_configuration()
greps /proc/filesystems for $ROOTFS_TYPE and modprobes it if missing,
aborting the build when neither succeeds. For ROOTFS_TYPE=nfs (and the
new nfs-root variant added by the netboot extension) this fires falsely:
the build never mounts NFS on the host. rootfs-to-image.sh produces a
tarball via 'tar | gzip' and lets the target's kernel mount NFS at boot
time. Host NFS support is concept-level irrelevant for these rootfs types.

The check also misbehaves under docker-launcher: /lib/modules is not
forwarded into the container, so even when the host kernel ships nfs.ko
the in-container modprobe fails — but skipping for nfs is the right fix
regardless of the docker edge case.

Carve the skip into the call site rather than the function: the function
stays narrowly responsible (does what its name says); the call site
encodes the higher-level fact that nfs/nfs-root rootfs types never need
host filesystem mount capability.

Same logic already lives on the netboot extension PR (armbian#9656 branch); this
patch lifts it to main as a standalone core armbian fix.

Assisted-by: Claude:claude-opus-4.7
Signed-off-by: Igor Velkov <325961+iav@users.noreply.github.com>
@iav iav requested a review from a team as a code owner May 4, 2026 21:29
@iav iav requested review from ShravanSingh64 and matthijskooijman and removed request for a team May 4, 2026 21:29
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

The PR modifies do_main_configuration() to skip host filesystem compatibility checks when ROOTFS_TYPE is nfs or nfs-root, since these types are handled as tarballs on the host and mounted by the target kernel at boot, making host filesystem checks irrelevant.

Changes

Conditional Skip for NFS Rootfs Types

Layer / File(s) Summary
Conditional Logic & Documentation
lib/functions/configuration/main-config.sh
Added guard condition to skip check_filesystem_compatibility_on_host when CONFIG_DEFS_ONLY != yes and ROOTFS_TYPE is nfs or nfs-root. Expanded comment explains that these rootfs types are tarballs on host, mounted by target kernel at boot.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A tarball hops across the net,
No host checks needed, you can bet!
NFS mounts at boot with glee,
Skipping checks makes logic free! 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically summarizes the main change: skipping a host filesystem compatibility check for NFS rootfs types, which is the core fix implemented in the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions Bot added size/small PR with less then 50 lines 05 Milestone: Second quarter release Needs review Seeking for review Framework Framework components labels May 4, 2026
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/functions/configuration/main-config.sh (1)

138-172: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add nfs-root case block entry to match the conditional guard at line 170.

The condition at line 170 skips the filesystem compatibility check for $ROOTFS_TYPE != nfs and $ROOTFS_TYPE != nfs-root, indicating nfs-root is an intended type. However, the case "$ROOTFS_TYPE" block (lines 138–162) has no handler for nfs-root; its wildcard arm calls exit_with_error "Unknown rootfs type", which aborts the build under set -e before the guard ever executes.

This leaves the feature half-implemented: if anyone attempts to use ROOTFS_TYPE=nfs-root, they get a cryptic "Unknown rootfs type" error instead of proper handling. Add a nfs-root) case entry (similar to the nfs) entry at line 141) to complete the support:

Proposed addition
 	nfs)
 		FIXED_IMAGE_SIZE=256 # small SD card with kernel, boot script and .dtb/.bin files
 		;;
+	nfs-root)
+		FIXED_IMAGE_SIZE=256 # netboot variant; handled identically to nfs at the image level
+		;;
 	f2fs)
🤖 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 `@lib/functions/configuration/main-config.sh` around lines 138 - 172, Add a
case branch for ROOTFS_TYPE 'nfs-root' alongside the existing 'nfs' handler so
the script recognizes that type instead of hitting the wildcard error;
specifically, add a "nfs-root)" arm in the case "$ROOTFS_TYPE" block (mirroring
the handling for "nfs" such as setting FIXED_IMAGE_SIZE=256 or appropriate
comments) so that ROOTFS_TYPE=nfs-root does not trigger exit_with_error and
allows the later conditional that skips check_filesystem_compatibility_on_host
to run as intended.
🤖 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.

Outside diff comments:
In `@lib/functions/configuration/main-config.sh`:
- Around line 138-172: Add a case branch for ROOTFS_TYPE 'nfs-root' alongside
the existing 'nfs' handler so the script recognizes that type instead of hitting
the wildcard error; specifically, add a "nfs-root)" arm in the case
"$ROOTFS_TYPE" block (mirroring the handling for "nfs" such as setting
FIXED_IMAGE_SIZE=256 or appropriate comments) so that ROOTFS_TYPE=nfs-root does
not trigger exit_with_error and allows the later conditional that skips
check_filesystem_compatibility_on_host to run as intended.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9f211336-c3bb-4a55-964b-0b28394bf0b8

📥 Commits

Reviewing files that changed from the base of the PR and between a6cb68a and be41eac.

📒 Files selected for processing (1)
  • lib/functions/configuration/main-config.sh

@github-actions github-actions Bot added the Ready to merge Reviewed, tested and ready for merge label May 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions Bot removed the Needs review Seeking for review label May 4, 2026
@igorpecovnik igorpecovnik merged commit 7b92299 into armbian:main May 5, 2026
13 checks passed
@iav iav deleted the fix/skip-host-fs-check-for-nfs branch May 5, 2026 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Framework Framework components Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

2 participants