My recent project requires the use of the Raspberry Pi (RPi for short). I bought one early in June and has been playing with it for about 2 months. Quite an interesting adventure. As I needed to deploy a number of RPi’s, I had to do something to make the configuration management more sane for myself. I started with trying to build a standard image for all my RPi’s, and (my current planned approach) use Ansible to configure the parts that are different.
Good that that Raspbian provides an open source repository for the project they use to generate the Raspbian image at https://github.com/RPi-Distro/pi-gen.
I spent quite some time on this and here are some learning points I have:
- How to change the mirror site URL
- How to insert default WiFi settings
- How to tweak locales and timezones
- How to enable ssh by default
- How to start Chromium in Kiosk mode upon startup
- How to specify which stage you want to run until and export image for
- (more to come)
There are two ways to run pi-gen, one is to run it within a host that calls the
build.sh script to build the image, and the other is to run it within a docker image which in turns calls the same
Once you have completed the modifications above, you can start to run pi-gen using one of these two methods.