geneworld
Posts: 67
Joined: Sun Jan 19, 2014 11:46 pm

Choose boot location based on jumper cable?

Thu Sep 28, 2017 2:43 pm

Hey Guys I've had a thought and I wanted to see if anyone has any input on it.

I currently have my pi booting from a USB drive with only the /boot directory on the card.

My thought was what if I kept all the directories on the SD card also and have something set up in

Code: Select all

/boot/cmdline.txt
where if a certain GPIO pin was jumped to ground the OS would boot from the SD card and if the GPIO pin was open then it would boot to the USB drive.

I'm not sure of the booting sequence to know if this is even something possible so i thought i'd ask! Does anyone have any thoughts on this?

I know I can make a program to check on boot in cron where if it detects a jump it can edit the cmdline.txt file and swap lines then reboot to the SD card but I thought maybe there was a way i could hard code it to save the reboot process.

Thanks, any input is greatly appreciated!
1 B R1
4B R2 IR
1B+ USB Boot/RetroPie2.6/KODI
1Pi2 USB Boot/Media Server/Torrent Box
1Pi Zero Web-based universal remote control
2Pi Zero Misc.
1Pi3 USB Boot/RetroPie3.6/KODI/pianobar

fruitoftheloom
Posts: 20181
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Choose boot location based on jumper cable?

Thu Sep 28, 2017 3:14 pm

adieu

Asus CS10 Chromebit / HP Envy 4500 Wireless Printer / Raspberry Pi Model 2B v1.1 / RealVNC Software...

geneworld
Posts: 67
Joined: Sun Jan 19, 2014 11:46 pm

Re: Choose boot location based on jumper cable?

Thu Sep 28, 2017 5:58 pm

Thanks for that link! It looks like what i want to do is possible but the documentation doesn't seem to show the steps needed so I'll have to look into it further i guess.

Has anyone been able to do this and can help through it?

Thanks!
1 B R1
4B R2 IR
1B+ USB Boot/RetroPie2.6/KODI
1Pi2 USB Boot/Media Server/Torrent Box
1Pi Zero Web-based universal remote control
2Pi Zero Misc.
1Pi3 USB Boot/RetroPie3.6/KODI/pianobar

Return to “Advanced users”