]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/initscripts/init.d/checkfstab
Skip checkfstab if root is set by UUID.
[people/pmueller/ipfire-2.x.git] / src / initscripts / init.d / checkfstab
index 5aab8690b225b1fd2e27101902aedad71695ca2e..2fe80bf31db1599c39fa1a913fe7a8f775bc3682 100644 (file)
 
 case "${1}" in
        start)
-               boot_mesg "Checking fstab rootdevice entry ..."
+               #Skip if root is set by UUID
+               if (grep "root=UUID=" /proc/cmdline); then
+                       exit 0;
+               fi
+               boot_mesg "Checking fstab bootdevice ..."
+               read CMDLINE < /proc/cmdline
                ROOTPOS=`expr index "$CMDLINE" root=`
                NEWROOT=`echo ${CMDLINE:$ROOTPOS} | cut -d"=" -f2 | cut -d" " -f1`;
-               OLDROOT=`cat /etc/fstab | grep -m1 " / " | cut -d" " -f1`;
-               OLDDRV=${OLDROOT::`expr length $OLDROOT`-1}
+               OLDBOOT=`cat /etc/fstab | grep -m1 "/boot" | cut -d" " -f1 | cut -f1`;
+               OLDDRV=${OLDBOOT::`expr length $OLDBOOT`-1}
                NEWDRV=${NEWROOT::`expr length $NEWROOT`-1}
-               if [ "$OLDROOT" == "$NEWROOT" ]; then
+               if [ "$OLDDRV" == "$NEWDRV" ]; then
                    echo_ok;
                    exit 0;
                fi
                echo_failure;
-               boot_mesg "Warning! Rootdevice not match with fstab entry!"
+               boot_mesg "Warning! Bootdrive not match with fstab!"
                boot_mesg
-               boot_mesg "Rootdevice:  $NEWROOT"
-               boot_mesg "fstab-entry: $OLDROOT"
+               boot_mesg "Bootdrive:   $NEWDRV"
+               boot_mesg "fstab-entry: $OLDDRV"
                boot_mesg
                boot_mesg "Attempt to repair it ..."
                mount -o remount,rw /