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