diff options
author | Daniel Rosenberg <drosen@google.com> | 2023-11-08 14:22:22 -0800 |
---|---|---|
committer | Daniel Rosenberg <drosen@google.com> | 2024-01-16 17:17:54 -0800 |
commit | cd9b3698a14aa71b8a295a39f5d1490b1204f2a7 (patch) | |
tree | 98e24a8174d409882104ee07f778975033b03c32 /f2fs_utils | |
parent | b258d2ee60222351b473a8420e59cbdc7910e255 (diff) | |
download | extras-cd9b3698a14aa71b8a295a39f5d1490b1204f2a7.tar.gz |
f2fs_utils: Add support for blocksize arguement
Adds -b option which is passed through to mkfs, allowing formatting for
different f2fs blocksizes.
Change-Id: I000cd5d1ae58786e562cc8226cacc1ac7ab5bc55
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 279820706
Test: Boot 16K device
Diffstat (limited to 'f2fs_utils')
-rwxr-xr-x | f2fs_utils/mkf2fsuserimg.sh | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/f2fs_utils/mkf2fsuserimg.sh b/f2fs_utils/mkf2fsuserimg.sh index e95a0c51..5ce0497e 100755 --- a/f2fs_utils/mkf2fsuserimg.sh +++ b/f2fs_utils/mkf2fsuserimg.sh @@ -9,7 +9,7 @@ ${0##*/} OUTPUT_FILE SIZE [-S] [-C FS_CONFIG] [-f SRC_DIR] [-D PRODUCT_OUT] [-s FILE_CONTEXTS] [-t MOUNT_POINT] [-T TIMESTAMP] [-B block_map] [-L LABEL] [--prjquota] [--casefold] [--compression] [--readonly] - [--sldc <num> [sload compression sub-options]] + [--sldc <num> [sload compression sub-options]] [-b <block_size>] <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. @@ -130,6 +130,19 @@ if [[ "$1" == "--sldc" ]]; then done fi +if [[ "$1" == "-b" ]]; then + shift + BLOCKSIZE=$1 + case $BLOCKSIZE in + ''|*[!0-9]*) + echo "-b needs a number" + exit 3 ;; + esac + shift + MKFS_OPTS += " -b $BLOCKSIZE" + MKFS_OPTS += " -w $BLOCKSIZE" +fi + if [ -z $SIZE ]; then echo "Need size of filesystem" exit 2 |