]> git.ipfire.org Git - thirdparty/util-linux.git/commit
lib/randutils: Do not block on getrandom()
authorCarlo Caione <carlo@endlessm.com>
Mon, 19 Mar 2018 10:31:07 +0000 (10:31 +0000)
committerKarel Zak <kzak@redhat.com>
Mon, 19 Mar 2018 13:06:09 +0000 (14:06 +0100)
commita9cf659e0508c1f56813a7d74c64f67bbc962538
treec593f6bfac3157111c493d7234374afbe1438267
parent655776a2c18cac7071e3828e7733403817fc861b
lib/randutils: Do not block on getrandom()

In Endless we have hit a problem when using 'sfdisk' on the really first
boot to automatically expand the rootfs partition. On this platform
'sfdisk' is blocking on getrandom() because not enough random bytes are
available. This is an ARM platform without a hwrng.

We fix this passing GRND_NONBLOCK to getrandom(). 'sfdisk' will use the
best entropy it has available and fallback only as necessary.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
lib/randutils.c