initscripts-slugos: modify the slugos checkroot.sh not to hang on fsck failure in 1.0
authorJohn Bowler <jbowler@nslu2-linux.org>
Mon, 6 Feb 2006 01:22:22 +0000 (01:22 +0000)
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>
Mon, 6 Feb 2006 01:22:22 +0000 (01:22 +0000)
slugos-init: add a single_user_ok function in /etc/default/functions in 0.10
sysvinit: update slugos rcS with new options in 2.86
 - this is to fix the fsck of the rootfs so that it will actually work
   safely on machines with no console.

packages/initscripts/initscripts-1.0/slugos/checkroot.sh
packages/initscripts/initscripts-slugos_1.0.bb
packages/slugos-init/files/functions
packages/slugos-init/slugos-init_0.10.bb
packages/sysvinit/sysvinit/slugos/rcS-default
packages/sysvinit/sysvinit_2.86.bb

index 806379f..4c826b4 100644 (file)
@@ -79,6 +79,9 @@ fi
 if test -f /fastboot || test "$ROOTFSCK" != yes
 then
   test "$ROOTFSCK" = yes && echo "Fast boot, no filesystem check"
+elif test ! -x /sbin/fsck -a ! -x /usr/sbin/fsck
+then
+  echo "/etc/init.d/checkroot.sh: no fsck"
 else
   leds disk-1 slow
   #
@@ -128,8 +131,13 @@ else
       leds system panic
       beep -r 5
       # Start a single user shell on the console
-      /sbin/sulogin $CONSOLE
-      reboot -f
+      if single_user_ok
+      then
+       sulogin $CONSOLE
+       reboot -f
+      else
+       echo "/etc/init.d/checkroot.sh: fsck failed, continuing boot"
+      fi
     fi
   else
     echo "*** ERROR!  Cannot fsck root fs because it is not mounted read-only!"
index 59c8d30..3219f88 100644 (file)
@@ -11,7 +11,7 @@ RCONFLICTS = "initscripts"
 # All other standard definitions inherited from initscripts
 # Except the PR which is hacked here.  The format used is
 # a suffix
-PR := "${PR}.6"
+PR := "${PR}.7"
 
 FILESPATH = "${@base_set_filespath([ '${FILE_DIRNAME}/${P}', '${FILE_DIRNAME}/initscripts-${PV}', '${FILE_DIRNAME}/files', '${FILE_DIRNAME}' ], d)}"
 
index ef10d65..df74aea 100644 (file)
@@ -26,6 +26,20 @@ machine(){
        esac
 }
 #
+# single_user_ok
+#  if the machine is capable of single user interaction return
+#  true, else return false.  The result of this function is
+#  preempted by setting SULOGIN to 'yes' or 'ok' in /etc/default/rcS
+single_user_ok() {
+       # list known good machines in the 'case'
+       test "$SULOGIN" = yes -o "$SULOGIN" = ok ||
+               case "$(machine)" in
+               ixdp*|avila|loft)
+                       return 0;;
+               *)      return 1;;
+               esac
+}
+#
 # load_functions "source"
 #  load the functions in '/sbin/source' - relies on /sbin/source being
 #  a shell script and having support for this function.
index 7c4c21f..d8376ef 100644 (file)
@@ -4,7 +4,7 @@ PRIORITY = "required"
 LICENSE = "GPL"
 DEPENDS = "base-files devio"
 RDEPENDS = "busybox devio"
-PR = "r54"
+PR = "r55"
 
 SRC_URI = "file://boot/flash \
           file://boot/disk \
index 4cb0e0c..8bd6656 100644 (file)
@@ -5,6 +5,9 @@
 # Time files in /tmp are kept in days.
 TMPTIME=0
 # Set to yes if you want sulogin to be spawned on bootup
+# Set to ok if the machine supports SULOGIN, otherwise a
+# boot time failure will be ignored unless the system
+# is known to support a serial port
 SULOGIN=no
 # Set to no if you want to be able to login over telnet/rlogin
 # before system startup is complete (as soon as inetd is started)
@@ -21,4 +24,7 @@ FSCKFIX=yes
 # Set DOSWAP to "no" if you do not want all swap to automatically be mounted
 DOSWAP=yes
 # Set ROOTFSCK to "yes" to check the root fs automatically on boot
-ROOTFSCK=yes
+# WARNING: fsck for the file system must be installed and must work
+# before enabling this option, if not your system will drop to single
+# user (sulogin) if SULOGIN is set to yes or ok!
+ROOTFSCK=no
index 5a88eba..d15afdf 100644 (file)
@@ -3,7 +3,7 @@ SECTION = "base"
 LICENSE = "GPL"
 MAINTAINER = "Chris Larson <kergoth@handhelds.org>"
 HOMEPAGE = "http://freshmeat.net/projects/sysvinit/"
-PR = "r21"
+PR = "r22"
 
 # USE_VT and SERIAL_CONSOLE are generally defined by the MACHINE .conf.
 # Set PACKAGE_ARCH appropriately.