Convert other Linux distributions for Berryboot
Berryboot offers a small number of linux distributions for automatic download. This can be done in the Berryboot GUI. A complete list of distributions available for download can be found here. Currently there are many other Linux distributions that supports ARM CPUs. They have been ported and compiled for that. I show you how to convert an ARM Linux image for Berryboot.
Preparations
The first step is to get some ARM Linux distributions. A list of all images for ARM CPUs like Raspberry Pi can be found here. A few examples are Arch Linux, Fedora 17 Remix, openSUSE, … Theses images can be used with an bootable SD card, but we want to use this images for our boot loader Berryboot, so we need to convert them.
We need a Linux system for the conversion. On this system we can compute the image to another file system. If you do not have a ready Linux system for that, don’t worry, just install a virtual one. I show you how this works here. However, we need to install two additional packets:
- kpartx
apt-get install kpartx
- squashfs-tools
apt-get install squashfs-tools
Conversion
With this two installed packets, conversion is quite easy. You only have to do some Linux commands. Here is how I did the conversion for Arch Linux (if you use another distribution, you have to change the name of the image files):
sudo kpartx -av arch*.img sudo mkdir /mnt/tmp/ sudo mount /dev/mapper/loop0p2 /mnt/tmp/ cd /mnt/tmp/ sudo rm lib sudo mv usr/lib lib cd usr sudo ln -s ../lib lib cd ~ sudo mksquashfs /mnt/tmp/ Arch_Linux.img240 -comp lzo -e lib/modules sudo kpartx -d arch*.img
I copied my Arch Linux image into my home folder for this example. After successful conversion you should find the new image file also in you home folder. This image is smaller! This is not a compression, we do not copied the lib/modules directory. Why? Because all Linux distributions use the ones from Berryboot. We copy this image to a FAT formatted USB stick.
Installation
You should boot your Raspberry Pi with your Berryboot SD card. At your boot menu you should get to the dialog to install a new operating system. This button is called ‚AddOS‘. Click this button some seconds and there will be a context menu. There we choose to load an os from USB stick. In your file browser look for the new Arch Linux image. The copying lasts some time, but should be run without problems. At the next boot, you should be able to start your Raspberry Pi with the new distribution.
Hallo! I tried the above for the 2013-06-06 version of ArchLinux downloaded from a mirror on the raspberry pi official website, but I got a symlink error upon trying to boot into ArchLinux. No command prompt!
It appears that the 2013-06-06 version already has usr/lib symlinked to lib. I tried also cp’ing (-pr) the lib to usr/lib and the usr/bin to usr/sbin, trying to avoid the symlink errors like this guy. Not sure if this will solve the problem, and even if so, it may introduce other problems…
Best-
seems like it is working with raspbian images only … other cause problems / deletes SDcard …
———-
images:
https://mega.co.nz/#!tJA3mJzQ!UHLHpSWon_UkYmj-yxsN_kmdONd4_i1EE-WEmKkk3N4
https://mega.co.nz/#!4VJnEI7L!AiW0YkvOgFvSrdSgTgdkbDziIolqpu486OFJS1phmmo
2013-09-10-wheezy-raspbian.BBOOT.img (511.4 MB)
https://mega.co.nz/#!kdoAyJaJ!VjDWbC8FGSGbTvrTcb-1v2frtawKAIzJ6-VniTJHOjU
———
==custom distro==
as root:
yum -y install kpartx squashfs-tools
## cd to work dir
MNT=/mnt/c && ls -alrt $MNT
DIR=. && ls -alrt $DIR
IMG= image_you_want_to_convert.img
kpartx -av $DIR/$IMG
PART=loop0p2
mount /dev/mapper/$PART $MNT
sed -i ’s|^/dev/mmcblk|#|g‘ $MNT/etc/fstab
mksquashfs $MNT ${IMG%.img}.BBOOT.img -comp lzo -e lib/modules
umount $MNT && kpartx -d $DIR/$IMG ## cleanup