From ed9c90e59d959bab544598d330c724e44afcc096 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 15 Jun 2024 20:22:19 +0100 Subject: 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 --- include/lib.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/lib.sh') diff --git a/include/lib.sh b/include/lib.sh index 3de05c24..bf734f3a 100755 --- a/include/lib.sh +++ b/include/lib.sh @@ -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 +} -- cgit v1.2.1