diff options
author | Ben Fennema <fennema@google.com> | 2017-03-08 14:21:00 -0800 |
---|---|---|
committer | Ben Fennema <fennema@google.com> | 2017-03-08 14:54:26 -0800 |
commit | 2265052af9236855f09e1b301288b066e1604dd5 (patch) | |
tree | 7d02007ff6434d931767aba70d77918c387160b3 | |
parent | 2083957eb18220a9f96e5d3ec9ca1af7b754b148 (diff) | |
download | extras-2265052af9236855f09e1b301288b066e1604dd5.tar.gz |
mkuserimg_mke2fs: fix empty -E to mke2fs and empty -S to e2fsdroid
not passing in -s caused a -E to be passed to mke2fs without any options
not passing in FILE_CONTEXTS caused a -S to be passed to e2fsdroid
without a file
Test: build oem image (doesn't pass in -s or [FILE_CONTEXTS])
Change-Id: Id00ca79b6b5fdc75e603ab568d74f1a183f8e56b
Signed-off-by: Ben Fennema <fennema@google.com>
-rwxr-xr-x | ext4_utils/mkuserimg_mke2fs.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/ext4_utils/mkuserimg_mke2fs.sh b/ext4_utils/mkuserimg_mke2fs.sh index e6fca455..7d5d2e35 100755 --- a/ext4_utils/mkuserimg_mke2fs.sh +++ b/ext4_utils/mkuserimg_mke2fs.sh @@ -95,7 +95,7 @@ if [[ "$1" == "-i" ]]; then fi if [[ "$1" == "-e" ]]; then - if [[ MKE2FS_EXTENDED_OPTS ]]; then + if [[ $MKE2FS_EXTENDED_OPTS ]]; then MKE2FS_EXTENDED_OPTS+="," fi MKE2FS_EXTENDED_OPTS+="stripe_width=$(($2/BLOCKSIZE))" @@ -103,7 +103,7 @@ if [[ "$1" == "-e" ]]; then fi if [[ "$1" == "-o" ]]; then - if [[ MKE2FS_EXTENDED_OPTS ]]; then + if [[ $MKE2FS_EXTENDED_OPTS ]]; then MKE2FS_EXTENDED_OPTS+="," fi # stride should be the max of 8kb and the logical block size @@ -111,11 +111,13 @@ if [[ "$1" == "-o" ]]; then shift; shift fi -if [[ MKE2FS_EXTENDED_OPTS ]]; then +if [[ $MKE2FS_EXTENDED_OPTS ]]; then MKE2FS_OPTS+=" -E $MKE2FS_EXTENDED_OPTS" fi -E2FSDROID_OPTS+=" -S $1" +if [[ $1 ]]; then + E2FSDROID_OPTS+=" -S $1" +fi case $EXT_VARIANT in ext4) ;; |