Linux-телефоныEnglish·Русский

Исследования

На что смотрели, прежде чем действовать: вопрос, что нашли и на чём это стоит.

How are tests organised, shipped and provisioned on Linux phones (postmarketOS, bootrr, LAVA, CI-tron, systemd), where do rust-script tests plus a bundle crate fit, and should we build fully on postmarketOS upstream?

postmarketOS (postmarketos-test subpackages, initramfs hook), bootrr, LAVA and CI-tron share one shape: a test is a small executable, a thin runner prints one pass/fail/skip line per case, the lab collects the lines, device facts live as data. Nobody compiles on the device. rust-script compiles on first run and needs rust+cargo on the phone (Alpine aarch64: 72 MiB download, 206 MiB installed plus gcc/musl-dev/llvm-libs, network for crates): fine on the lab, poor on a phone. A bundle crate that depends on tests (nextest discovery, inventory/linkme) is sound as design but unproven on aarch64 musl; one binary per test found by directory gives the same independence. Provisioning: an apk gives versions, uninstall and signatures at the price of a key and a repository (ours is published); a lab push is fast and leaves no version record. UPSTREAM (checked 2026-11-17; their sites now redirect to nura.eco): MRs on their GitLab with Alpine-style commit rules and approval rules; on-device tests are postmarketos-test-* subpackages run by an initramfs hook that halts the boot; only kernel/initramfs tests work today, boot and system tests (modem, Wi-Fi, audio, sleep - what we need) are not built; their farm is a CI-tron gateway with one OnePlus 6T, joining is token-gated and undocumented; Python is host-side only (pipeline generation, pmbootstrap) and costs nothing on the phone. Whether rhizcuts handle a GitLab subfolder is not known. Weighed: fully upstream (A), our runner with upstreamable shell files in their shape (B), a different shape (C). Chosen B. Not known yet: pmaports licence/CLA, fork-sync cost, bootrr contribution policy, rust-script cache path, inventory/linkme on aarch64 musl, the systemd claims (memory only).

2026-11-17

Should linux-phone-oco's tools share one prefix (lpoco-bringup, lpoco-health; devlab, tone renamed or not), or none?

What is: lab-tools has devlab (host command, built from the clone, named in about 450 files of linux-phone-oco and in the MCP door's tool names), tone (a library crate and its command, not installed anywhere) and lpoco-health (a package shipped to phones, renamed from devlab-health when it became one, the old name kept as another name). Collisions checked 2026-11-17: crates.io already has a crate named tone (0.0.1); devlab, bringup and lpoco-bringup are not taken as crates, none is on the lab's PATH or in the Arch repositories. How others do it: git-* and cargo-* are discovered by the prefix itself (a subcommand is any git-NAME or cargo-NAME on PATH) and complete at the prompt; pmbootstrap and pmaports carry pm for postmarketOS across the whole family; systemd uses a suffix (*ctl) for the same purpose. In each, the prefix marks the tools others install, and it names whose they are. Finding: share the prefix where the tool is installed or pinned by others (lpoco-health, lpoco-bringup); keep the short names of the lab's own commands (devlab, tone) until they are installed elsewhere - renaming them now costs about 450 references, the installed path and the MCP tool names for no reader's gain, and the alias precedent (devlab-health kept as another name) makes the later rename cheap. A mixed family is acceptable when the rule is one sentence. Not known yet: when devlab is first pinned by a device repository (that triggers its rename).

  • rhizoid: fork, own and sync git dependencies - git-rhizoid Cutting (a fork owned and pinned), tracking branch pristine, patch branch merged from it, additive-only metadata: the model for patching a tool before upstream takes the change. CLI boundary typed, add/update/status stubbed.

2026-11-17

How do device repositories use, extend, send back to and update from a tools home, side by side with no rebase, and where does rhizoid fit?

The question: a home for bring-up tools must also let device repositories use them, extend them with device-specific parts, send useful changes back and pull updates in, their own changes side by side with no rebase each time (the author's words, relayed by the coordinator; the problem git-rhizoid was started for). Extends research bringup-tools-landscape. What is: the chain already decided (idealkb decision 2026-11-17-chain-follow-by-slice, research chain-follow-world): one pin-and-follow mechanism for data and briefs - a source names its generic files, a follower pins a release and keeps its own files, a changed generic file ends follow.sh with exit 3 and goes back as an upstream item (ikb upstream-item, form patch), weekly update-pins and a release gate; device bases follow idealkb and device-template that way. It lays a slice of files. Rhizoid (git-rhizoid.github.io, rhizoid repo) is for whole forks: a cutting is a fork owned and pinned, tracking branch pristine, patch branch merged from it, rhizoid's own metadata additive-only, so a diff of patch against tracking is a clean patch back; its CLI is typed but add/update/status are stubbed, its consumption side is open (design-consumption-side) and slice-consumption was added 2026-11-17 by the idealkb chain. devlab and lpoco-health already reach consumers as released packages (release-plz tags, the packaging conveyor), not as copied files. Finding: a tool is not a slice. Compiled logic is followed by a version pin, not by files laid into the follower, so the rebase trouble does not arise for the tool at all as long as a device never edits the tool's tree: its own parts live in its own repository, beside the tool, in three levels. (1) Data: device.toml [boot] and the files it names (initramfs skeleton, dtb variants). (2) Hooks: executables the manifest names for a step (shell where stupid simple), called with the paths in arguments, a nonzero exit stops the job. (3) Logic: a rust-script file (or a small crate) in the device repository whose header depends on bringup's library at the pinned tag (rust-script and cargo take a git tag as a dependency). Only two things then need the follow machinery: the pin (a version line the follower owns) and the slice of files that go with the tool in device-template (the [boot] skeleton, hook examples). Sending back: a generic improvement is a pull request to lab-tools from the device's branch, recorded in the device base as an upstream item (form patch) against a lab-tools upstream row seeded beside idealkb and device-template; an update comes by a pin bump (the weekly job, a pull request per source). Side by side: the device's changes are files of its own, so a pin bump touches none of them; when a device must patch the tool itself before upstream takes it, that is a cutting of lab-tools consumed as a git dependency (Cargo [patch]) - rhizoid's exact case, rare because the three levels cover most. Where rhizoid carries it, and what it lacks (recorded on its own backlog, git-rhizoid.github.io PR 28, not worked around): a cutting consumed by a language manager - writing and bumping the pin where cargo or rust-script reads it (cutting-as-cargo-dependency); one pin file, one bump, one verdict for slices, cuttings and tool versions together (followers-one-pin-bump); sending a patch back as a pull request on the person's word with the follower's own record of it (send-back-writes-the-upstream-item); and slice-consumption (already open) for the template files. Until rhizoid has them: idealkb's follow.sh and update-pins for the slices, a plain fork with a [patch] line for the rare cutting, recorded as a problem. Not known yet: whether bringup's library API can stay stable enough for the third level while it is 0.x (the first builder's test of pin refusal tells); whether a host binary release (asset) or cargo install --git is the simpler install for a device lab (bringup-release settles it).

2026-11-17

Does abootimg-oxide write header v0 byte-exact, or must pack wrap mkbootimg?

Measured 2026-11-17 with a scratch program against mkbootimg (android-tools, header v0, base 0, kernel 0x8000, ramdisk 0x1000000, tags 0x100, page 4096): the crate's header write gave bytes identical to mkbootimg for the whole length it wrote. Two gaps, both ours to fill: (1) full_write only seeks to boot_image_size, so the image ends before the last page's padding (15288 of 16384 bytes) - pack pads itself; (2) the header id: mkbootimg's v0 id is SHA-1 over kernel, ramdisk and second, each followed by its u32 size (three parts), while the crate's compute_hash_digest hashes five (adds recovery dtbo and dtb) - so for v0 the id is computed in our code. With both, pack equals mkbootimg for the plain header and with os_version/os_patch_level words (tests/pack_v0.rs, two cases). mkbootimg writes second address 0 when there is no second image, whatever second_offset says. Header::parse reads v0..v2 and v3/v4; this tool reads v0 only for now. Cost: binrw and thiserror come with the crate. Not known yet: v1/v2 write parity, vendor_boot.

2026-11-17

Should all lpoco tools sit under one command, one pin and one release (the author: one roof), and in what form?

Asked by the author after the prefix amendment: the point was to gather all tools of lpoco under one roof. Forms: (a) one lpoco command with subcommands, as git and cargo do - a dispatcher that runs lpoco-NAME found beside it or on PATH; (b) every tool renamed lpoco-* now, released together; (c) the prefix rule with devlab and tone deferred (the first amendment). What a roof buys: one install, one pin in device.toml [tools], one completion and man page, one MCP server, one place agents look. What it costs: ~450 references to devlab and the MCP tool names, softened by keeping the old names as other names (the lpoco-health precedent). Constraint: lpoco-health ships to phones as a small static binary (opt-level s, no tokio, no rmcp), so a single fat binary would grow the phone's program; a dispatcher keeps every tool its own crate and binary, testable and runnable alone. Finding: (a) as a dispatcher over lpoco-* programs, family released together with a version lockstep check, the new tool born as lpoco-bringup under it; devlab becomes lpoco lab (devlab kept as another name), tone lpoco tone, the MCP door becomes lpoco mcp. Not known yet: whether release-plz makes one family tag easily (the builder of lpoco-dispatcher settles it); whether a feature-gated single binary would later be simpler.

  • rhizoid: fork, own and sync git dependencies - git-rhizoid Cutting (a fork owned and pinned), tracking branch pristine, patch branch merged from it, additive-only metadata: the model for patching a tool before upstream takes the change. CLI boundary typed, add/update/status stubbed.

2026-11-17

What exists to build, unpack, swap and check Android boot images and initramfs for a phone bring-up, and what does walleye's shell do today?

What is: walleye's bring-up is 8 POSIX shell scripts (~520 lines) in google-walleye-lab/build plus tests/host/gadget-up.sh; they call mkbootimg, unpack_bootimg and avbtool (Python from android-tools), the kernel's gen_init_cpio, lz4, fdtget/fdtdump, with their own checks (check-bootimg, check-bisect count fields and fail). Their knowledge is worth keeping: header v0 offsets by variant, the appended dtb, the lz4 frame shape of the stock kernel, the AVB hash footer (algorithm NONE, padded to the control's size), the NET=43 address rewrite, xz because the 4.4 kernel has no gzip. surya's bring-up had no scripts (by hand). Earlier records already decided the family: backlog rust-toolset (one Rust toolset in lab-tools, rust-script for small scripts, pmbootstrap read as reference) and decision 2026-11-17-health-checks-shell-and-rust (shell for plain readings, Rust for logic, rust-script for prototypes and one-offs). Others: nothing covers the whole job. Android's mkbootimg/unpack_bootimg/repack_bootimg and avbtool (Python) are the authoritative oracles; magiskboot (Rust+C++, GPL) has the model of swapping one part (unpack to a directory, change, repack with the original as template) but is aimed at rooting; abootimg-oxide 0.5.2 (Rust, MIT/Apache, 2026-06) reads and writes header v0-v4 and vendor_boot; abootcrafter has an update flow, no AVB; abl-exorcist (Rust, GPL) shells out to mkbootimg; no AVB crate exists on crates.io (avbroot, GPL, does vbmeta, is no library). Rust crates for the rest: cpio 0.4.2 (newc writer), flate2, lz4_flex (maintained), dtoolkit 0.5.0 (Google, dtb read/edit, young), fdt (read). pmbootstrap is Python, ~24k lines in 129 files; its deviceinfo names (header_version, base, kernel_offset, ramdisk_offset, tags_offset, pagesize, cmdline) are the vocabulary to reuse; the boot image is not built there. Mobian, Droidian (initramfs-tools-halium: shell hooks for an initramfs only), lk2nd (a bootloader, no host tooling): nothing to take. No tool checks an image against expected header fields; unpack_bootimg plus a comparison is all there is, which is what our check scripts do. Not known yet: whether abootimg-oxide writes byte-identical v0 images; dtoolkit's maturity; whether cpio 0.4.2 reads; whether boot-deploy, Mobian and Halium scripts add anything (not read; the outside look was done by a read-only researcher from page summaries, so counts are weaker than a source read). Where tools live today: lab-tools (its README: tools for bringing up and testing Linux phones, not tied to one device) is the one place already: devlab (the phone: fastboot, flash, kernel try, provision, keeper, health, MCP; 5.4k lines with rmcp and tokio), health (runs on the phone) and tone. Device repos hold data and thin scripts.

2026-11-17

What already exists for measuring a phone's health on the phone, shipping it there, and letting agents work with it - in postmarketOS and in our own commons?

postmarketOS (docs.postmarketos.org/pmaports/main/ci/hardware-ci.html): tests ship as small shell files in postmarketos-test-* packages (suspend by an RTC wake alarm; bootrr, which checks per board, keyed by the device tree's compatible, that every expected driver probed) and run in the initramfs CI hook on their hardware CI (CI-tron gateway); surya has no bootrr board file yet. In the commons: the package conveyor (linux-package-distribution-oco/conveyor) already builds static aarch64-musl binaries with signed provenance and plans signed Alpine repositories for postmarketOS (cv-apk) and machines that receive updates, the phone next (cv-machines-refresh); agent access (creation-guidelines/agent-access-oco) plans every tool's structured door offered over MCP, in Rust with rmcp, naming devlab among the first (aa-two-doors). In lab-tools itself: devlab test ran surya's checks from the lab over SSH, health kept a baseline of what ever passed, watch ran health after each boot from the lab - nothing ran on the phone by itself, and the checks were one surya-specific file.

2026-11-17

How does the lab host get prepared for the devices it serves, from each device repository's device.toml, by a tool under the lpoco roof, with no manual step outside a tool - and how do others do it?

INSIDE. Nothing prepares the lab host from declarations today; each part got there by hand or by a one-machine script. Measured read-only on the lab (grig, systemd 262): the lab user (uid 1000) is in neither disk (/dev/sdX) nor uucp (/dev/ttyACM* on Arch), so walleye's gadget nodes were unreadable after the reboot; uaccess would reach that uid while it holds the active seat0 session (it does: Plasma on tty2), but nothing tags our gadget. /etc/udev/rules.d/51-android.rules (MODE 0666 for vendors 18d1, 05c6, 2717; group plugdev, absent here) came from lab-agent's connect.sh, run by hand; android-udev and systemd 262's own hwdb tags already cover adb and fastboot, and none of it covers block or tty. usb_storage and cdc_acm could not load today until the host was rebooted into its installed kernel (the running kernel's modules were gone). The aarch64 musl Rust toolchain in ~/.local/share/devlab-cross (health/build.sh) is unrecorded hand work. devlab-watch@ units come from lab-machine setup/devlab-watch.sh, enabled by hand per device (surya yes, walleye no). The host's own tools are hand copies: ~/.local/bin/land (from grenudi/lab-machine bin/land), oco-work (its only tracked home is creation-guidelines/lab-agent oco-agent/tools/oco-work, a place that is retiring), devlab and its .before-* copies; agent-env is sourced from the ideal-agent clone or plugin; tad and ikb by their install scripts; nothing names their versions. Root is only `sudo -n lab-agent root-exec --` (devlab reads DEVLAB_ROOT); ideal-agent's 2026-11-17-lab-agent-retires-by-parts part 6 moves it to a lab-root wrapper in lab-machine or narrower per-command grants, written by the author and root. walleye's device.toml already declares [host] modules usb_storage, cdc_acm and [[host.gadget]] serial walleye-first-boot, access block and tty (lab PR 54); devlab ignores the table (no deny_unknown_fields at the top). Session logs show root-exec used by hand today for fastboot devices, pacman -S (git send-email's perl modules), the host reboot, and ssh to the phone. OUTSIDE. Nobody derives host rules from per-device declarations. LAVA declares per-device serials in data but ships one static rule calling a privileged helper; labgrid matches udev properties at run time and leaves rules to the administrator; pmbootstrap writes no rules and runs flashers as root in its chroot (whole-command doas/sudo/run0, no dry plan, a teardown verb); android-udev-rules grants MODE 0660, GROUP adbusers and TAG uaccess in one line at 51; NixOS merges rule files from many modules by name and puts extraRules at 99, too late for uaccess; Ansible's check mode is the dry plan with a diff. systemd (source and NEWS): uaccess grants only the seat's active session, so ssh-only users and services get nothing; a rule setting it must sort before 73 and must not be add-only since 258; 258+ tags ADB and fastboot by itself; 260 adds xaccess-debug-appliance for headless sessions asking through PAM; only GROUP/MODE covers services. `udevadm trigger --action=change` re-applies GROUP, MODE and uaccess to present nodes, no replug. TAKEN. A rule file per device below 73, ACTION!="remove", matching the gadget serial on the parent (ATTRS{serial}), TAG+="uaccess"; a lab group with MODE 0660 later for a headless host; nothing by vendor for adb/fastboot (systemd covers it, a check proves it); a plan that is a content diff per file plus the exact root commands, the verb writing, reloading and triggering change only where it touched; modules-load.d only for declared modules, with "the running kernel has no modules: reboot" said by the plan; root by one prefix and a printed fixed list of commands, the list a narrow grant is written from.

2026-11-17

Where does preparing the lab host stand, and what is next?

How it stands, 2026-11-17 night. Decided, not built: lpoco-host (`lpoco host plan | prepare now | check`), a new crate in lab-tools under the lpoco roof (decision 2026-11-17-lpoco-host, research lab-host-prepare-landscape). Next for the lab-tools builder: backlog lpoco-host, rank 1, needs build, device google-walleye - its first test host/tests/plan.rs plan_grants_gadget_serial_and_changes_nothing does not exist yet and must fail first, then plan_lists_host_tools_at_pins_and_installs_nothing; acceptance is the tool's first real use on the lab: prepare now grants walleye-first-boot, the walleye keeper reads /dev/sda and /dev/ttyACM0 as the lab user. The walleye lane waits on it (its base: walleye-host-access-via-lab-prepare and the two retry items). Declared already: walleye device.toml [host] (lab PR 54). Not yet: a lab.toml in grenudi/lab-machine (the builder proposes it there with the tools at today's versions); a living home for oco-work (today only in the retiring creation-guidelines/lab-agent); the narrow root grant (ideal-agent lab-agent-6-root-exec-grant, the author's) - meanwhile root goes through LPOCO_ROOT/DEVLAB_ROOT/root-exec. The host on 2026-11-17: systemd 262, lab user on seat0, no rule for our gadget, 51-android.rules a hand leftover, usb_storage loaded, cross toolchain in ~/.local/share/devlab-cross by hand, devlab-watch@surya-lab only, land and oco-work hand copies. Later: lpoco-host-rest (headless group, watchers, cross targets, host commands, foreign rules named, NCM).

2026-11-17