]> Zhao Yanbai Git Server - minix.git/commitdiff
. less verbose cd /usr debugging
authorBen Gras <ben@minix3.org>
Wed, 18 Jan 2006 09:33:09 +0000 (09:33 +0000)
committerBen Gras <ben@minix3.org>
Wed, 18 Jan 2006 09:33:09 +0000 (09:33 +0000)
. save random data only if /usr is mounted rw, don't display error otherwise

etc/rc
etc/usr/rc

diff --git a/etc/rc b/etc/rc
index ac72e44780a61662610c3fb64016a2873e4cb694..ade6493f10b3b860cb40bd2694fdb27ac102aed9 100755 (executable)
--- a/etc/rc
+++ b/etc/rc
@@ -90,7 +90,7 @@ start)
                usrdev="`expr $imagedev + 1`"
                usr_roflag="-r"
                usr="`/bin/dev2name $usrdev`"
-               echo "Setting /usr to mount readonly from cd: $usrdev -> $usr"
+               echo "Setting /usr on cd is $usr"
     fi
  
     # Mount the /usr partition unless this is a single floppy Minix.
index ba4779f345d7d6d3a4469368c81043f1b9d3f6cf..7c4cfdd39fbdd924e6e10c54bbb70cef8169c0b6 100644 (file)
@@ -154,15 +154,14 @@ start)
 
 ;;
 stop|down)
-       # Save random data.
-       bootcd="`/bin/sysenv bootcd`"
-       if dd if=/dev/random of=$RANDOM_FILE.new bs=1024 count=1 2>/dev/null
-       then
+       # Save random data, if /usr is mounted rw.
+       if grep ' \/usr .*rw' /etc/mtab >/dev/null
+       then
+         if dd if=/dev/random of=$RANDOM_FILE.new bs=1024 count=1 2>/dev/null
+         then
                mv $RANDOM_FILE.new $RANDOM_FILE
-       else
-               if [ "$bootcd" != 1 ]
-               then
-                       echo 'Failed to save random data.'
-               fi
+         else
+               echo 'Failed to save random data.'
+         fi
        fi
 esac