From f063d8c7061c9ce7af3cf5e470745b08fda5bfaa Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Tue, 30 May 2017 11:04:28 +0200 Subject: fix bug in fripost_mdadm_create. --- src/fripost-partman-udeb/base.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fripost-partman-udeb/base.sh b/src/fripost-partman-udeb/base.sh index f58d457..329bd35 100644 --- a/src/fripost-partman-udeb/base.sh +++ b/src/fripost-partman-udeb/base.sh @@ -651,16 +651,17 @@ fripost_mdadm_create() { /sbin/mdadm --create "$md" "$@" wait_for_device "$md" - device=$(/usr/bin/readlink -f "$md") - device="${device#/dev/}" + #device=$(/usr/bin/readlink -f "$md") + device="${md#/dev/}" level=$(sed -nr "/^$device\s*:/ s/.*:\s*active (\S+) .*/\1/p" /proc/mdstat) devices=$(sed -nr "/^$device\s*:/ s/.*:\s*active \S+ //p" /proc/mdstat) size=$(sed -nr "/^$device\s*:/ {n; s/^\s*([0-9]+)\s+blocks\s.*/\1/p}" /proc/mdstat) info=$(sed -nr "/^$device\s*:/ {n; s/^.*\s(super\s.*)/\1/p}" /proc/mdstat) - if ! [ "$level" -a "$devices" -a "$size" -a "$info" ] && [ $size -gt 0 ]; then + if ! [ "$level" -a "$devices" -a "$size" ] && [ $size -gt 0 ]; then log < /proc/mdstat - fail "Couldn't find entry $device ($md) in /proc/mdstat" + echo "Couldn't find entry $device ($md) in /proc/mdstat" >&2 + exit 1 fi db_subst fripost/mdadm_create_progress_title MD "$md" -- cgit v1.2.3