diff options
author | Simon Wilson <simonwilson@google.com> | 2015-06-17 12:36:53 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2015-06-17 12:36:53 -0700 |
commit | b4cf7b309e8d8dc2ebbc6501ef205091322ab659 (patch) | |
tree | 1b2bdda99736a244501a020ffe8c22e5d684bb58 | |
parent | 01e42b24c9b56b3ca88a2cf563a8c695d5a74534 (diff) | |
download | extras-b4cf7b309e8d8dc2ebbc6501ef205091322ab659.tar.gz |
Add switches for compressor
Change-Id: I297321db3996d07e9eba3edc0b2837c8d221ab1a
-rwxr-xr-x | squashfs_utils/mksquashfsimage.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/squashfs_utils/mksquashfsimage.sh b/squashfs_utils/mksquashfsimage.sh index 7f96cb1f..06860926 100755 --- a/squashfs_utils/mksquashfsimage.sh +++ b/squashfs_utils/mksquashfsimage.sh @@ -5,7 +5,7 @@ function usage() { cat<<EOT Usage: -${0##*/} SRC_DIR OUTPUT_FILE [-m MOUNT_POINT] [-c FILE_CONTEXTS] [-b BLOCK_SIZE] +${0##*/} SRC_DIR OUTPUT_FILE [-m MOUNT_POINT] [-c FILE_CONTEXTS] [-b BLOCK_SIZE] [-z COMPRESSOR] [-zo COMPRESSOR_OPT] EOT } @@ -42,6 +42,19 @@ if [[ "$1" == "-b" ]]; then shift; shift fi +COMPRESSOR="lz4" +COMPRESSOR_OPT="-Xhc" +if [[ "$1" == "-z" ]]; then + COMPRESSOR=$2 + COMPRESSOR_OPT= + shift; shift +fi + +if [[ "$1" == "-zo" ]]; then + COMPRESSOR_OPT=$2 + shift; shift +fi + OPT="" if [ -n "$MOUNT_POINT" ]; then OPT="$OPT -mount-point $MOUNT_POINT" @@ -53,7 +66,7 @@ if [ -n "$BLOCK_SIZE" ]; then OPT="$OPT -b $BLOCK_SIZE" fi -MAKE_SQUASHFS_CMD="mksquashfs $SRC_DIR $OUTPUT_FILE -no-progress -comp lz4 -Xhc -no-exports -noappend -no-recovery -android-fs-config $OPT" +MAKE_SQUASHFS_CMD="mksquashfs $SRC_DIR $OUTPUT_FILE -no-progress -comp $COMPRESSOR $COMPRESSOR_OPT -no-exports -noappend -no-recovery -android-fs-config $OPT" echo $MAKE_SQUASHFS_CMD $MAKE_SQUASHFS_CMD if [ $? -ne 0 ]; then |