Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ that specific device and motherboard (`magc6735_65u_1_m0`, firmware branch `P45`
<img src="assets/screenshots/settings.png" width="260" alt="Settings for brightness, screen timeout, PIN and estimated charge limit">
</p>

Unmodified framebuffer captures from the device: the boot screen and settings
with the charge limit. `~80%` is an estimate based on open-circuit voltage,
not an independently calibrated state of charge. The original interface is in Dutch.
These earlier framebuffer captures show the boot screen and charge-limit settings.
The `~80%` label in the screenshot comes from the voltage-based interface
that preceded the HW-CAR fuel gauge. The original interface is in Dutch.
[Screenshot provenance and limitations](docs/SCREENSHOTS.md).

## Why this project?
Expand All @@ -55,28 +55,37 @@ malicious behavior. [A short history](docs/HISTORY.md).

## What works now?

Status: **22 November 2026** (separating the historical 2–5 November v9 baseline,
later v10c/B5 device checks, and source-only hardening/Rust tooling). “Yes” means
demonstrated on this device; [the detailed status](docs/STATUS.md) describes the
exact tests and limitations.
On **23 November 2026**, all six Rust programs in B5's `/usr/libexec/i14-rs/`
and its soak sampler matched the ARM64 musl release hashes. All 12 default
OpenRC services and four supervised Rust daemons were running. The hardware
probe passed 8/8 checks. Earlier tests still supply the evidence for several
features below. [Dated checks and limitations](docs/STATUS.md).

| Component | Working | Notes |
| --- | --- | --- |
| Native Alpine, storage and reboot | Yes | Linux rootfs (`B5`) on eMMC with `v10c` boot image, OpenRC and `apk` |
| Display and touch controls | Yes | Custom framebuffer interface and on-screen keyboard |
| On-device terminal | Historical / disabled in hardened DNS image | Exercised in the 2–5 Nov v9 baseline; disabled in the hardened DNS image on `main` (see [docs/DEVELOPMENT.md](docs/DEVELOPMENT.md)) |
| Wi-Fi and SSH | Yes | On-screen network selection and SSH key authentication |
| USB management and rescue mode | Yes | USB networking (`172.16.42.1`) and rescue mode; hardened source restricts normal USB management to SSH keys and uses locally activated, authenticated serial rescue |
| Backup DNS | Yes | Tested on UDP/TCP port 53, with DNS-over-TLS and DNSSEC; verify Unbound security advisories before exposing to LAN clients (see [SECURITY.md](SECURITY.md)) |
| USB management and rescue mode | Yes | USB networking and rescue mode; hardened source restricts normal USB management to SSH keys and uses locally activated, authenticated serial rescue |
| Backup DNS | Local health check passed | B5 answered `i14-health.invalid` with `192.0.2.1`. Keep the candidate DNS client list empty until the installed Unbound security gaps are fixed. [Security policy](SECURITY.md). |
| Brightness, screen timeout, PIN and power menu | Yes | Implemented and exercised on the device |
| Charging and configurable charge limit | Partially | Charging works; BCCT pause/resume tested, full calibration/charge-band acceptance still pending |
| Battery gauge and home-screen ETA | Deployed on B5 | The HW-CAR coulomb counter tracks remaining charge. The UI estimates time to the charge limit or time left on discharge. |
| CPU control with the screen off | Yes | Downclocking works; energy savings have not been established |
| Rust userspace & host tools | Source / host-verified | 12-crate workspace (`rust/`) with offline backup verifier (`i14-verify-backup`) and ARM64 musl builds; full on-device migration acceptance open |
| Rust userspace & host tools | Phone binaries verified on B5 | The UI, charge guard, CPU controller and netwatch ran under OpenRC supervision. Paired Rust/Python performance measurements remain open. |
| Bluetooth | Partially | Radio and scanning work; pairing and device use are not implemented |
| Audio, camera, GPS, calls and mobile data | Not verified | No complete, accepted Linux support |
| Modern mainline kernel | Partially | Earlier native boot demonstrated; not a complete replacement for 3.18 |
| Docker | No | Not supported by the current kernel |
| Multi-day reliability / recovery from an empty battery | Partially | Acceptance window B passed for its measured version; 48-hour Soak C and nearly-empty recovery remain open |
| Multi-day reliability / recovery from an empty battery | Partially | Window B passed for its measured version. Soak C collector commissioning passed on 23 November. The uninterrupted 48-hour window and post-soak H3 measurements remain open. Nearly-empty recovery is on owner hold. |

On 23 November the gauge reported `gauge_mode: "hw_car"`, remaining charge
(`q_rem_mah`) and estimated full capacity (`q_full_mah`). Both snapshots
reported `anchored: false`. The UI shows `~N%` until the gauge records an
anchor, then `N%`. Replaying those snapshots on the host produced discharge
ETAs. The SSH check did not observe the screen. Two-cycle C13 calibration
remains open.

## How does it work?

Expand Down Expand Up @@ -117,6 +126,7 @@ Building requires additional tools and files from the device itself.
- [History and suspicious preinstalled software](docs/HISTORY.md)
- [Screenshots and provenance](docs/SCREENSHOTS.md)
- [Development environment and build limitations](docs/DEVELOPMENT.md)
- [Offline DNS and power soak correlator](docs/SOAK-CORRELATE.md)
- [Rootfs trial and rollback](docs/ROOTFS-SWAP-ROLLBACK.md)
- [K70 recovery-timing analyzer](docs/K70-RECOVERY-TIMING.md)
- [Security policy](SECURITY.md)
Expand Down
5 changes: 5 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ python3 -B initramfs/test-usb-network.py
python3 -B initramfs/test-display-packaging.py
```

The rootfs builder uses `rootfs/make-android-props.py` to write the Android 6
property area for the MediaTek Wi-Fi tools. With Cargo available, the Python
host suite builds `i14-make-android-props` and compares the two writers'
output bytes, path handling and exit codes in temporary directories.

For the Rust workspace (pinned to Rust `1.98.1` in `rust/rust-toolchain.toml`
and `rust/mise.toml`; see [rust/README.md](../rust/README.md)):

Expand Down
40 changes: 32 additions & 8 deletions docs/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# I14 Linux Roadmap & Acceptance Gates

This roadmap summarizes the active engineering milestones and remaining device
acceptance gates as of 22 November 2026. The near-term goal is a maintained
acceptance gates as of 23 November 2026. The near-term goal is a maintained
source baseline on `main`, verified offline backup tooling, and measured
acceptance of one production Alpine image on the stock 3.18.19 kernel. Linux 7
mainline bring-up is a separate track with its own recovery gate.

Window B was accepted for its measured version. `B5` is the latest recorded
restoration baseline. Python remains in the image alongside the Rust workspace
for parity comparisons and recovery.
restoration baseline. On 23 November, all seven deployed ARM64 musl binaries
matched the release hashes, and the hardware probe passed 8/8 checks. Python
remains in the image for parity comparisons and recovery.

## 1. Source baseline & host verification

Expand All @@ -20,6 +21,14 @@ for parity comparisons and recovery.
`rust/crates/i14-tools`) covering SHA-256 manifests, primary/backup GPT
headers and entry arrays, and all 23 partition lengths. File integrity checks
and physical restore remain separate acceptance criteria.
- PR #3 added offline rootfs trial staging and verification
([swap tool](../scripts/i14-rootfs-swap.py)), Soak C observer/export/receive
checks, C13 launcher deadlines, M0 host timing anchors and fastboot
diagnostic parity.
- The [offline DNS/power correlator](SOAK-CORRELATE.md) processed 199/199
usable intervals from 200 real B5 power samples with synthetic DNS answers.
The Rust `i14-make-android-props` host tool matched the Python writer's
128 KiB output byte-for-byte.

## 2. Stock-kernel device acceptance items

Expand All @@ -28,13 +37,24 @@ partition, image hash, source revision and rollback status. Never read
`current_cmd` during charging tests (reading it disables charging). Keep
firmware dumps, images, credentials and raw captures outside Git.

### Security-hardened stock boot image and rootfs

Deploy and accept the new boot image and rootfs together. Verify locally
activated, authenticated USB rescue, the fail-closed dual-stack firewall and
private settings permissions (`0700` directory, `0600` files). B5 answered the
local DNS health query on 23 November. Its installed `unbound-1.25.2-r2` lacks
the fixes for CVE-2026-81634 and CVE-2026-96405. Keep `dns-clients.conf`
empty for acceptance until the candidate package manifest confirms both fixes.
[Build and package requirements](DEVELOPMENT.md).

### Unattended collector & 48-hour Soak C (H2/H3)

The [H1, Soak C and H3 execution sequence](verification/H1-SOAK-C.md) lists
the commissioning steps, commands and evidence required for these gates.

- Commission a phone-local collector and export path with bounded retention and
clean process teardown before starting a 48-hour acceptance window.
- Commissioning passed on B5 on 23 November. Root `crond` completed a bounded
capture, the original crontab was restored byte-for-byte and no collector or
lock remained. The receiver verified all 18 streamed files (9,715,485 bytes).
- Freeze exact boot/rootfs identity, runtime hashes, sampler and probe settings,
and audit conditions 0–5 (`scripts/i14-window-audit.py`), then run 48
uninterrupted hours and record the verdict plus read-only Rust CPU/memory
Expand All @@ -53,15 +73,19 @@ the commissioning steps, commands and evidence required for these gates.
`5,167,890,432` bytes while keeping the active `B5` image, historical
rollback copy and trial records intact.
- Current disposition remains `KEEP_B5 / R_DEFERRED_INTEGRITY` until a fresh
candidate image, pre-Unbound `root.key` carry proof, automatic rollback
rehearsal (`docs/ROOTFS-SWAP-ROLLBACK.md`), and full restoration verification
candidate image, pre-Unbound `root.key` carry proof, [automatic rollback
rehearsal](ROOTFS-SWAP-ROLLBACK.md), and full restoration verification
are accepted.

### Battery calibration (C13)
### Battery calibration (C13) and the 80% charge band

- B5 reported `gauge_mode: "hw_car"` and `anchored: false` on 23 November.
The capacity estimate still needs calibration.
- Verify userdata free space, log retention budget and unattended supervision
(`scripts/i14-calibration-launch.py`) before running a bounded two-cycle
calibration campaign (fit on cycle 1, independent holdout on cycle 2).
- Verify a full natural stop/resume cycle at an unchanged 80% limit and
hysteresis after the guard crashes inside the band.
See the [C13 and production charge-band sequence](C13-READINESS.md).

### Nearly-empty recovery (D)
Expand Down
44 changes: 44 additions & 0 deletions docs/SOAK-CORRELATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Correlate DNS failures with sampled power

Use the offline correlator to find which DNS checks failed and whether the phone reported external power around each unplanned failure. Run it on the host with existing log files and Python 3.10 or newer.

```sh
python3 -B scripts/i14-soak-correlate.py \
--dns dns.csv.1 --dns dns.csv \
--power samples.jsonl.1 --power samples.jsonl \
--maintenance maintenance.txt \
--dns-max-gap-seconds 360 --power-max-gap-seconds 180
```

Supply rotations oldest first. Choose gap limits for the recording cadence and the delay you consider acceptable. Both limits are required. You can omit power and maintenance inputs.

## What to read in the report

The command writes one JSON object with schema `i14-soak-correlate/1`. Start with `coverage.status` and `coverage.gaps`. Coverage spans the first through the last DNS observation. A single observation gives incomplete coverage. Between successive observations, the tool subtracts planned maintenance and reports each remaining gap strictly longer than the DNS limit.

`dns` counts passed, planned-failure and unplanned-failure observations. A probe with several failed checks counts once. `unplanned_failures` lists each such observation's UTC time, failed check names, and `external_power`. The totals by power state appear in `unplanned_by_power_state`.

| Exit | Meaning | Output |
| --- | --- | --- |
| 0 | DNS coverage complete and all failures, if any, were planned | JSON on stdout |
| 1 | DNS coverage complete with at least one unplanned failure | JSON on stdout |
| 2 | DNS coverage incomplete | JSON on stdout, including observed failures |
| 2 | Invalid arguments or input | Diagnostic on stderr, empty stdout |

## Input files

- **DNS CSV** comes from `scripts/i14-dns-soak.py`. Each file needs its recorder header and one physical line per probe. The five expected results in order are `NOERROR`, `NOERROR`, `NOERROR`, `NOERROR+AD`, and `SERVFAIL`. A different nonempty answer counts as a failure. Each latency must be an unsigned decimal integer between zero and 2⁶³−1 milliseconds.
- **Power JSONL** uses the top-level fields in the soak sampler's `samples.jsonl`. Each line needs a numeric POSIX `epoch`, a nonempty string `boot_id`, and numeric nonnegative `uptime_seconds`. The numeric `usb_online` and `ac_online` fields can each be 0, 1, null or absent. Other fields, including the sampler's own DNS check, are ignored. Duplicate JSON keys and nonstandard JSON constants invalidate a sample.
- **Maintenance** takes one `START END [reason]` per line. Blank lines and lines starting with `#` are allowed. Both endpoints are inclusive. Touching or overlapping windows merge. A point window splits a gap at that instant and exempts only a failure recorded at that instant.

All inputs use UTF-8. Each DNS or power file can contain up to 16 MiB, each maintenance file up to 1 MiB. At least one DNS observation is required. DNS and maintenance timestamps use a date and time with seconds, optionally a fraction through nanoseconds and a UTC offset. A missing offset means UTC. Use `T` between date and time in the whitespace-delimited maintenance file.

Each input stream must be chronological across rotations. Adjacent identical observations at one instant collapse. A different DNS answer or latency at the same instant, conflicting power fields, or a timestamp moving backwards produces an error. Power comparisons use the five fields above and treat absent and null online flags alike. Time comparisons use integer nanoseconds.

## Interpreting power

A failure at time `t` uses the left sample of the adjacent interval `[a, b)` containing `t`. Both samples must share a boot ID. Elapsed wall time and uptime must each increase by at most the selected power gap and agree within two seconds. Either online flag equal to 1 yields `online`. Two zeros yield `offline`.

An `unknown` state includes a `power_reason` naming the missing evidence, such as a reboot, clock disagreement, or absent online flags. The last power sample cannot establish an interval on its own. The clocks of both recorders must already be aligned. Power changes between samples can go unseen, and a matching time alone cannot establish why DNS failed.

The JSON contains file counts, timestamps and check names. File errors include the supplied path and, when available, the line number.
Loading