. save random data only if /usr is mounted rw, don't display error otherwise
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.
;;
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