diff options
author | Jaegeuk Kim <jaegeuk@google.com> | 2020-12-10 00:41:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2020-12-10 00:41:04 +0000 |
commit | c8fe22b3d318fad84e5a038e1b0fc92b46196125 (patch) | |
tree | 117132c4bb2faeb3199b275965d2cef076e2b53c | |
parent | bcc60f2a261b4349c34429c3ab56ed8c52bab387 (diff) | |
parent | 25d59fe85285e52f3b4d0c0c1f08d5592f1eacac (diff) | |
download | extras-c8fe22b3d318fad84e5a038e1b0fc92b46196125.tar.gz |
Merge "Enable system partition compression"
-rwxr-xr-x | f2fs_utils/mkf2fsuserimg.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/f2fs_utils/mkf2fsuserimg.sh b/f2fs_utils/mkf2fsuserimg.sh index 827594ce..522f9ea4 100755 --- a/f2fs_utils/mkf2fsuserimg.sh +++ b/f2fs_utils/mkf2fsuserimg.sh @@ -9,6 +9,11 @@ ${0##*/} OUTPUT_FILE SIZE [-S] [-C FS_CONFIG] [-f SRC_DIR] [-D PRODUCT_OUT] [-s FILE_CONTEXTS] [-t MOUNT_POINT] [-T TIMESTAMP] [-L LABEL] [--prjquota] [--casefold] [--compression] + [--sldc <num> [sload compression sub-options]] +<num>: number of the sload compression args, e.g. -a LZ4 counts as 2 + when sload compression args are not given, <num> must be 0, + and the default flags will be used. +Note: must conserve the option order EOT } @@ -86,10 +91,32 @@ if [[ "$1" == "--casefold" ]]; then fi if [[ "$1" == "--compression" ]]; then + COMPRESS_SUPPORT=1 MKFS_OPTS+=" -O compression,extra_attr" shift; fi +if [[ "$1" == "--sldc" ]]; then + if [ -z "$COMPRESS_SUPPORT" ]; then + echo "--sldc needs --compression flag" + exit 3 + fi + SLOAD_OPTS+=" -c" + shift + SLDC_NUM_ARGS=$1 + case $SLDC_NUM_ARGS in + ''|*[!0-9]*) + echo "--sldc needs a number" + exit 3 ;; + esac + shift + while [ $SLDC_NUM_ARGS -gt 0 ]; do + SLOAD_OPTS+=" $1" + shift + (( SLDC_NUM_ARGS-- )) + done +fi + if [ -z $SIZE ]; then echo "Need size of filesystem" exit 2 |