-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
framework mmdebstrap fetch_distro_keyring - ignore dpkg-deb/tar non-essential errors #8870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
lib/functions/rootfs/distro-specific.sh (3)
116-126: Error suppression + file validation is reasonable, but consider logging extraction warnings.Suppressing all
dpkg-debexit codes will hide genuine failures (disk full, corrupted .deb, etc.), though the file existence check (lines 118–126) provides a fallback validation gate. However, if extraction fails for a legitimate reason, users will see only "unable to find debian-archive-keyring.gpg" without diagnostic context about the actual extraction error.Consider piping stderr to a log file so failures are recorded even when exit codes are ignored:
- dpkg-deb -x "${CACHEDIR}/${KEYRING_DEB}" "${CACHEDIR}" || /bin/true # ignore failures, we'll check a few lines down + dpkg-deb -x "${CACHEDIR}/${KEYRING_DEB}" "${CACHEDIR}" 2>&1 | tee -a /tmp/keyring-extraction.log || /bin/trueThis preserves diagnostics without breaking the flow when chmod/chgrp errors occur.
134-142: Comment referencing "see above" reduces clarity when reading this section independently.While DRY principles apply, the comment on line 134 saying "see above" requires readers to scroll back to the Debian branch to understand the rationale. Since Debian Ports is logically separate, consider either:
- Repeating the brief explanation inline for clarity
- Extracting the extraction logic into a helper function
Minor readability issue; not blocking.
159-162: Ubuntu validation uses inverted logic; consider aligning with Debian pattern for consistency.The Ubuntu branch checks
if [[ ! -e ... ]] exit_with_error, while Debian branches useif [[ -e ... ]] cp; elif ...; else exit_with_error. Both are correct, but the inconsistent pattern across branches may confuse maintainers.Consider applying the same if/elif/else pattern as Debian for structural consistency, or document why Ubuntu differs:
- dpkg-deb -x "${CACHEDIR}/${KEYRING_DEB}" "${CACHEDIR}" || /bin/true # see above in debian block about ignoring errors - if [[ ! -e "${CACHEDIR}/usr/share/keyrings/ubuntu-archive-keyring.gpg" ]]; then - exit_with_error "fetch_distro_keyring" "unable to find ubuntu-archive-keyring.gpg" - fi + if [[ -e "${CACHEDIR}/usr/share/keyrings/ubuntu-archive-keyring.gpg" ]]; then + cp -l "${CACHEDIR}/usr/share/keyrings/ubuntu-archive-keyring.gpg" "${CACHEDIR}/" + else + exit_with_error "fetch_distro_keyring" "unable to find ubuntu-archive-keyring.gpg" + fiThis aligns the Ubuntu block with the Debian/Debian Ports structure.
📜 Review details
Configuration used: CodeRabbit UI
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.
📒 Files selected for processing (1)
lib/functions/rootfs/distro-specific.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.
Learnt from: tabrisnet
Repo: armbian/build PR: 0
File: :0-0
Timestamp: 2025-10-24T04:46:22.901Z
Learning: The `debootstrap` tool doesn't use `apt`, which is important context when reviewing apt-related configuration in rootfs creation code.
📚 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/distro-specific.sh
vidplace7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RELEASE=trixie is compiling happily again for me with this fix 👍
|
✅ This PR has been reviewed and approved — all set for merge! |
Description
fix for issue re
tarbarfing when it can'tchmod/chgrpHow Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.