Anyone who has ever messed with a Raspberry Pi knows the drill. You download the latest Pi OS release image and burn it to an SD Card. Then you slide the card into the Pi and power it up. The Pi boots, you login with the default credentials, and you run ‘sudo rasp-config’.
You configure your WiFi access point, locale, keyboard, and timezone. You enable SSH, I2C, Camera, and whatever else you need for IO. Next, you run ‘sudo apt update’, ‘sudo apt upgrade’, and reboot. Finally, you log back in and install all your favorite software that is not installed on the base image (p7zip, pip, i2ctools, midnight commander, etc.)
For casual Pi users, this is a one-time or rare task. For experienced Makers who have gone through this drill dozens, if not hundreds of times – it is a real pain. For Makers who write lots of code and/or software installation scripts, this process is beyond irritating.
I have created a ‘How-To’ document that describes, in detail, how to create a customized Pi OS image that is just under 2GB in size. The small size burns very quickly to an SD Card.
The process looks like this:
- Download a base Pi OS image from raspberrypi.org.
- Burn the base image to an SD Card.
- Modify the image to prevent the automatic resizing of the root filesystem.
- Boot the image with a Pi and resize the root partition to desired size.
- (A bash script to do this is included in the download file)
- Configure the Pi (raspi-config) and install desired software.
- Restore the ability to auto-size the root partition on first boot of custom image.
- Make a master image of your customized Pi.
When you burn your custom image to an SD Card, not only does it burn fast, but when you boot it – there is not need to configure it. It is ready to go with a fully expanded root partition.
I hope this idea saves you as much time as it has saved me.