Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/dracut/modules..../90mdraid
File: parse-md.sh
#!/bin/sh
[0] Fix | Delete
[1] Fix | Delete
MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=)
[2] Fix | Delete
# normalize the uuid
[3] Fix | Delete
MD_UUID=$(str_replace "$MD_UUID" "-" "")
[4] Fix | Delete
MD_UUID=$(str_replace "$MD_UUID" ":" "")
[5] Fix | Delete
[6] Fix | Delete
if ( ! [ -n "$MD_UUID" ] && ! getargbool 0 rd.auto ) || ! getargbool 1 rd.md -d -n rd_NO_MD; then
[7] Fix | Delete
info "rd.md=0: removing MD RAID activation"
[8] Fix | Delete
udevproperty rd_NO_MD=1
[9] Fix | Delete
else
[10] Fix | Delete
# rewrite the md rules to only process the specified raid array
[11] Fix | Delete
if [ -n "$MD_UUID" ]; then
[12] Fix | Delete
for f in /etc/udev/rules.d/65-md-incremental*.rules; do
[13] Fix | Delete
[ -e "$f" ] || continue
[14] Fix | Delete
while read line || [ -n "$line" ]; do
[15] Fix | Delete
if [ "${line%%UUID CHECK}" != "$line" ]; then
[16] Fix | Delete
for uuid in $MD_UUID; do
[17] Fix | Delete
printf 'ENV{ID_FS_UUID}=="%s", GOTO="md_uuid_ok"\n' "$(expr substr $uuid 1 8)-$(expr substr $uuid 9 4)-$(expr substr $uuid 13 4)-$(expr substr $uuid 17 4)-$(expr substr $uuid 21 12)"
[18] Fix | Delete
done;
[19] Fix | Delete
printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n'
[20] Fix | Delete
for uuid in $MD_UUID; do
[21] Fix | Delete
printf 'ENV{MD_UUID}=="%s", GOTO="md_uuid_ok"\n' "$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)"
[22] Fix | Delete
done;
[23] Fix | Delete
printf 'GOTO="md_end"\n'
[24] Fix | Delete
printf 'LABEL="md_uuid_ok"\n'
[25] Fix | Delete
else
[26] Fix | Delete
echo "$line"
[27] Fix | Delete
fi
[28] Fix | Delete
done < "${f}" > "${f}.new"
[29] Fix | Delete
mv "${f}.new" "$f"
[30] Fix | Delete
done
[31] Fix | Delete
for uuid in $MD_UUID; do
[32] Fix | Delete
uuid="$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)"
[33] Fix | Delete
wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}"
[34] Fix | Delete
done
[35] Fix | Delete
fi
[36] Fix | Delete
fi
[37] Fix | Delete
[38] Fix | Delete
[39] Fix | Delete
if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then
[40] Fix | Delete
udevproperty rd_MDADMCONF=1
[41] Fix | Delete
rm -f -- $hookdir/pre-pivot/*mdraid-cleanup.sh
[42] Fix | Delete
fi
[43] Fix | Delete
[44] Fix | Delete
if ! getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then
[45] Fix | Delete
rm -f -- /etc/mdadm/mdadm.conf /etc/mdadm.conf
[46] Fix | Delete
ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null
[47] Fix | Delete
fi
[48] Fix | Delete
[49] Fix | Delete
# noiswmd nodmraid for anaconda / rc.sysinit compatibility
[50] Fix | Delete
# note nodmraid really means nobiosraid, so we don't want MDIMSM then either
[51] Fix | Delete
if ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd -n nodmraid; then
[52] Fix | Delete
info "no MD RAID for imsm/isw raids"
[53] Fix | Delete
udevproperty rd_NO_MDIMSM=1
[54] Fix | Delete
fi
[55] Fix | Delete
[56] Fix | Delete
# same thing with ddf containers
[57] Fix | Delete
if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd -n nodmraid; then
[58] Fix | Delete
info "no MD RAID for SNIA ddf raids"
[59] Fix | Delete
udevproperty rd_NO_MDDDF=1
[60] Fix | Delete
fi
[61] Fix | Delete
[62] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function