Non-interactive usage of SDM: options for passwords and Y/N answers #8
Replies: 4 comments 5 replies
-
Great suggestions! I should be able to get to these in the next week or two. Stay tuned! |
Beta Was this translation helpful? Give feedback.
-
Had a chance to look at this in a bit more detail before I go busy for a couple of days. Not sure what --root-password y/n would be used for, since --rootpwd is already there. Here's my current thinking on new switches to meet your needs. LMK your thoughts: --image-reuse y/n # Skip the re-customize question if "y" (may change to --recustomize, still thinking about this) If "--same-password y", then the password for pi/created-user will all be set to the password for "--set-user-password" value (if specified, or "--set-pi-password" if specified. (root password will only be set in this case if --rootpwd is set). I'll also look into adding some of this to the "burn" code, since it might make sense to change passwords when the image is burned, for instance in the case where SD Cards are sent to multiple, independent sites. Thoughts? This may all change when I update the code, of course 🤣 |
Beta Was this translation helpful? Give feedback.
-
Nearly done with the update. Here's what I landed on:
Using --batch prevents dropping into bash in the customized image. Complete non-interactive operation now works. Passwords can be changed on the burn command, so making customized SD Cards for multiple sittes (or whatever) is now simple Oh, and go ahead and delete that Pi user. 🤣 If you use --password-pi on the burn command and the user isn't there, you'll be notified, since you asked for it to be done. Still need to do more testing, but coming soon! |
Beta Was this translation helpful? Give feedback.
-
Changes are all checked in. I'd appreciate your feedback after you've had an opportunity to give it a try. |
Beta Was this translation helpful? Give feedback.
-
Dear SDM community,
I recently tested SDM, it's an awesome tool.
I however wanted to test various non-interactive scenarios, where SDM would be called from scripts/tools, and would require NO user interaction.
I found it is impossible to fully use SDM non-interactively as it is now:
I tried to input data by piping echo/cat commands to SDM, or by redirecting a file to it, but this hurts systemd-nspawn calls then, as a TTY is supposed to be passed as their input (i.e
< $(tty)
)I think it would be interesting to enable fully non-interactive SDM use scenarios, by dropping the
$(tty)
input use, and/or by adding command-line options to answers Y/N questions (e.g. --image-reuse y|n, --same-password y|n, --root-password y|n), as well as to set users password(s) programatically (e.g. --set-user-password).Thanks for your consideration and opinions!
Beta Was this translation helpful? Give feedback.
All reactions