#!/bin/sh

# /usr/lib/setup/armedslack-nofscheck
# 
# On the ARM Versatile QEMU machine, there's no RTC (real time clock)
# which causes fsck checks on the system, which is undesirable
# because it keeps happening since there's no RTC!! 
#
# Stuart Winter, 12-Jan-2008.

FSTAB=/var/log/setup/tmp/SeTnative
if [ "$( grep ARM-Versatile /proc/cpuinfo )" != "" -a -s $FSTAB ]; then
   dialog --backtitle "ARM Versatile platform: skip fsck check" \
     --title "SKIP FSCK CHECKS ON QEMU ARM VERSATILE PLATFORM?" --yesno \
"The QEMU ARM emulator does not yet emulate a real time clock (RTC). \
This means that fsck checks will always run on bootup, and you may \
experience trouble booting the installation.  It is recommended to switch \
off fsck checks for all mounts in /etc/fstab until the emulator has \
RTC support. ARMedslack accomplishes this using 'tune2fs -i0'. \
\n\nWould you like to switch off fsck checks? " \
13 62

if [ $? = 0 ]; then
   # Switch off fsck checks.
   ( grep ^/ $FSTAB | awk '{print $1}' | while read part ; do
     echo "$part..." ; tune2fs -i0 $part
     done ) 2>&1 > /tmp/armedslack-tune2fs.debug
fi
fi

#EOF
