I struggled a bit before i found this post. For future reference for myself and maybe help others I'm gonna post my setup and what i did to solve it.
I have a PI v3 and needed it to boot between Raspbian and OpenELEC through SSH commands (using tasker and a ssh plugin on my phone to automate a couple things).
To get it up and running with automatic switching between the two OS's i made a series of command sent through ssh.
To find out which partition to start you use the command:
Primary partition Logical partition Type Label Contents
1 FAT RECOVERY NOOBS boot files & initramfs, OS recovery images
2 extended Any logical partitions
5 ext4 SETTINGS NOOBS settings
6 FAT boot ArchLinux boot files
7 ext4 root ArchLinux root filesystem
8 FAT boot1 Raspbian boot files
9 ext4 root1 Raspbian root filesystem
Partition 1 is the noobs partition. Partition 6 is the RaspBian and Partition 8 is OpenELEC (on my setup).
I'm a newbie when it comes to Linux, so if anyone have suggestions of improving how this is done, feel free to tell me
I have thought about storing scripts on the OS's to run, but havent gotten that far yet.
To get the PI to reboot into OpenELEC from RaspBian i did the following:
#make a folder in /tmp to mount noobs partition, this folder gets removed on reboot so you have to do the command every time.
#mount the partition to said folder
Code: Select all
sudo mount /dev/mmcblk0p1 /tmp/noobs
#make the file autoboot.txt in the root folder of noobs partition
Code: Select all
echo "boot_partition=8" | sudo tee /tmp/noobs/autoboot.txt
#reboot the PI
To reboot the PI into Raspbian from OpenELEC:
#make a folder in /tmp to mount noobs partition, this folder gets removed on reboot so you have to do the command every time.
#mount the partition to said folder. On OpenElec the actual location is different from Raspbian.
#OpenELEC doesn't have the "sudo" function since you are "root" when logged in.
Code: Select all
mount /dev/mmcblk0p1 [b]/var/media/root[/b]/tmp/noobs
#make the file autoboot.txt in the root folder of noobs partition
Code: Select all
echo "boot_partition=8" > var/media/root/tmp/noobs/autoboot.txt
#reboot the PI
Hope this will help some newbies like me
Regards
Herman
!PS Added the xml files from tasker.
!PPS Following this guide is done at your own risk 