Eternal wait for crng init done

Hi everyone. Newbee question here.

I compiled Kernel 4.14 on the BBB (latest currently) following the buildroot recipe.
I used BB.org as linux defconfig and am335x_evm as uboot defconfig.

The board boots in roughly 5 seconds from my SD card. Great.
Now i added open_ssh to get ssh and sftp functionality, it works but now my board hands for 185 seconds at each boot:

[ 6.120766] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 191.444192] random: crng init done
OK

Welcome to Buildroot
buildroot login:

So i considered maybe it was re-generating its SSH keys at each boot because maybe they did not persist, but after safely remove my SD from the system, i confirmed they do persist under etc/ssh.

So i went to the /etc/init.d/ and edited the S50sshd script, and commented out the command that generate the keys (supposingly only if missing)

Create any missing keys

   #/usr/bin/ssh-keygen -A

Unfortunatly, this did not help either.
Finally i temporarily MOVED the script one laye lower, and it did the trick, no more delay. But of course i loose my ssh/sftp functionalities :slight_smile:

Sooooo… What is the problem ? I read somewhere that there was a bug introduced in kernel 4.16 about the crng init that was not returning the right status but this is kernel 4.14 so this must be something else.

Thanx for any help.

Add

rng_core.default_quality=100

To your kernel boot arguments…

Regards,

1 Like

I found where to put the argin
/buildroot/board/beaglebone/uEnv.txt.

This file is simply copied (not generated) at the end of build because of post-build.sh

Thank again, you put sunshine in my day :slight_smile:

Thanxs sir !
I edited my uEnv.txt and now it is not waiting anymore.

I’ve search in circles, is there a way to make that permanent in menuconfig ?

might be easier to patch the kernel:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/hw_random/core.c#n43

Otherwise, an “append” option in the Makefile…

Regards,