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
  • 19,615
  • 55
  • 79
  • 83
  • You are looking for a unicorn. These links might be helpful: https://askubuntu.com/questions/250696/how-to-cross-compile-for-arm | https://wiki.ubuntu.com/UbuntuDevelopment – Nmath Dec 20 '20 at 08:45
  • @Nmath No. For Raspbian OS, for example, there are official pi-gen scripts that are used for creating official images and can be customized for creating custom images from scratch. – Daniil Shchadny Dec 20 '20 at 13:48
  • I don't believe we have ever fully documented the way in which any of the main Ubuntu images are built. Not just limited to the Pi images, but the desktop and server ones too. It's possible to piece this information together, which people do, but nobody has collated it all and documented, that I know of. – popey Dec 25 '20 at 14:49

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,167
  • Well, that's entirely different. It's raspbian, not ubuntu and for raspbian there is official pi-gen scripts kit that's used to create official images, so it can be easely customized. – Daniil Shchadny Dec 20 '20 at 13:43
  • there's nothing raspbian in this solution - it could be done with ubuntu too - otherwise if you really want to start from scratch - you could look at this https://intestinate.com/pilfs/ – Koen Dec 20 '20 at 14:19