slitaz-boot-scripts rev 452
init: assemble all the raid devices
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Feb 04 11:56:15 2019 +0100 (2019-02-04) |
parents | 161b43b7365c |
children | d6f110850f61 |
files | init |
line diff
1.1 --- a/init Tue Jun 05 20:27:54 2018 +0200 1.2 +++ b/init Mon Feb 04 11:56:15 2019 +0100 1.3 @@ -222,10 +222,17 @@ 1.4 [ "$raiddev" ] && echo "$raiddev" >> /etc/mdadm.conf 1.5 [ "$raidmail" ] && echo "$raidmail" >> /etc/mdadm.conf 1.6 grep level=raid /etc/mdadm.conf | ldraid 1.7 + udevd --daemon 1.8 + udevadm trigger 1.9 + udevadm settle 1.10 for i in 1 2 3 4 5 6 7 8 9; do 1.11 sleep $i 1.12 mdadm -A -s 1.13 - grep -qs "^$(basename $root) : act" /proc/mdstat && break 1.14 + for j in $(sed '/\/md/!d;s|.*md/*\([0-9]*\).*|md\1|' \ 1.15 + /etc/mdadm.conf); do 1.16 + grep -qs "$j : act" /proc/mdstat || continue 2 1.17 + done 1.18 + break 1.19 done 1.20 grep -qs "^$(basename $root) : act" /proc/mdstat || 1.21 root=$(awk '/^md/ { print "/dev/" $1; exit }' < /proc/mdstat)