summaryrefslogtreecommitdiff
path: root/squashfs_utils
diff options
context:
space:
mode:
authorMohamad Ayyash <mkayyash@google.com>2016-06-03 18:55:16 -0700
committerMohamad Ayyash <mkayyash@google.com>2016-06-03 18:58:36 -0700
commit921ef8f6dc103d5a7fffeffd659506ee5a4aec58 (patch)
treee033f8a1dd9ffa07d8f4fbdc58a81859ae9f3dd0 /squashfs_utils
parentaedf28f07cc4a8082816667ac3c175ea43e1edad (diff)
downloadextras-921ef8f6dc103d5a7fffeffd659506ee5a4aec58.tar.gz
Introduce squashfs compression threshold
If we can't beat that compression ratio for a single block then we leave it uncompressed. The choice of the threshold depends on the cost of I/O in a specific device which is determined from block I/O speed and CPU speed. BUG: 29058965 Change-Id: I8d17a4551c7d00ddb85687381b7cb0d6c60babf6 Signed-off-by: Mohamad Ayyash <mkayyash@google.com>
Diffstat (limited to 'squashfs_utils')
-rwxr-xr-xsquashfs_utils/mksquashfsimage.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/squashfs_utils/mksquashfsimage.sh b/squashfs_utils/mksquashfsimage.sh
index 0079f6ef..9dae51b8 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 [-s] [-m MOUNT_POINT] [-d PRODUCT_OUT] [-C FS_CONFIG ] [-c FILE_CONTEXTS] [-b BLOCK_SIZE] [-z COMPRESSOR] [-zo COMPRESSOR_OPT]
+${0##*/} SRC_DIR OUTPUT_FILE [-s] [-m MOUNT_POINT] [-d PRODUCT_OUT] [-C FS_CONFIG ] [-c FILE_CONTEXTS] [-b BLOCK_SIZE] [-z COMPRESSOR] [-zo COMPRESSOR_OPT] [-t COMPRESS_THRESHOLD]
EOT
}
@@ -73,6 +73,13 @@ if [[ "$1" == "-zo" ]]; then
shift; shift
fi
+COMPRESS_THRESHOLD=0
+if [[ "$1" == "-t" ]]; then
+ COMPRESS_THRESHOLD=$2
+ shift; shift
+fi
+
+
OPT=""
if [ -n "$MOUNT_POINT" ]; then
OPT="$OPT -mount-point $MOUNT_POINT"
@@ -89,6 +96,9 @@ fi
if [ -n "$BLOCK_SIZE" ]; then
OPT="$OPT -b $BLOCK_SIZE"
fi
+if [ -n "$COMPRESS_THRESHOLD" ]; then
+ OPT="$OPT -t $COMPRESS_THRESHOLD"
+fi
MAKE_SQUASHFS_CMD="mksquashfs $SRC_DIR/ $OUTPUT_FILE -no-progress -comp $COMPRESSOR $COMPRESSOR_OPT -no-exports -noappend -no-recovery -android-fs-config -no-fragments $OPT"
echo $MAKE_SQUASHFS_CMD