summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-04-23 04:07:16 +0100
committerLeah Rowe <leah@libreboot.org>2025-04-23 04:11:20 +0100
commit83022b6ba83d73a8539016b810e3926afc1eba7e (patch)
tree70195e84f14a38eb057b3742ea5f3014c805f0a0
parent13ad839691d3f306f880e70f98e90af01de2fda0 (diff)
lib.sh: simplify cbfs()
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rw-r--r--include/lib.sh17
1 files changed, 4 insertions, 13 deletions
diff --git a/include/lib.sh b/include/lib.sh
index 6667b505..86f03cc2 100644
--- a/include/lib.sh
+++ b/include/lib.sh
@@ -276,23 +276,14 @@ vendor_checksum()
cbfs()
{
- fRom="$1" # image to operate on
- fAdd="$2" # file to add
- fName="$3" # filename when added in CBFS
-
ccmd="add-payload" && [ $# -gt 3 ] && [ $# -lt 5 ] && ccmd="add"
lzma="-c lzma" && [ $# -gt 3 ] && [ $# -lt 5 ] && lzma="-t $4"
- # hack. TODO: do it better. this whole function is cursed
- if [ $# -gt 4 ]; then
- # add flat binary for U-Boot (u-boot.bin) on x86
- if [ "$5" = "0x1110000" ]; then
- ccmd="add-flat-binary"
- lzma="-c lzma -l 0x1110000 -e 0x1110000"
- fi
- fi
+ [ $# -gt 4 ] && [ "$5" = "0x1110000" ] && \
+ ccmd="add-flat-binary" && \
+ lzma="-c lzma -l 0x1110000 -e 0x1110000"
- x_ "$cbfstool" "$fRom" $ccmd -f "$fAdd" -n "$fName" $lzma
+ x_ "$cbfstool" "$1" $ccmd -f "$2" -n "$3" $lzma
}
mk()