From 8168820fa384b98bbc91689af2b668079a84ec65 Mon Sep 17 00:00:00 2001 From: kueller Date: Mon, 11 Oct 2010 07:15:55 +0000 Subject: [PATCH] =?UTF-8?q?Ausf=C3=BChrung=20der=20Mounts=20pro=20Ebene=20?= =?UTF-8?q?parallelisiert=20(nicht=20mehr=20mit=20mount=20-a)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_upstart@5835 504e572c-2e33-0410-9681-be2bf7408885 --- etc/init/mountfs.conf | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/etc/init/mountfs.conf b/etc/init/mountfs.conf index 3d52ca4..165f82d 100644 --- a/etc/init/mountfs.conf +++ b/etc/init/mountfs.conf @@ -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