summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-09-17 02:02:07 +0100
committerLeah Rowe <leah@libreboot.org>2026-09-17 02:06:00 +0100
commit08021d71c2fc084bb4c9c579a0b39a62edf6e1f5 (patch)
tree8d7a8e6e2ff0567a18c6667adcdce1f036686c7a
parent856551a36d61b05fc78dc1ae742e6a0ec0a1303d (diff)
rom.sh: simplify add_uboot
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/fw/rom.sh19
1 files 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" ] && \