Hello community, here is the log from the commit of package aaa_base checked in at Wed Mar 19 11:32:10 CET 2008. -------- --- aaa_base/aaa_base.changes 2008-03-06 11:30:37.000000000 +0100 +++ /mounts/work_src_done/STABLE/aaa_base/aaa_base.changes 2008-03-18 14:27:12.955323000 +0100 @@ -1,0 +2,5 @@ +Tue Mar 18 14:26:30 CET 2008 - werner@suse.de + +- Use common code only once for halt/reboot/single + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ aaa_base.spec ++++++ --- /var/tmp/diff_new_pack.b17376/_old 2008-03-19 11:22:28.000000000 +0100 +++ /var/tmp/diff_new_pack.b17376/_new 2008-03-19 11:22:28.000000000 +0100 @@ -21,7 +21,7 @@ PreReq: /usr/bin/sed /usr/bin/grep /bin/mv /bin/cat /bin/ls /bin/date /usr/bin/cmp /bin/fillup /sbin/insserv net-tools AutoReqProv: on Version: 11.0 -Release: 38 +Release: 41 Summary: SUSE Linux Base Package BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: aaa_base.tar.bz2 @@ -142,6 +142,8 @@ %defattr(-,root,root) %changelog +* Tue Mar 18 2008 werner@suse.de +- Use common code only once for halt/reboot/single * Thu Mar 06 2008 werner@suse.de - Touch file /success only on rw mounted root fs (bnc#367315) * Tue Mar 04 2008 mkoenig@suse.de ++++++ 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-02-11 18:22:48.000000000 +0100 +++ new/aaa_base/etc/init.d/boot 2008-03-18 14:11:30.000000000 +0100 @@ -38,7 +38,7 @@ # # Export the real device in variable REDIRECT. # -REDIRECT="`showconsole 2>/dev/null`" +REDIRECT="$(showconsole 2>/dev/null)" export REDIRECT if test $COLUMNS -eq 0 ; then # Serial: columns and lines are not defined @@ -320,7 +320,7 @@ fi # run SuSEconfig (with args) if needed if test -f /var/lib/YaST2/run_suseconfig ; then - /sbin/SuSEconfig `cat /var/lib/YaST2/run_suseconfig` + /sbin/SuSEconfig $(cat /var/lib/YaST2/run_suseconfig) rm -f /var/lib/YaST2/run_suseconfig fi 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-03-04 16:09:53.000000000 +0100 +++ new/aaa_base/etc/init.d/boot.localfs 2008-03-18 14:29:02.000000000 +0100 @@ -23,24 +23,48 @@ . /etc/sysconfig/kernel . /etc/sysconfig/sysctl +test -z "$REDIRECT" && REDIRECT="$(showconsole 2>/dev/null)" +export REDIRECT export FSCK_MAX_INST +# +# Special file systems (memory and network based) +# +typeset -r memfs=tmpfs,devpts,proc,usbfs,sysfs +typeset -r netfs=nfs,nfs4,smbfs,cifs +typeset -r nofs=no${netfs//,/,no},no${memfs//,/,no} + +# # helper shell function # -reverse () +if type -p tac > /dev/null 1>&2 ; then + reverse () + { + tac + } +else + reverse () + { + local line + while read -r line ; do + reverse + echo "$line" + break + done + } +fi + +loopdel () { - local _line - while read -r _line ; do - reverse - echo "$_line" - break - done + losetup ${1+"$@"} > /dev/null 2>&1 + test $? -eq 0 || return 0 + losetup -d ${1+"$@"} } list_missed () { - local dev - local mount_opts="-t nonfs,nonfs4,noproc,nodevpts,nosmbfs,nocifs -O no_netdev" + local dev line + local mount_opts="-t $nofs -O no_netdev" mount -afnv $mount_opts 2> /dev/null | while read line ; do dev="${line%% *}" @@ -55,35 +79,33 @@ wait_for_udev () { - missing=$(list_missed) - if [ -z "$missing" ]; then - return - fi + local dev + local -i timeout=30 + local missing=$(list_missed) + + test -n "$missing" || return 0 echo -n "Waiting for $missing " - timeout=30 - while [ "$timeout" -gt 0 ] ; do + while test $timeout -gt 0 ; do sleep 1 echo -n "." still_missing="" for dev in $missing; do - if [ ! -b $dev ] ; then + if test ! -b $dev ; then still_missing="$dev $still_missing" fi done - if [ -z "$still_missing" ]; then + if test -z "$still_missing" ; then echo " ok" - break; + break fi missing="$still_missing" - if [ ! -d /dev/.udev/queue ] ; then + if test ! -d /dev/.udev/queue ; then echo " no more events" - break; + break fi - timeout=$(( $timeout - 1 )) + let timeout-- done - if [ "$timeout" -eq 0 ] ; then - echo " timeout!" - fi + test $timeout -eq 0 && echo " timeout! " } rc_reset @@ -102,7 +124,7 @@ # 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" + test "$REDIRECT" = "/dev/tty1" && FSCK_PROGRESSBAR="-C" # # do fsck and start sulogin, if it fails. # @@ -196,72 +218,60 @@ optpts="-o mode=0620,gid=5" mount -fv -t devpts $optpts devpts /dev/pts rc_status - mount -av -t nonfs,nonfs4,noproc,nodevpts,nosmbfs,nocifs -O no_netdev + mount -av -t $nofs -O no_netdev rc_status -v1 -r ;; stop) mounts=/etc/fstab test -r /proc/mounts && mounts=/proc/mounts + mtab= + test "$2" = "nomtab" && mtab=-n + # move to intermezzo package ? # First umount intermezzo filesystems - if test -x /usr/sbin/umountizo ; then + if type -p umountizo > /dev/null 1>&2 ; then while read line ; do case "$line" in *[Ii][Nn][Tt][Ee][Rr][Mm][Ee][Zz][Zz][Oo]*) - /usr/sbin/umountizo >/dev/null 2>&1 + umountizo >/dev/null 2>&1 esac done < $mounts fi reverse < $mounts | \ while read des fs type rest; do - case "$des" in - ""|\#*) continue ;; - /dev/loop*) - umount $fs - losetup $des &> /dev/null - test $? -eq 0 && losetup -d $des ;; + case "${des##*/}" in + ""|\#*) continue ;; + loop*) umount $mtab $fs + loopdel $des ;; esac case "$fs" in - /sys) continue ;; - /proc) continue ;; - /dev/pts) continue ;; - /dev) continue ;; - /dev/shm) continue ;; + /sys*) continue ;; + /proc*) continue ;; + /dev*) continue ;; esac - case "$type" in - sysfs) umount -t sysfs $fs ;; - proc) umount -t proc $fs ;; - devpts) umount -t devpts $fs ;; - tmpfs) umount -t tmpfs $fs ;; - usbfs) umount -t usbfs $fs ;; + case ",$memfs," in + *,$type,*) umount $mtab -t $type $fs ;; esac done grep "loop" /proc/partitions | while read major minor blocks name ; do - des=/dev/$name case "$name" in - ""|\#*) continue ;; - loop*) - des=/dev/loop/${name#loop} - losetup $des &> /dev/null - test $? -eq 0 && losetup -d $des - des=/dev/$name - losetup $des &> /dev/null - test $? -eq 0 && losetup -d $des + loop*) loopdel /dev/loop/${name#loop} + loopdel /dev/$name ;; esac done UMOUNT_FAILED=false echo "Unmounting file systems" - umount -avt noproc,nonfs,nonfs4,nosmbfs,nocifs,notmpfs,nosysfs || { + umount -av $mtab -t $nofs -O no_netdev || { rc_status UMOUNT_FAILED=true } rc_status -v1 -r - if test "$UMOUNT_FAILED" = true ; then + if test "$UMOUNT_FAILED" = true -a -z "$mtab" ; then echo "Oops: umount failed :-( -- trying to remount readonly..." mounts=/etc/fstab test -r /proc/mounts && mounts=/proc/mounts @@ -269,18 +279,21 @@ # /proc/mounts during direct read call cat $mounts | \ while read des fs type rest; do - case "$des" in ""|\#*) continue ;; esac - case "$type" in - swap) continue ;; # No umount on swap devices - proc|sysfs) continue ;; # Required - nfs|nfs4) continue ;; # Avoid hanging reboot/halt - smbfs|cifs) continue ;; # Avoid hanging reboot/halt - esac - mount -v -n -o remount,ro $fs + case "$des" in + ""|\#*) continue ;; Comment + swap) continue ;; No umount on swap devices + esac + case ",$memfs," in + *,$type,*) continue ;; Most of them are required + esac + case ",$netfs," in + *,$type,*) continue ;; Avoid hanging reboot/halt + esac + mount -v -n -o remount,ro $fs done echo "extra sync..." - sync; sync + sync; sleep 1; sync echo "... hope now it's ok to reboot." fi ;; 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 2007-11-08 15:05:55.000000000 +0100 +++ new/aaa_base/etc/init.d/rc 2008-03-18 14:11:02.000000000 +0100 @@ -87,20 +87,8 @@ sleep 3 echo "Sending all processes the KILL signal..." killall5 -9 - cat /proc/mounts | while read des fs type rest; do - case "$type" in - swap) continue ;; - proc) continue ;; - nfs|nfs4) continue ;; - smbfs|cifs) continue ;; - esac - umount -n -r $fs - done - cat /proc/swaps | while read des type rest ; do - test "$type" = "file" || continue - swapoff $des &> /dev/null - done - umount -n -t proc /proc + /etc/init.d/boot.swap stop nomtab + /etc/init.d/boot.localfs stop nomtab /etc/init.d/boot else for b in /etc/init.d/boot.d/S*boot.udev @@ -134,7 +122,7 @@ # This redirects all rc messages during reboot and halt # to tty1 if the system console is bound on VGA (tty0). # -REDIRECT="`showconsole 2>/dev/null`" +REDIRECT="$(showconsole 2>/dev/null)" export REDIRECT if test -x /sbin/isserial && /sbin/isserial ; then # Serial: columns and lines are not defined ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org