=== modified file 'zsh-functions/confz_fs_init' --- zsh-functions/confz_fs_init 2015-04-20 13:29:55 +0000 +++ zsh-functions/confz_fs_init 2015-04-20 13:11:49 +0000 @@ -138,7 +138,7 @@ # set up /dev/md* device confz_mdraid_check() { - local level out seen_level seen_header devices all_empty + local level out seen_level seen_header devices present local -a seen_devices devices local -A level_map @@ -199,18 +199,18 @@ return 0 fi - all_empty=1 for device in $devices; do - # all devices either need to have empty labels or be linux_raid_member fs_blkid_probe $device + (( $+present )) || present=$fs_blkid_result + [[ $present != $fs_blkid_result ]] || \ + die "$0: only some devices present" if ! (($fs_blkid_result)); then [[ ${fs_blkid_output[TYPE]:-} == linux_raid_member ]] || \ die "$0: non-raid label present on device: ${(qqq)device}" - all_empty=0 fi done - if (($all_empty)); then + if (($present)); then # empty labels do_command=( mdadm --create -l $level --metadata=$vars[metadata] -n $#devices $vars[md_device] $devices ) else