raspberrypi / rpi-imager

The home of Raspberry Pi Imager, a user-friendly tool for creating bootable media for Raspberry Pi devices.
https://www.raspberrypi.com/software
Other
1.55k stars 233 forks source link

Command Line option for OS Customization Settings #875

Closed Borillion closed 1 month ago

Borillion commented 1 month ago

Is your feature request related to a problem? Please describe.

Raspberry Pi Imager offers customization options through its graphical user interface (GUI), but these options are not accessible when using the command line interface (CLI). A lack of CLI customization creates challenges for several use cases.

Headless Setups: In headless setups where no monitor is connected. Automation: Automating deployments

Describe the solution you would like to see implemented

rpi-imager should allow for passing a the customization settings file over the CLI with an option such as --oscustomization

Describe alternatives you've considered

Customizing a single SD card and then cloning it to others with the use of dd is also an option, however that necessitates having either an SD Card smaller than the others, or SD cards of the same size, or setting options such as sequential names programmatically.

Additional context

There does not seem to be a file with the saved settings in /Users//Library/Caches/Raspberry Pi/Imager, is there this might be saved and can have scripted changes into it?

Version

1.8.5 (Default)

tdewey-rpi commented 1 month ago

Feature request rejected.

While your first suggested use case is one I'd accept, your second is one I would hard refuse.

Imager is not a tool for automated or mass deployments - Imager is a tool for new users to get started with Raspberry Pi devices in a manner that trades power for ease of use.

That said - there are already customisation options in Imager's CLI - you can provide a firstrun script, or a cloudinit configuration. Both mechanisms are the underpinning of the Imager OS Customisation flow.

But again - I would strongly caution against using Imager's OS customisation for mass deployments. You may wind up creating a fleet of devices with the same password, for example - your own personal potential botnet.

If you are looking for mass deployments, cmprovision is one such tool: https://github.com/raspberrypi/cmprovision

Borillion commented 1 month ago

@tdewey-rpi Thanks for taking the time to answer. I totally understand where you are coming from and wanting to keep new users safe from scripts sourced from unknown authors.

I see that imager has the --first-run-script flag on newer builds. This solves my problem. ( older install did not have this )