From 093cfe1143233a0efd6fe9632411f96fbd27a626 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Wed, 18 Jan 2006 09:33:09 +0000 Subject: [PATCH] . less verbose cd /usr debugging . save random data only if /usr is mounted rw, don't display error otherwise --- etc/rc | 2 +- etc/usr/rc | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/etc/rc b/etc/rc index ac72e4478..ade6493f1 100755 --- 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. diff --git a/etc/usr/rc b/etc/usr/rc index ba4779f34..7c4cfdd39 100644 --- a/etc/usr/rc +++ b/etc/usr/rc @@ -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 -- 2.44.0