mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-05-05 12:26:52 +02:00
parent
fbb1a8ef5b
commit
5ffd9b46d6
@ -2,7 +2,7 @@
|
||||
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
||||
pkgname=mdadm
|
||||
pkgver=3.1.1
|
||||
pkgrel=0
|
||||
pkgrel=1
|
||||
pkgdesc="a tool for managing Linux Software RAID arrays"
|
||||
url="http://neil.brown.name/blog/mdadm"
|
||||
license="GPL-2"
|
||||
@ -35,5 +35,5 @@ package() {
|
||||
md5sums="8bfeea282d21b5ef8e825122fb359457 mdadm-3.1.1.tar.gz
|
||||
ce57e798431f7ab89f9b07a7daaa4852 mdadm.initd
|
||||
16d2b8eb2e17184357db503470fdd8eb mdadm.confd
|
||||
cf60ee08fc4fbed0450c5a2d4efc4214 mdadm-raid.initd
|
||||
974e3496d2e4b7c9c17c3279388f45ae mdadm-raid.initd
|
||||
aa601f072096fb8bae8b8946f59a561f mdadm-uclibc.patch"
|
||||
|
||||
@ -1,19 +1,42 @@
|
||||
#!/sbin/runscript
|
||||
|
||||
# script to start raid devices described in /etc/mdadm.conf.
|
||||
depend() {
|
||||
before checkfs fsck
|
||||
after modules
|
||||
}
|
||||
|
||||
start() {
|
||||
[ -f /etc/mdadm.conf ] || return 0
|
||||
# start all devices that are not already started
|
||||
[ -f /proc/mdstat ] || modprobe -k md > /dev/null 2>&1
|
||||
local tostart=
|
||||
ebegin "Starting RAID devices"
|
||||
mdadm -A -s -q
|
||||
for i in $(awk '{print $2}' /etc/mdadm.conf); do
|
||||
[ -b "$i" ] && continue
|
||||
tostart="$tostart $i"
|
||||
done
|
||||
mdadm --assemble --scan --quiet $tostart
|
||||
eend $?
|
||||
}
|
||||
|
||||
stop() {
|
||||
# you need to make sure no device is mounted.
|
||||
if [ -f /etc/mdadm.conf ] ; then
|
||||
ebegin "Stopping RAID devices"
|
||||
mdadm --stop -q `awk '/^ARRAY/ { print $2 }' /etc/mdadm.conf`
|
||||
eend $?
|
||||
fi
|
||||
is_mounted_as() {
|
||||
local mnt
|
||||
for mnt in $(awk "\$1 == \"$1\" {print \$2}" /proc/mounts); do
|
||||
[ "$mnt" = "$2" ] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
stop() {
|
||||
# stop all raid devices except anything mounted as /
|
||||
[ -f /etc/mdadm.conf ] || return 0
|
||||
ebegin "Stopping RAID devices"
|
||||
local tostop=
|
||||
for i in $(awk '{print $2}' /etc/mdadm.conf); do
|
||||
is_mounted_as $i / && continue
|
||||
tostop="$tostop $i"
|
||||
done
|
||||
mdadm --stop --quiet $tostop
|
||||
eend $?
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user