2

I want to build a Raspberry Pi image configured with a customised set of packages and configuration ready to image and distribute to push onto a SD card and boot from.

i.e. I want to automate the manual process of:

  1. Download Raspberry Pi image
  2. 'Flash' to an SD card
  3. Boot up
  4. apt update && apt install minicom
  5. vi /etc/minicom/minirc.dfl

...

  1. Shut down Raspberry Pi
  2. Save an image of the configured system
  3. Upload image online

What are the most appropriate existing tools to automate such a build?

Mat
  • 82,161
  • 34
  • 89
  • 109

2 Answers2

1

The packer-builder-arm plugin for HashiCorp Packer seems to be a good starting point. This is a good initial tutorial although further thinking is required to apply customisation.

There is also packer-plugin-arm-image which does a similar job. A explanation for why the packer-builder-arm was also developed is documented in a pull request.

Mat
  • 82,161
  • 34
  • 89
  • 109
0

A very simple and efficient method is to use the Linux tool dd inspired by "Data Definition statement of IBM OS/360 JCL"

dd if=/dev/mmcblk0 | gzip /media/rpi_card.copy.img.gz

If you prefer more, you can send image over the network to another host

dd if=/dev/mmcblk0 | gzip -1 - | ssh user@192.168.1.1 dd of=rpi_card.copy.img.gz
Amit Vujic
  • 1,632
  • 1
  • 24
  • 32