# entropy - Entropy check
# Waits until Kernel has enough entropy available.
description "Entropy"
start on mounted MOUNTPOINT=/
task
console output
pre-start script
echo " * Waiting for entropy"
dd if=/dev/urandom of=/dev/null bs=1024 count=10 2>/dev/null
/etc/init.d/rng-tools start
while [ $(cat /proc/sys/kernel/random/entropy_avail) -le 200 ]; do sleep 1; done
end script
script
entropy=$(cat /proc/sys/kernel/random/entropy_avail)
echo " * Entropy is available now: $entropy bytes"
end script
# firstboot - First boot setup
# Does setup stuff on very first boot.
description "First boot setup"
start on stopping entropy
task
script
if [ ! -e /etc/firstboot/firstboot_done ]; then
run-parts --lsbsysinit --exit-on-error /etc/firstboot/firstboot.d && touch /etc/firstboot/firstboot_done
fi
end script