#etc/rc.d/init.d/applejuice
etc/rc.d/init.d/beep
etc/rc.d/init.d/checkfs
+etc/rc.d/init.d/checkfstab
#etc/rc.d/init.d/clamav
etc/rc.d/init.d/cleanfs
etc/rc.d/init.d/connectd
etc/rc.d/rcsysinit.d/S00mountkernfs
etc/rc.d/rcsysinit.d/S05modules
etc/rc.d/rcsysinit.d/S10udev
+etc/rc.d/rcsysinit.d/S19checkfstab
etc/rc.d/rcsysinit.d/S20swap
etc/rc.d/rcsysinit.d/S30checkfs
etc/rc.d/rcsysinit.d/S40mountfs
ln -sf ../init.d/mountkernfs /etc/rc.d/rcsysinit.d/S00mountkernfs
ln -sf ../init.d/modules /etc/rc.d/rcsysinit.d/S05modules
ln -sf ../init.d/udev /etc/rc.d/rcsysinit.d/S10udev
+ ln -sf ../init.d/checkfstab /etc/rc.d/rcsysinit.d/S19checkfstab
ln -sf ../init.d/swap /etc/rc.d/rcsysinit.d/S20swap
ln -sf ../init.d/checkfs /etc/rc.d/rcsysinit.d/S30checkfs
ln -sf ../init.d/mountfs /etc/rc.d/rcsysinit.d/S40mountfs
--- /dev/null
+#!/bin/sh
+########################################################################
+# Begin $rc_base/init.d/checkfstab
+#
+# Description : Check and repair fstab if the drivename has changed
+#
+# Authors : Arne Fitzenreiter - arne_f@ipfire.org
+#
+# Version : 00.00
+#
+# Notes :
+#
+########################################################################
+
+. /etc/sysconfig/rc
+. ${rc_functions}
+
+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`;
+ OLDDRV=${OLDROOT::`expr length $OLDROOT`-1}
+ NEWDRV=${NEWROOT::`expr length $NEWROOT`-1}
+ if [ "$OLDROOT" == "$NEWROOT" ]; then
+ echo_ok;
+ exit 0;
+ fi
+ echo_failure;
+ boot_mesg "Warning! Rootdevice not match with fstab entry!"
+ boot_mesg
+ boot_mesg "Rootdevice: $NEWROOT"
+ boot_mesg "fstab-entry: $OLDROOT"
+ boot_mesg
+ boot_mesg "Attempt to repair it ..."
+ mount -o remount,rw /
+ sed -i -e "s|$OLDDRV|$NEWDRV|g" /etc/fstab
+ mount /boot
+ sed -i -e "s|$OLDDRV|$NEWDRV|g" /boot/grub/grub.conf
+ umount /boot
+ echo_ok;
+ exit 0;
+ ;;
+ *)
+ echo "Usage: ${0} {start}"
+ exit 1
+ ;;
+esac
+
+# End $rc_base/init.d/checkfstab