Whats the best way to make a custom RPi image - one with configs already applied and binaries installed etc?
@ripienaar I played with cloud images and made this:
https://github.com/alexpdp7/raspberry-pi-headless-provision
, but I really can't recommend it in its current state. I didn't find many alternatives, although Raspbian has some hooks to do this kind of stuff (although I found it difficult to find the docs).
@ripienaar rpi-imager has some advanced options, let's you customise an image to a degree.
@ripienaar three options:
1) pi-gen (https://github.com/RPi-Distro/pi-gen) creates full os images you can just dd write onto an SD card or volume of choice, but is most elaborate
2) rpi-imager (or the desktop equivalent) will drop a /boot/firstrun.sh script when you customize the image for hostname/ssh user, etc. Edit that with customizations. I do this and copy it and a custom cmdline.txt to a freshly imaged volume before boot for my cluster
3) if its a ubuntu pi image, use cloudinit / user-data
@ripienaar would you hate me if I said nixos-generators? ;)
@boffbowsh yes :)
@ripienaar I looked into it earlier this week for my turingPi 2 cluster (https://angrydome.com/posts/k3s_tailscale/), I’m overthinking a bolt project to automate provisioning, since I can remote flash each module via the management interface, plus use tailscale’s oauth client for one time keys for first boot remote connectivity
@mrzarquon hmm yeah I guess I really need so few changes even a bash script would do :)
@ripienaar yeah - I believe firstrun.sh will be followed by a reboot to mount the resized volume, so you can probably skip service refresh, drop packages, config, wait for reboot - just don't add a gig of packages in the process.