From 60c777fb419b4617ce2a7c64fadf16bd5282e6b2 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Wed, 18 Oct 2023 16:20:35 +0200 Subject: [PATCH] common/uboot: If no valid boot media exists, fall back to netboot This means that a device with a valid bootloader, but a completely empty eMMC is still salvageable. --- board/common/uboot/scripts/ixboot.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/board/common/uboot/scripts/ixboot.sh b/board/common/uboot/scripts/ixboot.sh index 1bb2c5d4..53e9d8f5 100644 --- a/board/common/uboot/scripts/ixboot.sh +++ b/board/common/uboot/scripts/ixboot.sh @@ -1,3 +1,5 @@ +setenv valid_media no + for tgt in "${boot_targets}"; do if test "${tgt}" = "mmc0"; then setenv devtype "mmc" @@ -25,8 +27,16 @@ for tgt in "${boot_targets}"; do setenv bootargs_log "loglevel=4" fi + setenv valid_media yes run ixbootmedia fi done +if test "${valid_media}" = "no"; then + echo "NO BOOTABLE MEDIA FOUND, falling back to netboot" + setenv BOOT_ORDER "net" + setenv bootargs_log "debug" + run ixbootmedia +fi + reset