node id is hardware-derived on embedded; retire the bootstrap log sink - #564
Open
TurkeyMan wants to merge 1 commit into
Open
node id is hardware-derived on embedded; retire the bootstrap log sink#564TurkeyMan wants to merge 1 commit into
TurkeyMan wants to merge 1 commit into
Conversation
A micro has no writable config to persist an id in, and generating a fresh one each boot would churn peering identity, so node_id() now takes the chip-burned id or reports the platform gap. Generation and conf/node.id are desktop only. The bootstrap log sink wrote raw to stdout until a /log/sink object replaced it, but a console session streaming the log registers a consumer instead, so on a single-wire console it never retired and raced the session for the UART.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small fixes in
src/manager, both found bringing up a bare-metal target with a single UART.Node identity is hardware-derived on embedded.
node_id()already prefers a chip-burned id where the platform has one, and falls back to generating a random id and persisting it toconf/node.id. On a micro that fallback is wrong twice over: there is no writable config to persist to, and a fresh id every boot would churn peering identity across reboots. The observed result was a warning on every boot and an ephemeral identity:Generation and the file are now desktop-only. An embedded platform without
unique_device_id()reports the gap rather than papering over it — which makes it a concrete piece of platform work (ESP32 already implements it; BK7231 needs efuse / RF-calibration MAC).Retire the bootstrap log sink when a consumer attaches.
The bootstrap sink writes raw to stdout before the command system exists, and is meant to be replaced "as soon as [the startup commands] can". It is only retired from a
/log/sinkobject'sstartup(). But a console session that streams the log —initial-command="/log/print --stream", which is how a single-wire console is configured — registers a consumer, not a sink object, so the handover never happened.With both live on one UART the output duplicated and interleaved mid-token:
register_consumernow retires it too.