From a2b37feaf807b0c8773d41a4157d733328557386 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 1 Jul 2022 11:41:43 +0200 Subject: setup-disk: exit if either mode or disk is 'none' --- setup-disk.in | 4 +++- 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 +} + -- cgit v1.2.3