3

I am having heavy problems similar to what discussed in this question.

In my case though, I have a very recent kernel (5.3) for a small embedded processor (mips, mt7628) and boot process stops for over 6 minutes till I get the kprint:

[  402.804482] random: crng init done

after that boot sequence continues normally:

[  403.807776] usbcore: registered new interface driver usbhid
[  403.813440] usbhid: USB HID core driver
Starting kmsgd: OK
Starting applicazione: stream.py OK
...

Can someone explain what's going on (and, possibly, a workaround)?

Of course I have no randomization hardware.

ZioByte
  • 870

1 Answers1

1

I have been directed to use haveged and it actually dramatically shortens startup time:

[   12.477886] random: crng init done

I will leave this answer for whoever will stumble into the problem.

I will wait for better answers before accepting this.

Note: this source hints there could be some kind of kernel bug responsible for entropy pool exhaustion, but I found no precis references.

ZioByte
  • 870
  • Based on the date in that source, it seems likely it’s referring to the same bug as in that earlier question which you already linked to. – Wildcard Sep 24 '19 at 02:04
  • @Wildcard: My kernel has "#define crng_ready() (likely(crng_init > 1))", but I cannot really believe this "bug" is still there! I am using the very last kernel available (5.3). How can it be? – ZioByte Sep 24 '19 at 06:39
  • Sorry, not a kernel dev even vaguely; I've less idea than you have. I can probably answer any shell question you'd care to throw at me, though. ;) – Wildcard Sep 24 '19 at 07:48
  • https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=43838a23a05fbd13e47d750d3dfd77001536dd33

    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=897572#82

    https://bugs.archlinux.org/task/58355

    https://wiki.debian.org/BoottimeEntropyStarvation

    – user1742529 Apr 16 '21 at 08:49
  • To disable long random crng init need kernel with CONFIG_RANDOM_TRUST_CPU=y set (or random.trust_cpu=on added to the commandline). – user1742529 Apr 16 '21 at 08:52