diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-01 11:41:43 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-01 10:15:32 +0000 |
commit | a2b37feaf807b0c8773d41a4157d733328557386 (patch) | |
tree | 4d988bc1c17f296c5584f9ae05bc9a07bdf8681b | |
parent | 4ad15542bc927c47ad0b56e7ee03d2b711448e39 (diff) | |
download | alpine-conf-a2b37feaf807b0c8773d41a4157d733328557386.zip |
setup-disk: exit if either mode or disk is 'none'
-rw-r--r-- | setup-disk.in | 4 | ||||
-rwxr-xr-x | tests/setup_disk_test | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/setup-disk.in b/setup-disk.in index f9306c0..54f078f 100644 --- a/setup-disk.in +++ b/setup-disk.in @@ -1468,7 +1468,9 @@ while getopts "hek:Lm:o:qrs:v" opt; do done shift $(( $OPTIND - 1)) -[ "$DISK_MODE" = "none" ] && exit 0 +if [ "$DISK_MODE" = "none" ] || [ "$1" = "none" ]; then + exit 0 +fi if is_rpi; then : ${BOOTLOADER:=raspberrypi-bootloader} diff --git a/tests/setup_disk_test b/tests/setup_disk_test index 1cba3e4..c3af040 100755 --- a/tests/setup_disk_test +++ b/tests/setup_disk_test @@ -2,15 +2,23 @@ . $(atf_get_srcdir)/test_env.sh init_tests \ - setup_disk_usage + setup_disk_usage \ + setup_disk_mode_none \ + setup_disk_none \ setup_disk_usage_body() { test_usage setup-disk } -setup_disk_usage_body() { +setup_disk_mode_none_body() { init_env atf_check -s exit:0 \ setup-disk -m none } +setup_disk_none_body() { + init_env + atf_check -s exit:0 \ + setup-disk none +} + |