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>
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
}
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"
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