From 87044318e9acb741e1b74767f30cc4ae802ed398 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 25 Mar 2022 21:37:44 -0600 Subject: Use seedrng for seeding the random number generator The RNG can't actually be seeded from a shell script, due to the reliance on ioctls. For this reason, the seedrng project provides a basic script meant to be copy and pasted into projects like void-runit and tweaked as needed: . This commit imports it into void-runit and wires up the init scripts to call it. This also is a significant improvement over the current init script, which fails to remove seed files that have already been used, or to ratchet them forward. --- core-services/05-misc.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'core-services') diff --git a/core-services/05-misc.sh b/core-services/05-misc.sh index 0f3d28c..3468e9c 100644 --- a/core-services/05-misc.sh +++ b/core-services/05-misc.sh @@ -4,8 +4,7 @@ install -m0664 -o root -g utmp /dev/null /run/utmp halt -B # for wtmp if [ -z "$VIRTUALIZATION" ]; then - msg "Initializing random seed..." - cp /var/lib/random-seed /dev/urandom >/dev/null 2>&1 || true + seedrng || true fi msg "Setting up loopback interface..." -- cgit 1.4.1