diff options
author | Baruch Siach <baruch@tkos.co.il> | 2015-07-08 08:24:12 +0300 |
---|---|---|
committer | Peter Korsgaard <peter@korsgaard.com> | 2015-07-08 23:52:48 +0200 |
commit | f33f766860a9ff6a62b474343d7859b702b2d713 (patch) | |
tree | cec49359a701cf2e1ea373859771030aa6218306 /system | |
parent | ed0b44fdcecd2a703d2c1b8134375e19a2b7f867 (diff) |
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: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Diffstat (limited to 'system')
-rwxr-xr-x | system/skeleton/etc/init.d/S20urandom | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/system/skeleton/etc/init.d/S20urandom b/system/skeleton/etc/init.d/S20urandom index f73cea59e..36277ba61 100755 --- a/system/skeleton/etc/init.d/S20urandom +++ b/system/skeleton/etc/init.d/S20urandom @@ -11,22 +11,19 @@ case "$1" in start|"") - 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 + 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 + cat /etc/random-seed >/dev/urandom rm -f /etc/random-seed umask 077 dd if=/dev/urandom of=/etc/random-seed count=1 \ |