roms: unify all add-payload commands

add a generic function that can insert payloads with lzma
compression, or raw files without compression

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2024-06-15 20:22:19 +01:00
parent 26451775d5
commit ed9c90e59d
2 changed files with 18 additions and 18 deletions
+7
View File
@@ -245,3 +245,10 @@ vendor_checksum()
printf "Bad checksum for file: %s\n" "$2" 1>&2
rm -f "$2" || :
}
cbfs()
{
ccmd="add-payload" && [ $# -gt 3 ] && ccmd="add"
lzma="-c lzma" && [ $# -gt 3 ] && lzma="-t raw"
x_ "$cbfstool" "$1" $ccmd -f "$2" -n "$3" $lzma
}