Ausführung der Mounts pro Ebene parallelisiert (nicht mehr mit mount -a)

git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_upstart@5835 504e572c-2e33-0410-9681-be2bf7408885
This commit is contained in:
kueller 2010-10-11 07:15:55 +00:00
parent 1838f1085b
commit 8168820fa3

View File

@ -13,21 +13,32 @@ script
/bin/rm -f /fastboot /forcefsck
/sbin/swapon -a
status_message "Swap Aktivated"
for i in `sed -e "/^#/d" /etc/fstab|awk '{print $2}'`; do
MOUNTPOINT=$i
FILESYSTEM=`awk '{if( $2 == "'$MOUNTPOINT'") print $3}' /etc/fstab`
DEVICE=`awk '{if( $2 == "'$MOUNTPOINT'") print $1}' /etc/fstab`
if [ ! "$FILESYSTEM" == "nfs" ] \
&& [ ! "$FILESYSTEM" == "swap" ] \
&& [ ! "$MOUNTPOINT" == "/" ] \
&& [ ! "$DEVICE" == "none" ]; then
if [ -d $MOUNTPOINT ]; then
mount $MOUNTPOINT
status_message "Mount of $MOUNTPOINT"
else
echo -n "Mountpoint $MOUNTPOINT not existing!"
POINTS=`sed -e "/^#/d" -e "/^$/d" /etc/fstab|\
awk '{if ( ( $2 != "/" ) && \
( $3 != "swap" ) && \
( $3 != "nfs" ) ) print $2 }'`
Do_Mount=1
FOUND=0
MP_DEPTH=1
while [ $Do_Mount -eq 1 ]; do
for i in $POINTS; do
DEPTH=`echo $i|awk -F"/" '{print NF-1}'`
if [ $DEPTH == $MP_DEPTH ]; then
if [ ! -d $i ]; then
mkdir -p $i
fi
mount $i &
status_message "Mount of $i"
FOUND=1
fi
done
wait `pgrep /bin/mount`
if [ $FOUND -eq 0 ]; then
Do_Mount=0
else
FOUND=0
(( MP_DEPTH++ ))
fi
fi
done
/sbin/ldconfig
end script