Repository navigation
emOS: make /dev from sysfs, not from biscuit's numbers - #1034
Merged
Merged
Conversation
init mknod'd every node from a table read off a biscuit. Majors such as
ttyGS's are allocated at boot, so on the Echo Dot 3 (donut, 41C8) ttyGS0
is 246:0 and 247:0 is the jack detector: the console's shell opened that,
`svc console failing fast` in the trail, and the USB console sat silent.
The sound minors differ by board too.
init now reads what ueventd would: /sys/dev/{char,block}/*/uevent, making
/dev/<DEVNAME> (block under /dev/block) with DEVMODE where the kernel gives
one, which is exactly the 0666 set the hand-written calls chose. A walk only
adds nodes, so it runs again where drivers appear late: while waiting for
the gadget's tty, after wmt_loader registers stpwmt/stpbt, and before the
wmtWifi write. Names that are absolute or contain a `..` component are
refused. The umask handling moves into the walk, since rescans run after
PID 1 is back at 022.
devcheck.c drives the real parser with uevent text read off biscuit (VVV,
3.18) and the Dot 3 (41C8, 4.4), the format's edges, and the whole walk
over a fake /sys/dev with mknod intercepted so CI needs no root. Mutating
the default mode or the `..` guard fails it. Wired into ci.yml and the
emOS release checks.
On 41C8 under emOS: shell on the console, ttyGS0 246:0, /dev/null 0666,
snd, input and every mmcblk0p* node present, system_b and /data mounted.
Partitions by name waits for the packer's boot-partition stamp, because
biscuit's names carry an _x suffix that varies by device.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BofN7aQbgNvVKNVXdGNR2f
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.
emOS's init now makes
/devfrom what the kernel lists in sysfs instead of a table of numbers read off a biscuit. That table was wrong on the Echo Dot 3, where it left the USB console silent. Tested on 41C8 (Dot 3), C95, 15LE and 035T (radar).Why
Device majors such as
ttyGS's are allocated at boot. On the Dot 3ttyGS0is 246:0 and 247:0 is the jack detector, so the console's shell opened that and sat silent. The sound minors differ by board as well. This is step 3a of emOS on the Dot 3 (donut).What changed
mknodes()reads/sys/dev/{char,block}/*/uevent(MAJOR,MINOR,DEVNAME,DEVMODE), the same source devtmpfs uses, and makes each node.DEVMODEgives exactly the 0666 set the old hand-written calls chose.wmt_loader, and before thewmtWifiwrite. A scan only adds nodes, so repeating it is safe...component are refused.devcheck.c, a new off-target check, runs the real parser against uevent text read off VVV (3.18) and 41C8 (4.4), the format's edge cases, and a full scan over a fake/sys/devwithmknodintercepted, so it needs no root. Breaking the default mode or the..guard makes it fail. It's wired intoci.ymland the emOS release checks.Partitions by name are not in this PR. They wait for the packer's boot-partition stamp (3b), because biscuit's partition names carry an
_xsuffix that varies by device.Tested on hardware
Each device got its own boot image with only
/initswapped, repacked withem_emos_build.packafter a byte-exact roundtrip, and the write was read back before rebooting.ttyGS0246:0,/dev/null0666, snd/input/all partitions, system_b and/datamountedttyGS0247:0, WMT nodes, WiFi, registered with the dev controller; trial-timer reboot once, then confirmedAll eight existing emOS checks still pass.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BofN7aQbgNvVKNVXdGNR2f