. less verbose cd /usr debugging

. save random data only if /usr is mounted rw, don't display error otherwise
This commit is contained in:
Ben Gras 2006-01-18 09:33:09 +00:00
parent 428f9d63c4
commit 093cfe1143
2 changed files with 9 additions and 10 deletions

2
etc/rc
View File

@ -90,7 +90,7 @@ start)
usrdev="`expr $imagedev + 1`" usrdev="`expr $imagedev + 1`"
usr_roflag="-r" usr_roflag="-r"
usr="`/bin/dev2name $usrdev`" usr="`/bin/dev2name $usrdev`"
echo "Setting /usr to mount readonly from cd: $usrdev -> $usr" echo "Setting /usr on cd is $usr"
fi fi
# Mount the /usr partition unless this is a single floppy Minix. # Mount the /usr partition unless this is a single floppy Minix.

View File

@ -154,15 +154,14 @@ start)
;; ;;
stop|down) stop|down)
# Save random data. # Save random data, if /usr is mounted rw.
bootcd="`/bin/sysenv bootcd`" if grep ' \/usr .*rw' /etc/mtab >/dev/null
if dd if=/dev/random of=$RANDOM_FILE.new bs=1024 count=1 2>/dev/null then
then if dd if=/dev/random of=$RANDOM_FILE.new bs=1024 count=1 2>/dev/null
then
mv $RANDOM_FILE.new $RANDOM_FILE mv $RANDOM_FILE.new $RANDOM_FILE
else else
if [ "$bootcd" != 1 ] echo 'Failed to save random data.'
then fi
echo 'Failed to save random data.'
fi
fi fi
esac esac