-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
conditionally add in cache to the image, allowing caching in customize image step #8207
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
base: main
Are you sure you want to change the base?
Conversation
…e image step if using docker build
WalkthroughThe changes update the internal logic of the Possibly related PRs
Suggested labels
Suggested reviewers
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure ✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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 (2)
lib/functions/general/chroot-helpers.sh (2)
31-50
: Make host cache path configurable and enforce idempotency.
Hard-coding/armbian/cache
limits flexibility and risks double-mounting on repeated calls. Consider introducing an environment variable (e.g.ARMBIAN_CACHE_DIR
) and checking for an existing mountpoint before binding:local cache_src="${ARMBIAN_CACHE_DIR:-/armbian/cache}" if [[ -d "$cache_src" ]]; then mkdir -p "${target}/armbian/cache" if ! mountpoint -q "${target}/armbian/cache" && mount --bind "$cache_src" "${target}/armbian/cache"; then touch "${target}/run/user/0/cache_mounted.flag" else display_alert "cache bind failed or already bound" "$cache_src → ${target}/armbian/cache" "warn" fi else display_alert "Host cache not found — skipping cache mount" "" "warn" fiUse consistent indentation for readability.
The new block is indented with spaces, whereas the rest of the file uses tabs. Aligning to the existing tab-based style will keep the codebase uniform.
62-67
: Prefer a mountpoint check over a flag file for cache unmount.
Rather than relying oncache_mounted.flag
, you can directly test if the bind mount exists:if mountpoint -q "${target}/armbian/cache"; then umount "${target}/armbian/cache" || true fiThis removes the need for a temporary flag and handles state detection more robustly.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
lib/functions/general/chroot-helpers.sh
(3 hunks)
🔇 Additional comments (1)
lib/functions/general/chroot-helpers.sh (1)
19-19
: Added debug logging for mount_chroot.
Logging the target at debug level will aid in tracing chroot mounts during development and troubleshooting.
Description
This reimplements this pull request, while fixing the edge case (hopefully). #8186
I don't have a bare metal device to test.
How Has This Been Tested?
Tested using docker
Checklist:
Please delete options that are not relevant.