Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../lib/dracut/modules..../90dm
File: dm-shutdown.sh
#!/bin/sh
[0] Fix | Delete
[1] Fix | Delete
_remove_dm() {
[2] Fix | Delete
local dev=$1
[3] Fix | Delete
local s
[4] Fix | Delete
local devname
[5] Fix | Delete
[6] Fix | Delete
for s in /sys/block/${dev}/holders/dm-* ; do
[7] Fix | Delete
[ -e ${s} ] || continue
[8] Fix | Delete
_remove_dm ${s##*/}
[9] Fix | Delete
done
[10] Fix | Delete
# multipath devices might have MD devices on top,
[11] Fix | Delete
# which are removed after this script. So do not
[12] Fix | Delete
# remove those to avoid spurious errors
[13] Fix | Delete
case $(cat /sys/block/${dev}/dm/uuid) in
[14] Fix | Delete
mpath-*)
[15] Fix | Delete
return 0
[16] Fix | Delete
;;
[17] Fix | Delete
*)
[18] Fix | Delete
devname=$(cat /sys/block/${dev}/dm/name)
[19] Fix | Delete
dmsetup -v --noudevsync remove "$devname" || return $?
[20] Fix | Delete
;;
[21] Fix | Delete
esac
[22] Fix | Delete
return 0
[23] Fix | Delete
}
[24] Fix | Delete
[25] Fix | Delete
_do_dm_shutdown() {
[26] Fix | Delete
local ret=0
[27] Fix | Delete
local final=$1
[28] Fix | Delete
local dev
[29] Fix | Delete
[30] Fix | Delete
info "Disassembling device-mapper devices"
[31] Fix | Delete
for dev in /sys/block/dm-* ; do
[32] Fix | Delete
[ -e ${dev} ] || continue
[33] Fix | Delete
if [ "x$final" != "x" ]; then
[34] Fix | Delete
_remove_dm ${dev##*/} || ret=$?
[35] Fix | Delete
else
[36] Fix | Delete
_remove_dm ${dev##*/} >/dev/null 2>&1 || ret=$?
[37] Fix | Delete
fi
[38] Fix | Delete
done
[39] Fix | Delete
if [ "x$final" != "x" ]; then
[40] Fix | Delete
info "dmsetup ls --tree"
[41] Fix | Delete
dmsetup ls --tree 2>&1 | vinfo
[42] Fix | Delete
fi
[43] Fix | Delete
return $ret
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
if command -v dmsetup >/dev/null &&
[47] Fix | Delete
[ "x$(dmsetup status)" != "xNo devices found" ]; then
[48] Fix | Delete
_do_dm_shutdown $1
[49] Fix | Delete
else
[50] Fix | Delete
:
[51] Fix | Delete
fi
[52] Fix | Delete
[53] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function