From ee7608c28406bbbae45d87827c1b5f5523f08495 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 7 Apr 2011 14:21:42 +0000 Subject: setup-disk: explain that no disks was found unless -q (quiet) --- setup-disk.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/setup-disk.in b/setup-disk.in index 08c5e89..fd7c0e2 100644 --- a/setup-disk.in +++ b/setup-disk.in @@ -698,11 +698,12 @@ esac SWAP_SIZE=$(find_swap_size) # Parse args -while getopts "hk:o:rs:v" opt; do +while getopts "hk:o:qrs:v" opt; do case $opt in k) KERNEL_FLAVOR="$OPTARG";; - r) USE_RAID=1;; o) APKOVL="$OPTARG";; + q) QUIET=1;; + r) USE_RAID=1;; s) SWAP_SIZE="$OPTARG";; v) VERBOSE=1;; *) usage;; @@ -730,7 +731,10 @@ disks=$(find_disks) disk=none # no disks so lets exit quietly. -[ -z "$disks" ] && exit 0 +if [ -z "$disks" ]; then + [ -z "$QUIET" ] && echo "No disks found." >&2 + exit 0 +fi if [ $# -gt 0 ]; then # check that they are -- cgit v1.2.3