Raspberry Pi: Creating BerryBoot optimized image (the dirty way)

By | April 17, 2013

Goal: To add custom operating system to BerryBoot menu
Problems met: Invalid sector block size, invalid partition info, incompatible filesystem, error when perform kpartx and mounting
Workaround:

1. Write .img file (example: XBian1.0Alpha5.img) into USB drive using win32diskimager. Wait until it complete.
2. Connect and mount USB drive into your linux OS. I’m using Xubuntu installed in VirtualBox, so i need to click and select my USB device into guest OS.
vbox-usb

3.Once the USB device recognized, it’ll be shown in your desktop. 2 partitions will be displayed. First partition has a FAT partition with the bootloader and kernel files while the second one is an ext4 partition with everything else. Mount the second partition into your desired location, or you can just perform right-click and mount. Mine is mounted at /media/user/

pYeTg7HkC1g1fTB59VGJ7K5rI29LGqb-1pE645iJZHw
4. Then you can follow instruction given from berryboot website on how to convert the image files into squashfs file.

$ sudo sed -i 's/^\/dev\/mmcblk/#\0/g' /media/user/changethiswithyourdeviceID
$ sudo mksquashfs /media/user/changethiswithyourdeviceID converted_image_for_berryboot.img -comp lzo -e lib/modules

I’m getting syntax error in sed command, so i replaced the ‘ sign with ” sign:
sed -i "s/^\/dev\/mmcblk/#\0/g"

vwXkKj0cn0-ZGkRG-fsHMBBzwtUqshNjiU5HvL9YFL8
5. BerryBoot optimized file creation doneMS590SwYa-L2mr8T_yqQarSIIxxfLd-_oucW-LfBJk8

References:
https://github.com/maxnet/berryboot/issues/4
http://forum.xbian.org/thread-280.html
http://www.raspberrypi.org/phpBB3/viewtopic.php?p=332113#p332113

Loading