Tuesday, February 5, 2013

Changing the Berryboot selected OS on a keyboard-less Raspberry Pi

If you're using Berryboot on your keyboard-less Raspberry Pi, here's how to switch to another OS on reboot, based on the instructions from the Berryboot thread here:
1. Login to SSH
2. Mount raw storage:
mount /dev/mmcblk0p2 /mnt
(I suppose the actual mount point doesn't matter)
3. Check what the full file name of the operating you would like to run is:
ls /mnt/images
4. Write out the desired image file's name to "runonce"
echo "[filename_of_operating_system].img[memsplit amount]" > /mnt/data/runonce
Oddly, this command line above kept giving me permissions errors, even when prefixed with "sudo" - I had to use "sudo su" first and then it worked.
5. reboot
Note that this will only change the booted OS for the next reboot. You could probably change the default by changing the 4th step to the following:
echo "[filename_of_operating_system].img[memsplit amount]" > /mnt/data/default


7 comments :

  1. Just using 'echo' didn't work for me. I had to use the -n option:

    echo -n "[filename_of_operating_system].img[memsplit amount]" > /mnt/data/default

    ReplyDelete
  2. please give an example of the last command to run with a eg.img filename as i cannot get mine to work??

    ReplyDelete
  3. I haven't used berryboot in a while, but it should be something like this. For example, saythe image file of the OS you want to switch to is OpenELEC.img128
    1) First switch to superuser to avoid the permissions issues:
    sudo su
    2) Type out the filename and pipe it to the /mnt/data/default file
    echo OpenELEC.img128 > /mnt/data/default

    ReplyDelete
  4. When I run mount it says "mount berryboot can't read superblock".

    ReplyDelete
  5. I'm not sure what that means. What's the whole command line?

    ReplyDelete