Raspberry Pi OS: Create your own system images with rpi-image-gen

With the new tool rpi-image-gen, user-defined images of Raspberry Pi OS can be created. It is not necessary to maintain your own repository.

listen Print view
Raspberry Pi 4 in production

(Image: Raspberry Pi Foundation)

2 min. read

The developers of Raspberry Pi OS have released rpi-image-gen, a new tool for creating user-defined images. It allows you to select which packages belong to the Linux distribution and are installed on the single-board computer when the operating system is installed. For example, developers of embedded systems or administrators of organizations can specify the required programs and settings in advance. The application uses text-based configuration files and is intended to be an alternative to the previous pi-gen tool.

So-called profiles define the Debian packages and installation processes for your image. Unlike in pi-gen, any package sources can be selected for this purpose; a separate repository is not required. The image layout describes the arrangement of the image on the hard disk. It includes file systems and partition tables, for example. Based on the configuration file in .ini format, rpi-image-gen creates the user-defined image of Raspberry Pi OS. With the file, users can define the required profile and layout and customize it for different Pi models and purposes.

Furthermore, the configuration file is linked to the hardware of the respective single-board computer. This should ensure that the defined settings are compatible with the device, for example, that the size of the partition images matches the capacity of the onboard eMMC. In addition, individual files can be excluded during installation via dpkg paths. Each image is given a software parts list when it is created, which can be used to identify the respective components and track known security vulnerabilities.

Videos by heise

In the first release, the rpi-image-gen includes several sample images. One of these is a minimal build that contains only the central components and is the starting point for creating further images. All images, documentation, and the tool published under the 3-Clause-BSD license can be found on GitHub. The developers recommend running rpi-image-gen on a current 64-bit installation of Raspberry Pi OS.

(sfe)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.