Paul Menzel (paulepanter@users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5705
-gerrit
commit 7abed0303830ef3832ed1ec2460874f5b5990e4c Author: Kevin O'Connor kevin@koconnor.net Date: Fri May 2 16:06:26 2014 +0200
util: Add script to LZMA compress a file and set size in header
Otherwise SeaBIOS does not decompress it.
Change-Id: I7e3c9081c1bfbf130d0ec5f6aa221f672e29d441 Signed-off-by: Paul Menzel paulepanter@users.sourceforge.net --- util/lzma-with-size-in-header/lzma-with-size-in-header.sh | 9 +++++++++ 1 file changed, 9 insertions(+)
diff --git a/util/lzma-with-size-in-header/lzma-with-size-in-header.sh b/util/lzma-with-size-in-header/lzma-with-size-in-header.sh new file mode 100755 index 0000000..9aa0ad9 --- /dev/null +++ b/util/lzma-with-size-in-header/lzma-with-size-in-header.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Script to create an lzma file with the proper header. +FILENAME="$1" +OUTNAME="$1.lzma" + +size=`python -c "import os; print len(open("$FILENAME", "rb").read())"` + +xz --format=lzma -zc "$FILENAME" > "$OUTNAME" +python -c "import struct; data=open("$OUTNAME", 'rb').read(); data = data[:5] + struct.pack('<i', $size) + data[9:]; open("$OUTNAME", 'wb').write(data)"