[Midnightbsd-cvs] src: random: stop bitching for random on read only devices.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Fri Oct 26 10:31:19 EDT 2007
Log Message:
-----------
stop bitching for random on read only devices. (good for live cd use)
As a last ditch effort, try to write it to var
Modified Files:
--------------
src/etc/rc.d:
random (r1.2 -> r1.3)
-------------- next part --------------
Index: random
===================================================================
RCS file: /home/cvs/src/etc/rc.d/random,v
retrieving revision 1.2
retrieving revision 1.3
diff -Letc/rc.d/random -Letc/rc.d/random -u -r1.2 -r1.3
--- etc/rc.d/random
+++ etc/rc.d/random
@@ -45,6 +45,7 @@
*)
if [ -w /dev/random ]; then
feed_dev_random "${entropy_file}"
+ feed_dev_random /var/db/entropy-file
fi
;;
esac
@@ -60,22 +61,22 @@
;;
*)
echo -n 'Writing entropy file:'
- rm -f ${entropy_file}
+ rm -f ${entropy_file} 2> /dev/null
oumask=`umask`
umask 077
- if touch ${entropy_file}; then
+ if touch ${entropy_file} 2> /dev/null; then
entropy_file_confirmed="${entropy_file}"
else
# Try this as a reasonable alternative for read-only
# roots, diskless workstations, etc.
- rm -f /var/db/entropy-file
- if touch /var/db/entropy-file; then
+ rm -f /var/db/entropy-file 2> /dev/null
+ if touch /var/db/entropy-file 2> /dev/null; then
entropy_file_confirmed=/var/db/entropy-file
fi
fi
case ${entropy_file_confirmed} in
'')
- err 1 'entropy file write failed.'
+ warn 'write failed (read-only fs?)'
;;
*)
dd if=/dev/random of=${entropy_file_confirmed} \
More information about the Midnightbsd-cvs
mailing list