Commit 71fa047717f0a5321c04e273a1037986b89e570e

Authored by Silvan Calarco
1 parent 773585feb7
Exists in master

checkfs: don't check root filesystem if it was already done in initramfs

Showing 1 changed file with 20 additions and 22 deletions Side-by-side Diff

etc/rc.d/init.d/checkfs
... ... @@ -13,37 +13,35 @@
13 13 exit 0
14 14 fi
15 15  
16   -echo -n "Mounting root file system in read-only mode: "
17   -mount -n -o remount,ro /
18   -retval=$?
  16 +echo -n "Checking file systems: "
  17 +$PLYMOUTH message --text=$"Checking file systems..."
19 18  
20   -if [ $retval != 0 ]; then
21   - $FAILURE
22   - echo
23   - echo "Cannot check root file system because it could not"
24   - echo "be mounted in read-only mode."
25   - echo
26   - echo -n "When you press enter, this system will be halted."
27   - $NORMAL
28   - echo
29   - echo "Press enter to continue..."
30   - read ans
31   - echo "gonna run: $rc_base/init.d/halt"
32   - $rc_base/init.d/halt
  19 +if [ ! -e /run/initramfs/root-fsck ]; then
  20 + echo -n "Mounting root file system in read-only mode: "
  21 + mount -n -o remount,ro /
  22 + retval=$?
  23 +
  24 + if [ $retval != 0 ]; then
  25 + $FAILURE
  26 + echo "Cannot check root file system because it could not"
  27 + echo "be mounted in read-only mode."
  28 + echo
  29 + $NORMAL
  30 + $PLYMOUTH message --text=$"Checking file systems...operational error!"
  31 + echo_warning
  32 + echo
  33 + else
  34 + echo_success
  35 + echo
  36 + fi
33 37 fi
34 38  
35   -echo_success
36   -echo
37   -
38 39 if [ -f /forcefsck ]; then
39 40 echo "/forcefsck exists, forcing file system check"
40 41 options="-f"
41 42 else
42 43 options=""
43 44 fi
44   -
45   -echo -n "Checking file systems: "
46   -$PLYMOUTH message --text=$"Checking file systems..."
47 45  
48 46 # note: -a option used to be -p; but this fails e.g. on fsck.minix
49 47 fsck $options -a -A -C -T