]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dracut-038-always-enable-mdraid.patch
ipsec-interfaces: Apply static routes (again) after creating IPsec interfaces
[ipfire-2.x.git] / src / patches / dracut-038-always-enable-mdraid.patch
CommitLineData
0a325292
MT
1diff --git a/modules.d/90mdraid/parse-md.sh b/modules.d/90mdraid/parse-md.sh
2index dd7bda2..7bc944c 100755
3--- a/modules.d/90mdraid/parse-md.sh
4+++ b/modules.d/90mdraid/parse-md.sh
5@@ -4,32 +4,26 @@
6
7 MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
8
9-if ( ! [ -n "$MD_UUID" ] && ! getargbool 0 rd.auto ) || ! getargbool 1 rd.md -d -n rd_NO_MD; then
10- info "rd.md=0: removing MD RAID activation"
11- udevproperty rd_NO_MD=1
12-else
13- # rewrite the md rules to only process the specified raid array
14- if [ -n "$MD_UUID" ]; then
15- for f in /etc/udev/rules.d/65-md-incremental*.rules; do
16- [ -e "$f" ] || continue
17- while read line; do
18- if [ "${line%%UUID CHECK}" != "$line" ]; then
19- printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
20- for uuid in $MD_UUID; do
21- printf 'ENV{MD_UUID}=="%s", GOTO="md_uuid_ok"\n' $uuid
22- done;
23- printf 'GOTO="md_end"\n'
24- printf 'LABEL="md_uuid_ok"\n'
25- else
26- echo "$line"
27- fi
28- done < "${f}" > "${f}.new"
29- mv "${f}.new" "$f"
30- done
31- fi
32+# rewrite the md rules to only process the specified raid array
33+if [ -n "$MD_UUID" ]; then
34+ for f in /etc/udev/rules.d/65-md-incremental*.rules; do
35+ [ -e "$f" ] || continue
36+ while read line; do
37+ if [ "${line%%UUID CHECK}" != "$line" ]; then
38+ printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
39+ for uuid in $MD_UUID; do
40+ printf 'ENV{MD_UUID}=="%s", GOTO="md_uuid_ok"\n' $uuid
41+ done;
42+ printf 'GOTO="md_end"\n'
43+ printf 'LABEL="md_uuid_ok"\n'
44+ else
45+ echo "$line"
46+ fi
47+ done < "${f}" > "${f}.new"
48+ mv "${f}.new" "$f"
49+ done
50 fi
51
52-
53 if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then
54 udevproperty rd_MDADMCONF=1
55 rm -f -- $hookdir/pre-pivot/*mdraid-cleanup.sh