aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2017-05-30 11:04:28 +0200
committerGuilhem Moulin <guilhem@fripost.org>2017-05-30 11:04:28 +0200
commitf063d8c7061c9ce7af3cf5e470745b08fda5bfaa (patch)
tree66c98501adeb68fee40105723ea6e638436b80d8 /src
parent5c6d2a48f57a8a538274d2939015641a1755da24 (diff)
fix bug in fripost_mdadm_create.
Diffstat (limited to 'src')
-rw-r--r--src/fripost-partman-udeb/base.sh9
1 files 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"