]> git.ipfire.org Git - thirdparty/dracut.git/blob - modules.d/90mdraid/parse-md.sh
removed trailing whitespaces
[thirdparty/dracut.git] / modules.d / 90mdraid / parse-md.sh
1 #!/bin/sh
2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
4 if ! getargbool 1 rd.md -n rd_NO_MD; then
5 info "rd.md=0: removing MD RAID activation"
6 udevproperty rd_NO_MD=1
7 else
8 MD_UUID=$(getargs rd.md.uuid rd_MD_UUID=)
9
10 # rewrite the md rules to only process the specified raid array
11 if [ -n "$MD_UUID" ]; then
12 for f in /etc/udev/rules.d/65-md-incremental*.rules; do
13 [ -e "$f" ] || continue
14 while read line; do
15 if [ "${line%%UUID CHECK}" != "$line" ]; then
16 for uuid in $MD_UUID; do
17 printf 'ENV{MD_UUID}=="%s", GOTO="do_md_inc"\n' $uuid
18 done;
19 printf 'GOTO="md_inc_end"\n';
20 else
21 echo $line;
22 fi
23 done < "${f}" > "${f}.new"
24 mv "${f}.new" "$f"
25 done
26 fi
27 fi
28
29
30 if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
31 udevproperty rd_MDADMCONF=1
32 rm -f $hookdir/pre-pivot/*mdraid-cleanup.sh
33 fi
34
35 if ! getargbool 1 rd.md.conf -n rd_NO_MDADMCONF; then
36 rm -f /etc/mdadm/mdadm.conf /etc/mdadm.conf
37 fi
38
39 # noiswmd nodmraid for anaconda / rc.sysinit compatibility
40 # note nodmraid really means nobiosraid, so we don't want MDIMSM then either
41 if ! getargbool 1 rd.md.imsm -n rd_NO_MDIMSM || getarg noiswmd || getarg nodmraid; then
42 info "no MD RAID for imsm/isw raids"
43 udevproperty rd_NO_MDIMSM=1
44 fi