summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2022-07-01 11:41:43 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2022-07-01 10:15:32 +0000
commita2b37feaf807b0c8773d41a4157d733328557386 (patch)
tree4d988bc1c17f296c5584f9ae05bc9a07bdf8681b
parent4ad15542bc927c47ad0b56e7ee03d2b711448e39 (diff)
downloadalpine-conf-a2b37feaf807b0c8773d41a4157d733328557386.zip
setup-disk: exit if either mode or disk is 'none'
-rw-r--r--setup-disk.in4
-rwxr-xr-xtests/setup_disk_test12
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
+}
+