Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8082

Raspberry Pi OS • Re: Getting started with rpi-image-gen is not easy

$
0
0
I had problems getting it to work, too, but finally succeeded - here my findings so far:

My goal is to create a customized SD card image for a zero2w in a smartmeter measuring environment (powered by the smartmeter itself with 230mA @5V through the DSMR serial interface, using a self-developed PHAT with RTC, USB-C/serial/DSMR interface and supercap as a supply buffer).

To build the image, I first tried to install rpi-image-gen on a pi5 (already upgraded to trixie) but one of the dependencies for rpi-image-gen was missing in the repos.

So I performed a standard bookworm install on my x86_64 development PC (intel core i7-14700) using QEMU in an emulated arm64 environment. In this environment, installing the deps and the working example could be finished successfully, but everything was very slow (due to the ARM emulation in QEMU) - half an hour or even more.

Using this platform I tried to modify the example config by replacing ext4 by btrfs as the target root filesystem with the trixie-slim example. This nearly worked, but the image generation step failed as the genimage tool in the standard bookworm repo is too old (I suspect for trixie, too). However, after installing genimage v19 from source this process worked and produced a functioning SD card with btrfs root :D .

But producing images on a virtualized ARM CPU was still very slow. So I installed a bookworm docker image as a privileged container on my (trixie) pi5 with all necessary development tools and repeated the above procedure. This now works flawlessly; and everything works at acceptable speed.

This is a fascinating project, but not easy to work with for me. Programming with bash and configuring with yaml has many pitfalls. For example, I did not succeed to replace the regex string for validating the user password using a simple declaration in my config file or an environment variable. I'm still in the learning curve....

HTH anyone, anyway.

Marcel

Statistics: Posted by abuelomg — Tue Sep 30, 2025 10:30 am



Viewing all articles
Browse latest Browse all 8082

Trending Articles