]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
Fix checkfstab script not correct detect current rootdevice
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 23 Jul 2008 18:53:51 +0000 (20:53 +0200)
committerArne Fitzenreiter <arne_f@ipfire.org>
Wed, 23 Jul 2008 18:53:51 +0000 (20:53 +0200)
src/initscripts/init.d/checkfstab

index 0ccf593d994bfa1fb86290670f1bce8d2a9c0630..5aab8690b225b1fd2e27101902aedad71695ca2e 100644 (file)
@@ -18,8 +18,9 @@
 case "${1}" in
        start)
                boot_mesg "Checking fstab rootdevice entry ..."
-               OLDROOT=`cat /etc/fstab | grep " / " | cut -d" " -f1`;
-               NEWROOT=`df | grep " /$" -m1 | cut -d" " -f1`;
+               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}
                NEWDRV=${NEWROOT::`expr length $NEWROOT`-1}
                if [ "$OLDROOT" == "$NEWROOT" ]; then