You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since 4ca0b14 (PR #20), ubusd allocates its object and client IDs with getrandom(buf, len, 0), which waits until the kernel CRNG is initialised. On a device where the CRNG is not seeded early in boot, this call does not return until the pool is ready. While ubusd is waiting, procd does not advance past its ubus stage, so no console login is started and the system looks unresponsive until the CRNG seeds.
I noticed this while working on the NanoPi R2S Plus support (Rockchip RK3328). random: crng init done appeared only up to 15min on boots, and the console became usable only at that point.
I don't have another NanoPi device available to test this on other hardware right now, but nothing looks board-specific.
What was observed
Here are boot logs from OpenWrt 25.12 (kernel 6.12, ubus 2025.12.02, without PR #20):
[ 11.153869] procd: - ubus -
[ 11.255208] procd: - init -
Please press Enter to activate this console.
[ 11.844418] urngd: v1.0.2 started.
[ 12.000179] random: crng init done
And boot logs from OpenWrt main where the boot stalls (kernel 6.18, ubus 2026.05.23, including PR #20):
[ 8.778422] procd: - ubus -
... no further console output; procd does not reach "- init -" ...
[ 229.443455] random: crng init done
... boot then proceeds and the console becomes usable ...
Reproduction
What I did:
Built a current snapshot image (ubus 2026.05.23, with PR Misc fixes found by Claude Code AI #20) for the NanoPi R2S Plus and booted it. The console stays silent after procd: - ubus -, and random: crng init done appears after several minutes, after which boot completes.
Built an OpenWrt 25.12 image (ubus 2025.12.02, before PR Misc fixes found by Claude Code AI #20) for the same board. It reaches a login prompt in roughly 20 s.
AI analysis
This board's only entropy source that seeds the pool quickly is urngd, which procd starts after the ubus stage. Because ubusd does not return during the ubus stage, urngd does not get started, so the pool can only fill from slow timer-jitter and interrupt entropy.
read_random() is called from ubus_alloc_id(), which runs while ubusd is starting, so the first ID allocation waits for the CRNG. The commit message describes this as intended:
getrandom() avoids opening a file descriptor, works before /dev/urandom is accessible (e.g. early boot inside a container), and blocks until the kernel entropy pool is initialised, making it safer than reading from /dev/urandom directly.
The previous implementation read from /dev/urandom, which returns immediately whether or not the pool is seeded.
Related note
In failsafe mode the system also waited for the CRNG before presenting a shell. That path runs dropbearkey (which generates host keys) before the login hook, and key generation also waits on getrandom. This is a separate component from ubus and is mentioned only because it shares the same underlying condition (a blocking getrandom early in boot on a board whose pool seeds slowly).
Summary
Since 4ca0b14 (PR #20),
ubusdallocates its object and client IDs withgetrandom(buf, len, 0), which waits until the kernel CRNG is initialised. On a device where the CRNG is not seeded early in boot, this call does not return until the pool is ready. Whileubusdis waiting,procddoes not advance past itsubusstage, so no console login is started and the system looks unresponsive until the CRNG seeds.I noticed this while working on the NanoPi R2S Plus support (Rockchip RK3328).
random: crng init doneappeared only up to 15min on boots, and the console became usable only at that point.I don't have another NanoPi device available to test this on other hardware right now, but nothing looks board-specific.
What was observed
Here are boot logs from OpenWrt 25.12 (kernel 6.12, ubus 2025.12.02, without PR #20):
And boot logs from OpenWrt main where the boot stalls (kernel 6.18, ubus 2026.05.23, including PR #20):
Reproduction
What I did:
procd: - ubus -, andrandom: crng init doneappears after several minutes, after which boot completes.AI analysis
This board's only entropy source that seeds the pool quickly is
urngd, whichprocdstarts after theubusstage. Becauseubusddoes not return during theubusstage,urngddoes not get started, so the pool can only fill from slow timer-jitter and interrupt entropy.Affected code
ubusd_id.c,read_random()after PR #20:read_random()is called fromubus_alloc_id(), which runs whileubusdis starting, so the first ID allocation waits for the CRNG. The commit message describes this as intended:The previous implementation read from
/dev/urandom, which returns immediately whether or not the pool is seeded.Related note
In failsafe mode the system also waited for the CRNG before presenting a shell. That path runs
dropbearkey(which generates host keys) before the login hook, and key generation also waits ongetrandom. This is a separate component from ubus and is mentioned only because it shares the same underlying condition (a blockinggetrandomearly in boot on a board whose pool seeds slowly).Environment