0

There are different pre-built images available for Raspberry Pis, both in desktop and server variants, etc.

In my situation, I want to build a much more slimmer image with some configurations made long before the first boot and with fewer preinstalled packages as I won't use them at all. Modifying pre-built images isn't good as it isn't a clean approach.

I found same question there, but it points to manifest files, which just contain names and versions of installed packages. That info, of course, isn't enough to create functional image from scratch.

How are the pre-built Ubuntu images for Raspberry Pi actually made?

Kevin Bowen
  • 20,055
  • 57
  • 82
  • 84

1 Answers1

0

I'm not sure how they're built

this page might help

prerequisites :

sudo apt-get install gparted

step 1 - clone SD card of raspbery with software you want

sudo fdisk -l

check which /dev/sdx is the SD card

clone SD card to image on PC

sudo dd if=/dev/sdb of=/your/path/to/clone.img

step 2 - shrink image

wget  https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin
sudo pishrink.sh /your/path/to/clone.img /your/path/to/clone-shrink.img

step 3 - flash new image to SD

Download the Etcher (www.etcher.io) application for your OS and select your newly shrunken image, then select the new SD card and click the button Flash And you are all good

step 4 - optional

to share the image with others are store it in smaller you can compress it to have a smaller storage/sending size

gzip -9 /your/path/to/clone-shrink.img

original site :

https://medium.com/platformer-blog/creating-a-custom-raspbian-os-image-for-production-3fcb43ff3630

Koen
  • 1,277