#!/bin/bash # Provides: bootin # Short-Description: Boot in whichever multiboot system you got # Description: If you dont have a keyboard and monitor hooked up on your pi and you want to # boot for example from Raspbmc to Raspbian or vice versa using SSH from a remote computer. # First you need to get the partition numbers for all your systems and put them in the values bellow. # Do these steps to get them: # mkdir /tmp/noobs # sudo mount /dev/mmcblk0p3 /tmp/noobs # cat /tmp/noobs/installed_os.json # Example: # "name" : "Raspbian", # "partitions" : [ #"/dev/mmcblk0p5", <---- 5 #"/dev/mmcblk0p6" #..... # "name" : "RaspBMC", # "partitions" : [ #"/dev/mmcblk0p7", <----- 7 #"/dev/mmcblk0p8" #... # the mmcblk0p 5 is important.. Note the 1st number for every /dev pair...these are the numbers you want. These numbers represent your OS systems. # So in the above example i want 5 and 7. If you have more than 2 systems, just copy paste a new section like the kodi) section I have bellow... # and change the sed value \1'x' where is x is the value of the other partition. Also put the name you want for that OS, ex pico) and add that extra OS # at the bottom with the helper command: "Usage: bootin {kodi|raspbian}" ### END INIT INFO case "$1" in kodi) mkdir /tmp/noobs sudo mount /dev/mmcblk0p3 /tmp/noobs sudo sed -i 's,^\(default_partition_to_boot=\).*,\1'7',' /tmp/noobs/noobs.conf echo "Boot value changed to partition with RaspBMC" ;; raspbian) mkdir /tmp/noobs sudo mount /dev/mmcblk0p3 /tmp/noobs sudo sed -i 's,^\(default_partition_to_boot=\).*,\1'5',' /tmp/noobs/noobs.conf echo "Boot value changed to partition with Raspbian" ;; *) echo "Usage: bootin {kodi|raspbian}" exit 1 ;; esac exit 0