diff options
author | Robin Hsu <robinhsu@google.com> | 2020-11-03 15:36:08 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@google.com> | 2020-12-07 16:29:35 -0800 |
commit | 25d59fe85285e52f3b4d0c0c1f08d5592f1eacac (patch) | |
tree | 2af60bc67d52965b71cb404357e0a6a56635c427 /f2fs_utils | |
parent | 68e4c2e4c14db757be1bad8c2f088156d7814be4 (diff) | |
download | extras-25d59fe85285e52f3b4d0c0c1f08d5592f1eacac.tar.gz |
Enable system partition compression
* Prerequisites: external/f2fs-tools: sload compression support
* Must work with corresponding changes in 'build' repository
* If Board config does not change, it falls back to old behavior,
i.e. no compression for the system partition
* Kernel f2fs compression support is a prerequisite if the Board config
enables the compression (see below)
* Necessary board config changes: please refers to the commit message
for the corresponding 'Enable system partition compression' commit
in build/make repository
Bug: 170918499
Test: Pixel4a userdebug build (from build id 6918751)
Signed-off-by: Robin Hsu <robinhsu@google.com>
Change-Id: I253018e939e0a5c8605b91c04e29863607fac700
Diffstat (limited to 'f2fs_utils')
-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 |