From 01bb05168d2ef9eb062cade44a99eb2a7b753940 Mon Sep 17 00:00:00 2001 From: Giulio Date: Sat, 19 Sep 2020 15:11:31 +0200 Subject: [PATCH] Wait for enough entropy before generating keys --- conf/etc/init.d/S22waitrng | 18 ++++++++++++++++++ conf/etc/init.d/{S22cfgbin => S23cfgbin} | 0 2 files changed, 18 insertions(+) create mode 100755 conf/etc/init.d/S22waitrng rename conf/etc/init.d/{S22cfgbin => S23cfgbin} (100%) diff --git a/conf/etc/init.d/S22waitrng b/conf/etc/init.d/S22waitrng new file mode 100755 index 0000000..4be6a7d --- /dev/null +++ b/conf/etc/init.d/S22waitrng @@ -0,0 +1,18 @@ +#!/bin/sh + +case "$1" in + start) + status=`cat /proc/sys/kernel/random/entropy_avail` + echo "Waiting for enough entropy: " + while [ $status -lt 200 ]; do + sleep 2 + status=`cat /proc/sys/kernel/random/entropy_avail` + done + echo -n "OK" + ;; + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit 0 diff --git a/conf/etc/init.d/S22cfgbin b/conf/etc/init.d/S23cfgbin similarity index 100% rename from conf/etc/init.d/S22cfgbin rename to conf/etc/init.d/S23cfgbin