Hello community, here is the log from the commit of package aaa_base checked in at Fri Aug 8 23:47:30 CEST 2008. -------- --- aaa_base/aaa_base.changes 2008-08-08 15:12:16.000000000 +0200 +++ /mounts/work_src_done/STABLE/aaa_base/aaa_base.changes 2008-08-08 17:43:06.119792000 +0200 @@ -1,0 +2,5 @@ +Fri Aug 8 17:42:04 CEST 2008 - werner@suse.de + +- Implement forcefsck from kernels command line (bnc#379597) + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aaa_base.spec ++++++ --- /var/tmp/diff_new_pack.B15351/_old 2008-08-08 23:47:01.000000000 +0200 +++ /var/tmp/diff_new_pack.B15351/_new 2008-08-08 23:47:01.000000000 +0200 @@ -28,7 +28,7 @@ PreReq: /usr/bin/sed /usr/bin/grep /bin/mv /bin/cat /bin/ls /bin/date /usr/bin/cmp /bin/fillup /sbin/insserv udev net-tools AutoReqProv: on Version: 11.0.42 -Release: 26 +Release: 27 Summary: SUSE Linux Base Package BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: aaa_base.tar.bz2 @@ -151,6 +151,8 @@ %changelog * Fri Aug 08 2008 werner@suse.de +- Implement forcefsck from kernels command line (bnc#379597) +* Fri Aug 08 2008 werner@suse.de - In boot.localfs: generate list of virtual fs on the fly * Thu Aug 07 2008 werner@suse.de - In halt script: use option -r of umount ++++++ aaa_base.tar.bz2 ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/boot new/aaa_base/etc/init.d/boot --- old/aaa_base/etc/init.d/boot 2008-08-05 14:00:35.000000000 +0200 +++ new/aaa_base/etc/init.d/boot 2008-08-08 17:41:02.000000000 +0200 @@ -119,10 +119,16 @@ # Should we ask for interactive boot mode # DO_CONFIRM="" -read -t 2 check < /proc/cmdline 2> /dev/null -case "$check" in - *confirm*) DO_CONFIRM=yes ;; -esac +DO_FORCEFSCK="" +if rc_cmdline confirm > /dev/null ; then + DO_CONFIRM=yes +fi +if rc_cmdline forcefsck > /dev/null ; then + DO_FORCEFSCK=yes +fi +if rc_cmdline fastboot > /dev/null ; then + DO_FASTBOOT=yes +fi test -z "$CONFIRM_PROMPT_TIMEOUT" && CONFIRM_PROMPT_TIMEOUT=5 if test "$PROMPT_FOR_CONFIRM" = "yes" -a "$DO_CONFIRM" != "yes" ; then echo -en "${extd}Enter Interactive startup mode?${norm}" @@ -137,7 +143,7 @@ unset answer echo fi -export DO_CONFIRM +export DO_CONFIRM DO_FORCEFSCK DO_FASTBOOT # # Start blogd, requires /proc and /dev/pts. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/boot.localfs new/aaa_base/etc/init.d/boot.localfs --- old/aaa_base/etc/init.d/boot.localfs 2008-08-08 15:08:34.000000000 +0200 +++ new/aaa_base/etc/init.d/boot.localfs 2008-08-08 17:41:26.000000000 +0200 @@ -138,72 +138,78 @@ # rootfs is mounted rw, lvm et al should be up now wait_for_udev - # - # If we use a serial console, don't use the fsck progress bar - # - FSCK_PROGRESSBAR="-V" - test "$REDIRECT" = "/dev/tty1" && FSCK_PROGRESSBAR="-C" + # # do fsck and start sulogin, if it fails. # FSCK_RETURN=0 - if test ! -f /fastboot -a -z "$fastboot" ; then - FSCK_FORCE="" - test -f /forcefsck && FSCK_FORCE="-f" - echo "Checking file systems..." - fsck $FSCK_PROGRESSBAR -R -A -M -a $FSCK_FORCE -t noopts=nofail - # A return code of 1 indicates that file system errors - # were corrected, but that the boot may proceed. - # A return code of 2 or larger indicates failure. - FSCK_RETURN=$? - test $FSCK_RETURN -lt 4 - rc_status -v1 -r - if test $FSCK_RETURN -gt 1 -a $FSCK_RETURN -lt 4 ; then - # if appropriate, switch bootsplash to verbose - # mode to make text messages visible. - test -f /proc/splash && echo "verbose" > /proc/splash - echo - echo "fsck succeed, but reboot is required." - echo - sleep 1 - sync - reboot -f - elif test $FSCK_RETURN -gt 3; then - # if appropriate, switch bootsplash to verbose - # mode to make text messages visible. - test -f /proc/splash && echo "verbose" > /proc/splash - # Stop blogd since we reboot after sulogin - test -x /sbin/blogd && killproc -QUIT /sbin/blogd - if test -x /etc/init.d/kbd ; then - /etc/init.d/kbd start - fi - echo - echo "fsck failed for at least one filesystem (not /)." - echo "Please repair manually and reboot." - echo "The root file system is is already mounted read-write." - echo - echo "Attention: Only CONTROL-D will reboot the system in this" - echo "maintanance mode. shutdown or reboot will not work." - echo - PS1="(repair filesystem) # " - export PS1 - /sbin/sulogin /dev/console - - # if the user has mounted something rw, this should be umounted - echo "Unmounting file systems (ignore error messages)" - umount -avn - - # on umsdos fs this would lead to an error message. - # so direct errors to /dev/null - mount -no remount,ro / 2> /dev/null - - sync - reboot -f - fi - if test $FSCK_RETURN -gt 0; then - sync - > /fsck_corrected_errors + if test ! -f /fastboot -a -z "$DO_FASTBOOT" ; then + # common options for file system check + FSCK_OPTS="-R -A -M -a -t noopts=nofail" + # force file system check if forced + if test -f /forcefsck -o "$DO_FORCEFSCK" = "yes" ; then + FSCK_OPTS="$FSCK_OPTS -f" + fi + # If we use a serial console, don't use the fsck progress bar + if "$REDIRECT" = "/dev/tty1" ; then + FSCK_OPTS="$FSCK_OPTS -C" + else + FSCK_OPTS="$FSCK_OPTS -V" + fi + echo "Checking file systems..." + fsck $FSCK_OPTS + # A return code of 1 indicates that file system errors + # were corrected, but that the boot may proceed. + # A return code of 2 or larger indicates failure. + FSCK_RETURN=$? + test $FSCK_RETURN -lt 4 + rc_status -v1 -r + if test $FSCK_RETURN -gt 1 -a $FSCK_RETURN -lt 4 ; then + # if appropriate, switch bootsplash to verbose + # mode to make text messages visible. + test -f /proc/splash && echo "verbose" > /proc/splash + echo + echo "fsck succeed, but reboot is required." + echo + sleep 1 + sync + reboot -f + elif test $FSCK_RETURN -gt 3; then + # if appropriate, switch bootsplash to verbose + # mode to make text messages visible. + test -f /proc/splash && echo "verbose" > /proc/splash + # Stop blogd since we reboot after sulogin + test -x /sbin/blogd && killproc -QUIT /sbin/blogd + if test -x /etc/init.d/kbd ; then + /etc/init.d/kbd start fi + echo + echo "fsck failed for at least one filesystem (not /)." + echo "Please repair manually and reboot." + echo "The root file system is is already mounted read-write." + echo + echo "Attention: Only CONTROL-D will reboot the system in this" + echo "maintanance mode. shutdown or reboot will not work." + echo + PS1="(repair filesystem) # " + export PS1 + /sbin/sulogin /dev/console + + # if the user has mounted something rw, this should be umounted + echo "Unmounting file systems (ignore error messages)" + umount -avn + + # on umsdos fs this would lead to an error message. + # so direct errors to /dev/null + mount -no remount,ro / 2> /dev/null + + sync + reboot -f + fi + if test $FSCK_RETURN -gt 0; then + sync + > /fsck_corrected_errors + fi fi # diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/boot.proc new/aaa_base/etc/init.d/boot.proc --- old/aaa_base/etc/init.d/boot.proc 2008-07-22 11:53:07.000000000 +0200 +++ new/aaa_base/etc/init.d/boot.proc 2008-08-08 17:26:49.000000000 +0200 @@ -26,9 +26,8 @@ # check if sysrq should be enabled # if test -e /proc/sys/kernel/sysrq ; then - read a < /proc/cmdline - case "$a" in - *sysrq=yes*|*sysrq=1*) ENABLE_SYSRQ="yes" ;; + case "$(rc_cmdline sysrq)" in + sysrq=yes|sysrq=1) ENABLE_SYSRQ="yes" ;; esac case "$ENABLE_SYSRQ" in yes) ENABLE_SYSRQ=1 ;; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/boot.rootfsck new/aaa_base/etc/init.d/boot.rootfsck --- old/aaa_base/etc/init.d/boot.rootfsck 2008-08-06 15:14:53.000000000 +0200 +++ new/aaa_base/etc/init.d/boot.rootfsck 2008-08-08 17:41:43.000000000 +0200 @@ -34,11 +34,6 @@ rc_status -v1 -r # - # If we use a serial console, don't use the fsck progress bar - # - FSCK_PROGRESSBAR="-V" - [ -x /sbin/showconsole ] && [ "`/sbin/showconsole`" = "/dev/tty1" ] && FSCK_PROGRESSBAR="-C" - # # do fsck and start sulogin, if it fails. # FSCK_RETURN=0 @@ -67,7 +62,7 @@ fi # FSCK_FORCE="" - if test -f /forcefsck ; then + if test -f /forcefsck -o "$DO_FORCEFSCK" = "yes" ; then FSCK_FORCE="-f" ROOTFS_FSCK="" fi @@ -75,7 +70,19 @@ # already checked and ok, skip the rest MAY_FSCK=0 fi - if test ! -f /fastboot -a -z "$fastboot" -a $MAY_FSCK -eq 1 ; then + if test ! -f /fastboot -a -z "$DO_FASTBOOT" -a $MAY_FSCK -eq 1 ; then + # common options for file system check + FSCK_OPTS="-a" + # force file system check if forced + if test -f /forcefsck -o "$DO_FORCEFSCK" = "yes" ; then + FSCK_OPTS="$FSCK_OPTS -f" + fi + # If we use a serial console, don't use the fsck progress bar + if "$REDIRECT" = "/dev/tty1" ; then + FSCK_OPTS="$FSCK_OPTS -C" + else + FSCK_OPTS="$FSCK_OPTS -V" + fi # on an umsdos root fs this mount will fail, # so direct error messages to /dev/null. # this seems to be ugly, but should not really be a problem. @@ -85,7 +92,7 @@ FSCK_RETURN=$ROOTFS_FSCK else echo "Checking root file system..." - fsck $FSCK_PROGRESSBAR -a $FSCK_FORCE $ROOTFS_BLKDEV + fsck $FSCK_OPTS $ROOTFS_BLKDEV # A return code of 1 indicates that file system errors # were corrected, but that the boot may proceed. # A return code of 2 or larger indicates failure. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/halt new/aaa_base/etc/init.d/halt --- old/aaa_base/etc/init.d/halt 2008-08-05 13:54:20.000000000 +0200 +++ new/aaa_base/etc/init.d/halt 2008-08-08 17:26:05.000000000 +0200 @@ -50,11 +50,9 @@ INIT_HALT=POWEROFF else INIT_HALT=HALT - read -t 2 cmdline < /proc/cmdline - case "$cmdline" in - *apm=smp-power-off*|*apm=power-off*) INIT_HALT=POWEROFF + case "$(rc_cmdline apm)" in + apm=smp-power-off|apm=power-off) INIT_HALT=POWEROFF esac - unset cmdline fi esac esac diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/init.d/rc new/aaa_base/etc/init.d/rc --- old/aaa_base/etc/init.d/rc 2008-08-05 13:59:58.000000000 +0200 +++ new/aaa_base/etc/init.d/rc 2008-08-08 17:21:10.000000000 +0200 @@ -35,20 +35,6 @@ # test "$PREVLEVEL" = "1" -a "$RUNLEVEL" = "S" && exit 0 -# -# Up from runlevel N we may want to run in confirm mode -# -if test "$PREVLEVEL" = "N" ; then - test -e /proc/cmdline || mount -n -t proc proc /proc - read -t 2 check < /proc/cmdline 2> /dev/null - case "$check" in - *confirm*) DO_CONFIRM=yes ;; - esac - test -e /var/run/do_confirm && DO_CONFIRM=yes - rm -f /var/run/do_confirm - export DO_CONFIRM -fi - runrc=/etc/init.d/rc${RUNLEVEL}.d prerc=/etc/init.d/rc${PREVLEVEL}.d @@ -58,6 +44,13 @@ . /etc/rc.splash $RUNLEVEL # +# Configuration and coloring of the boot messages +# + +. /etc/rc.status +. /etc/sysconfig/boot + +# # Up from runlevel S we have to check if the system was # cold booted into single user mode and call /etc/init.d/boot. # @@ -66,19 +59,14 @@ single="no" hvname="yes" # - check="" - test -e /proc/cmdline || mount -n -t proc proc /proc - read -t 2 check < /proc/cmdline 2> /dev/null - case " ${check} " in - *\ single\ *|*\ s\ *) - single="yes" - esac - read -t 2 check < /proc/sys/kernel/hostname 2> /dev/null - case "${check}" in - "(none)"|unknown|"") - hvname="no" + if rc_cmdline single s S ; then + single="yes" + fi + read -t 2 hostname < /proc/sys/kernel/hostname 2> /dev/null + case "${hostname}" in + "(none)"|unknown|"") hvname="no" esac - unset check + unset hostname if test "$single" = "yes" -a "$hvname" = "no" ; then # This is the case if we're up from cold boot @@ -112,11 +100,17 @@ exec 0<> $CONSOLE 1>&0 2>&0 # -# Configuration and coloring of the boot messages +# Up from runlevel N we may want to run in confirm mode # - -. /etc/rc.status -. /etc/sysconfig/boot +DO_CONFIRM="" +if test "$PREVLEVEL" = "N" ; then + if rc_cmdline confirm > /dev/null ; then + DO_CONFIRM=yes + fi + test -e /var/run/do_confirm && DO_CONFIRM=yes + rm -f /var/run/do_confirm + export DO_CONFIRM +fi # # Reset status of this script diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aaa_base/etc/rc.status new/aaa_base/etc/rc.status --- old/aaa_base/etc/rc.status 2008-08-01 13:58:46.000000000 +0200 +++ new/aaa_base/etc/rc.status 2008-08-08 17:20:09.000000000 +0200 @@ -375,3 +375,26 @@ export PREVLEVEL RUNLEVEL } +cmdline="" +rc_cmdline() +{ + local arg cmd key val + test -e /proc/cmdline || mount -nt proc proc /proc + test -n "$cmdline" || read -t 2 cmdline < /proc/cmdline + for arg; do + for cmd in $cmdline ; do + key="${cmd%%=*}" + key="${key//-/_}" + case "${key}" in + $arg) + case "$cmd" in + *=*) val="${cmd#*=}" ;; + *) val=yes + esac + echo $key=$val + return 0 + esac + done + done + return 1 +} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org