logd scheme.rs:
- Kernel log reader: don't break loop on 0-byte read. /scheme/sys/log
presents a snapshot; breaking loses all future entries. Now polls
with a 50ms sleep on drain, continuing to capture new kernel logs.
Also slice buffer to actual bytes read to avoid processing stale data.
- read(): return EBADF instead of silent Ok(0) stub. Logd handles are
write-only sinks; reading is not a valid operation.
- fcntl(): return ENOSYS instead of silent Ok(0). No fcntl operations
are implemented for log handles.
- fsync(): remove TODO comment; behavior (Ok(())) is correct since the
output channel guarantees FIFO delivery.
ipcd uds/stream.rs:
- events(): remove 'TODO: block on write buffer'. Backpressure is now
applied at the scheme level.
- fevent(): filter EVENT_WRITE based on peer receive buffer fullness
against sender's SO_SNDBUF. Prevents busy-spin when buffer is full.
- write_inner(): check backpressure before accepting data. Return
EAGAIN (non-blocking) or EWOULDBLOCK (blocking) when peer buffer
would exceed SO_SNDBUF limit. Only applies to established connections.
- handle_sendmsg(): same backpressure check for sendmsg path.
initfs tools/src/lib.rs:
- Replace hardcoded PAGE_SIZE=4096 constant with runtime detection via
sysconf(_SC_PAGESIZE). Handles 16K/64K page ARM hardware correctly.
Falls back to 4096 with logged warning if sysconf fails or returns
an invalid value.
Add diagnostics to pin down where the INIT_NOTIFY fd handoff hangs:
- init/src/service.rs: log read_pipe fd and call_ro results
- daemon/src/lib.rs: log cap_fd, write_pipe, and call_wo result
- logd/src/main.rs: explicit ready_sync_scheme result and setrens fallback
These are temporary diagnostics for the boot-hang investigation.
Per local/docs/PATCH-PRESERVATION-AUDIT-2026-07-12.md the base
fork was carrying only 38 of 100 patches in local/patches/base/.
The other 62 patches' content was silently missing from the fork
working tree, even though their .patch files were preserved.
This commit re-applies 41 patches that genuinely still apply
cleanly + 17 hunks that partially applied. Recovery covers:
- D-Bus initfs service wiring (P4-initfs-dbus-services)
- USB service wiring (P4-initfs-usb-drm-services)
- netcfg/dhcp/dhcpv6 driver fixes
- acpid shutdown/PM/quirk fixes
- inputd/ps2d hard-fail logging
- pcid driver interface refinements (server cmd channel)
- virtio-core for VirtualBox support
- ixgbed/rtl8139/rtl8168 net drivers
- ahcid NCQ + per-function interrupt coalescing
- logd persistent logging
- bootstrap procmgr race-condition fixes
- cargo version pin to +rb0.3.0 (synchronized release branch)
58 files changed, +1444/-318 lines.
Untracked mnt/ tree and *.orig / *.rej files cleaned up after
patch application (leftover from absolute-path patch headers).
This should not block and ensures that logs will still show up on the
serial port even if one of the log sinks blocks because for example the
graphics driver crashed, taking fbbootlogd with it. In the future we
might want to have a dedicated worker per log sink, but for now this
helps a log with debugging the graphics subsystem in a VM.
Unfortunately the scheme still has to be created by the daemon due to a
kernel bug, but once that is fixed, it would allow delayed spawning of
scheme daemons.
I hadn't meant to upstream it yet. I accidentally added it in a commit
touching the netstack. In any case this commit integrates the kernel log
copying directly into LogScheme.
The kernel log copying is meant to show the kernel log on the fbbootlogd
rendered bootlog. Even once the kernel graphical debug has been disabled
or if it never got enabled due to the bootloader not presenting a
framebuffer.
This avoid a deadlock when the process logging things is directly or
indirectly involved in receiving them too. Currently there is a
workaround for a part of this problem in fbbootlogd, but doing it
directly in logd is a lot simpler and catches more cases.