mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-28 05:36:32 +00:00
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>
This commit is contained in:
parent
ed0b44fdce
commit
f33f766860
@ -11,22 +11,19 @@
|
|||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start|"")
|
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
|
# check for read only file system
|
||||||
if ! touch /etc/random-seed 2>/dev/null
|
if ! touch /etc/random-seed 2>/dev/null
|
||||||
then
|
then
|
||||||
echo "read-only file system detected...done"
|
echo "read-only file system detected...done"
|
||||||
exit
|
exit
|
||||||
fi
|
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
|
rm -f /etc/random-seed
|
||||||
umask 077
|
umask 077
|
||||||
dd if=/dev/urandom of=/etc/random-seed count=1 \
|
dd if=/dev/urandom of=/etc/random-seed count=1 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user