Skip to content

Conversation

@leggewie
Copy link
Collaborator

@leggewie leggewie commented Dec 12, 2025

this fixes the issue raised in armbian/apa#32

Summary by CodeRabbit

  • Bug Fixes
    • Improved robustness of the system initialization process to gracefully handle scenarios where certain system files may be missing, preventing unnecessary interruptions.

✏️ Tip: You can customize this high-level summary in your review settings.

@leggewie leggewie requested a review from a team as a code owner December 12, 2025 21:17
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 12, 2025

Walkthrough

Modified the rootfs creation script to add the -f flag to three rm commands when removing resolv.conf and machine-id-related paths. The -f flag suppresses errors if targets are missing, while -v preserves verbose output. No logic or control-flow changes.

Changes

Cohort / File(s) Summary
Shell script defensive coding
lib/functions/rootfs/rootfs-create.sh
Updated three rm -v commands to rm -fv when removing resolv.conf and machine-id files, adding the force flag to suppress errors if targets don't exist

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single file with repetitive, uniform change across three occurrences
  • No logic modifications or control-flow implications
  • Straightforward defensive coding improvement

Poem

A rabbit hops through rootfs clean,
With rm -fv, no errors seen,
Three gentle flags now safer still,
Missing files bend to our will! 🐰✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding the -f flag to rm commands to make them more robust by suppressing errors for missing files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 413d6d4 and 1a9b711.

📒 Files selected for processing (1)
  • lib/functions/rootfs/rootfs-create.sh (3 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-10-24T04:46:22.901Z
Learning: In lib/functions/rootfs/rootfs-create.sh, the FIXME comment about mmdebstrap usage with --aptopt is a future note related to PR #8785, which hasn't been merged yet.
📚 Learning: 2025-10-24T04:46:22.901Z
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-10-24T04:46:22.901Z
Learning: In lib/functions/rootfs/rootfs-create.sh, the FIXME comment about mmdebstrap usage with --aptopt is a future note related to PR #8785, which hasn't been merged yet.

Applied to files:

  • lib/functions/rootfs/rootfs-create.sh
🧬 Code graph analysis (1)
lib/functions/rootfs/rootfs-create.sh (2)
lib/functions/logging/runners.sh (1)
  • run_host_command_logged (204-206)
lib/functions/rootfs/post-tweaks.sh (1)
  • post_debootstrap_tweaks (10-34)
🔇 Additional comments (1)
lib/functions/rootfs/rootfs-create.sh (1)

285-285: LGTM! Robustness improvements align with existing patterns.

Adding the -f flag to suppress errors when targets are missing is appropriate for idempotent build operations. This change is consistent with the same pattern already established in lib/functions/rootfs/post-tweaks.sh (lines 18, 25, 33), making the codebase more uniform and robust to edge cases where files may not exist during rootfs creation.

Also applies to: 336-336, 345-345


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 02 Milestone: First quarter release size/small PR with less then 50 lines Needs review Seeking for review Framework Framework components labels Dec 12, 2025
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Dec 12, 2025
@tabrisnet
Copy link
Collaborator

I'm wondering that this isn't the wrong thing. yes, I did mention it in armbian/apa#32 as a possible solution, but I'm thinking that perhaps this needs doing later in the build process. as late as possible.

additionally, I would ask: how has this been tested and under what circumstances would the build break without this but not break with this change.
This feels like it could paper over more subtle problems that will bite us later.
e.g. dbus seems to be mandatory [or dbus-broker] for a system that relies on systemd [we're not a Devuan fork].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

02 Milestone: First 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.

3 participants