core updated.

This commit is contained in:
Ertuğrul Erata
2015-05-17 16:28:10 +03:00
parent 14d58aa1d0
commit 8e13c775be
558 changed files with 543408 additions and 27657 deletions
@@ -0,0 +1,6 @@
#!/bin/bash
for dev in `grep "^md.*: active" /proc/mdstat | cut -f 1 -d ' '`; do
echo "repair" > /sys/block/$dev/md/sync_action
done
@@ -0,0 +1,29 @@
[[ -f /proc/mdstat ]] || exit 0
# Try to make sure the devices exist before we use them
create_devs() {
local node dir minor
for node in $@ ; do
[[ ${node} != /dev/* ]] && node=/dev/${node}
[[ -e ${node} ]] && continue
dir=${node%/*}
[[ ! -d ${dir} ]] && mkdir -p "${dir}"
minor=${node##*/}
mknod "${node}" b ${MAJOR} ${minor##*md} &> /dev/null
done
}
[[ -e /etc/mdadm.conf ]] && mdadm_conf="/etc/mdadm.conf"
if [[ -x /sbin/mdadm && -f ${mdadm_conf} ]] ; then
devs=$(awk '/^[[:space:]]*ARRAY/ { print $2 }' ${mdadm_conf})
if [[ -n ${devs} ]] ; then
create_devs ${devs}
ebegin "Starting up RAID devices (mdadm)"
output=$(mdadm -As 2>&1)
ret=$?
[[ ${ret} -ne 0 ]] && echo "${output}"
eend ${ret}
fi
fi
@@ -0,0 +1,10 @@
[[ -f /proc/mdstat ]] || exit 0
[[ -e /etc/mdadm.conf ]] && mdadm_conf="/etc/mdadm.conf"
if [[ -x /sbin/mdadm && -f ${mdadm_conf} ]] ; then
ebegin "Shutting down RAID devices (mdadm)"
output=$(mdadm -Ss 2>&1)
ret=$?
[[ ${ret} -ne 0 ]] && echo "${output}"
eend ${ret}
fi