diff options
Diffstat (limited to 'configs/platform-v8a/barebox-common-defaultenv/init/bootsource')
-rw-r--r-- | configs/platform-v8a/barebox-common-defaultenv/init/bootsource | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/configs/platform-v8a/barebox-common-defaultenv/init/bootsource b/configs/platform-v8a/barebox-common-defaultenv/init/bootsource new file mode 100644 index 0000000..aa1d06d --- /dev/null +++ b/configs/platform-v8a/barebox-common-defaultenv/init/bootsource @@ -0,0 +1,23 @@ +#!/bin/sh + +if [ -n "${nv.boot.default}" ]; then + exit +fi + + +if [ "$bootsource" = mmc ]; then + detect mmc$bootsource_instance + global.boot.default="mmc$bootsource_instance net" +fi + +if of_compatible -k radxa,rock3a tq,imx8mp-tqma8mpql-mba8mpxl; then + global.boot.default="bootchooser net" + global bootchooser.state_prefix="state.bootstate" + global bootchooser.targets="system0 system1" + global bootchooser.system0.boot="mmc1.root-A" + global bootchooser.system1.boot="mmc1.root-B" + if [ "$bootsource" = "spi-nor" ]; then + usbgadget -A '/dev/mmc1(sd)' + global.autoboot=abort + fi +fi |