[PATCH] getrandom: new applet

Etienne Champetier champetier.etienne at gmail.com
Tue Jun 28 21:54:42 UTC 2016


Hi Lauri,

2016-06-28 19:10 GMT+02:00 Lauri Kasanen <curaga at operamail.com>:
> On Tue, Jun 28, 2016, at 19:56, Etienne CHAMPETIER wrote:
>> first user of this applet will be LEDE (OpenWrt) to save an urandom seed
>> using getrandom() (so we are sure /dev/urandom pool is initialized)
>
> In LFS, the boot scripts use dd for this. Is there any need for an
> applet?

On linux you have /dev/random which block, /dev/urandom which never block,
and the new getrandom() syscall which only block until proper initialisation.
To use getrandom() you need an applet.

I could use /dev/random + dd but this can take a long time and slow
down other /dev/random consumer
(key generation on first boot)

Here is the code I found for LFS
https://github.com/ojab/BLFS/blob/master/bootscripts/blfs/init.d/random#L32
they are using /dev/urandom really early in the boot process so it
might not be initialized yet
We are not sure we will go through stop() (hard reset)
Also getrandom() didn't exists at that time ...

Basically the right tool for the job is now getrandom() so let's use it.

>
> - Lauri
>
> --
>


More information about the busybox mailing list