From 08021d71c2fc084bb4c9c579a0b39a62edf6e1f5 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 17 Sep 2026 02:02:07 +0100 Subject: [PATCH] rom.sh: simplify add_uboot Signed-off-by: Leah Rowe --- include/fw/rom.sh | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/include/fw/rom.sh b/include/fw/rom.sh index 5f45c77e..0fb573ee 100644 --- a/include/fw/rom.sh +++ b/include/fw/rom.sh @@ -336,12 +336,7 @@ mkseagrub() add_uboot() { - if [ "$displaymode" = "txtmode" ]; then - printf "cb/%s: Can't use U-Boot in text mode\n" "$target" 1>&2 - return 0 - elif [ "$initmode" = "normal" ]; then - printf "cb/%s: Can't use U-Boot in normal initmode\n" \ - "$target" 1>&2 + if [ "$displaymode" = "txtmode" ] || [ "$initmode" = "normal" ]; then return 0 fi @@ -353,6 +348,7 @@ add_uboot() ubpath="fallback/payload" ubtree="default" ubtarget="$target" + ubootelf="u-boot.elf" # override for x86/x86_64 targets: if [ -n "$payload_uboot" ] && [ "$payload_uboot" != "arm64" ]; then @@ -363,23 +359,20 @@ add_uboot() ubpath="img/u-boot" # 64-bit ubtree="x86_64" ubtarget="amd64coreboot" + ubootelf="u-boot-x86-with-spl.bin" if [ "$payload_uboot" = "i386" ]; then ubpath="u-boot" # 32-bit ubtree="x86" ubtarget="i386coreboot"; : + ubootelf="u-boot-dtb.bin" fi fi - ubdir="elf/u-boot/$ubtree/$ubtarget/$uboot_config" + ubootelf="elf/u-boot/$ubtree/$ubtarget/$uboot_config/$ubootelf" - ubootelf="$ubdir/u-boot.elf" # aarch64 [ ! -f "$ubootelf" ] && \ - ubootelf="$ubdir/u-boot" # aarch64 (fallback) - [ "$payload_uboot" = "i386" ] && \ - ubootelf="$ubdir/u-boot-dtb.bin" # x86 override - [ "$payload_uboot" = "amd64" ] && \ - ubootelf="$ubdir/u-boot-x86-with-spl.bin" # x86_64 override + ubootelf="${ubootelf%.elf}" cbfs "$tmprom" "$ubootelf" "$ubpath" $ubcbfsargs [ "$payload_seabios" != "y" ] && \