Is it possible to change the boot order like it is possbile with raspi-config
?
With the config tool you can choose between:
| B1 SD Card Boot Boot from SD Card if available, otherwise boot from USB │
│ B2 USB Boot Boot from USB if available, otherwise boot from SD Card │
│ B3 Network Boot Boot from network if SD card boot fails │
On my current setup I use the SDcard to hold some music files. Whenever I reboot the device I have to take out the card, to be able to boot via USB.
The interesting part of raspi-config
looks like this:
case "$BOOTOPT" in
B1*)
if ! grep -q "BOOT_ORDER" $EECFG ; then
sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf41"
else
sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf41/"
fi
STATUS="SD Card"
;;
B2*)
if ! grep -q "BOOT_ORDER" $EECFG ; then
sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf14"
else
sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf14/"
fi
STATUS="USB"
;;
B3*)
if ! grep -q "BOOT_ORDER" $EECFG ; then
sed $EECFG -i -e "\$a[all]\nBOOT_ORDER=0xf21"
else
sed $EECFG -i -e "s/^BOOT_ORDER=.*/BOOT_ORDER=0xf21/"
fi
STATUS="Network"
;;