Commit f33f7668 authored by Baruch Siach's avatar Baruch Siach Committed by Peter Korsgaard
Browse files

system/skeleton: don't use random-seed from a read-only fs



A random-seed from a read-only filesystem is useless.

Also, drop the check for /etc/random-seed existence; it must exist after a
touch.

Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent ed0b44fd
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -11,22 +11,19 @@

case "$1" in
	start|"")
		# check for read only file system
		if ! touch /etc/random-seed 2>/dev/null
		then
			echo "read-only file system detected...done"
			exit
		fi
		if [ "$VERBOSE" != no ]
		then
			echo -n "Initializing random number generator... "
		fi
		# Load and then save 512 bytes,
		# which is the size of the entropy pool
		if [ -f /etc/random-seed ]
		then
		cat /etc/random-seed >/dev/urandom
		fi
		# check for read only file system
		if ! touch /etc/random-seed 2>/dev/null
		then
			echo "read-only file system detected...done"
			exit
		fi
		rm -f /etc/random-seed
		umask 077
		dd if=/dev/urandom of=/etc/random-seed count=1 \