I want to to create a (kind of) preset image for raspberry that will include some application set up that I'm working on a project of mine.

So, let's start with a simple problem so that from this point I can start building more complex setups on my own.

Suppose that I took the original partition that is included on the raspberry pi image (the one with the running system, not the one with the bootloader stuff) and I squashed it with mksquashfs. And now I want to put it on a newly formatted memory card.

So.... let's say I take this card, I create a vfat partition on it that can hold all of the bootloader files plus the squashfs file which is some 1.6 GBs (say.... the vfat partition will be 2 GBs), I copy all the files from the original raspberry pi bootloader partition into the newly created partition of the new memory card, I also place the squashfs file there. Now.... I would have to modify the cmdline.txt file so that the rootfs is not actually root=PARTUUID=15ca46a5-02 but something like (I'm guessing) root=/boot/the-squashedfs-file.sqsh, also rootfstype=squashfs. At this point, the kernel should be able to boot, right?

Well.... it doesn't. I was able to see the raspberries that show up when booting but there's no text output so I'm more than sure that something went wrong. At what point did my hack break?

It's a pi2, by the way.

  • 1
    Check out Win32DiskImager - it makes it easier to copy your SD cards. raspberry-projects.com/pi/pi-operating-systems/win32diskimager – SDsolar Apr 7 '18 at 7:27
  • It's not about being able to copy or write the images. I'm a gnu/linux user so I have no problem with that by just using plain old dd or cat or pv or stuff like that. What I need is to find a way to boot a raspberry pi 1 starting from an empty memory card and 2 booting with a "squashed" FS to be used as / instead of a partition on the memory card. – eftshift0 Apr 7 '18 at 8:38
  • 1
    I have tried similar things. Maybe you will find some hints in Howto prepare a SD card from a tar archive and in Howto install RPi with debootstrap. With the bootstraped installation you could set up your installation from scratch. – Ingo Apr 7 '18 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.