-
Notifications
You must be signed in to change notification settings - Fork 1
Allow to skip root password reset (mkpasswd) and ssh authorized key adding #23
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 script Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
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: 1
🧹 Nitpick comments (3)
tools/finalize-nakamochi.sh (3)
39-47: Refine usage message for optional SSH key.
The current syntax[/mnt/usd [/mnt/ssd [ssh_authorized_key]]]is correct but could be clearer. Consider using explicit placeholders and angle‐brackets for readability:Usage: $(basename "$0") [options] <USD_DEVICE> <SSD_DEVICE> [<USD_MOUNT>] [<SSD_MOUNT>] [<SSH_AUTHORIZED_KEY>]
98-103: Make package manager-agnostic suggestion.
The error message directs users toapt install whois, which may not apply across distributions. Consider a generic notice:Error: mkpasswd not found (install via the 'whois' package on your distro).
328-335: Streamline authorized key installation.
Appending the key works, but you can useinstallfor atomic directory creation and permissions:+ install -d -m 700 "$USD_MOUNT_POINT/root/.ssh" + install -m 600 "$SSH_AUTHORIZED_KEY" "$USD_MOUNT_POINT/root/.ssh/authorized_keys" - mkdir -p "$USD_MOUNT_POINT"/root/.ssh - cat "$SSH_AUTHORIZED_KEY" >> "$USD_MOUNT_POINT"/root/.ssh/authorized_keys - chmod 600 "$USD_MOUNT_POINT"/root/.ssh/authorized_keys
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
tools/finalize-nakamochi.sh(8 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (5)
tools/finalize-nakamochi.sh (5)
63-63: Initializeskip_passwdflag.
Defaultingskip_passwd=0is appropriate to maintain current behavior.
72-75: Handle--skip-passwdoption.
The new case branch correctly parses and shifts the--skip-passwdflag.
114-114: Capture SSH authorized key argument.
Assigning the fifth positional argument ($5) toSSH_AUTHORIZED_KEYafter option parsing is correct.
290-297: Guard password setup in test-image block.
Theskip_passwdchecks correctly skip setting a root password and the accompanying echo when flagged.
303-306: Guard password setup in production block.
The conditional aroundmkpasswdensures no password is set when skipping. This aligns with the new flag.
Helps me to do some
finalize-nakamochi.shtests sometimes from local LiveCD Linux virtual machines withoutmkpasswdpresent and possibility to install (like Gentoo minimal installation CD). And adding ssh authorized key from this script is very useful in general, avoids extra manual steps later.Summary by CodeRabbit
New Features
Bug Fixes