Skip to content

os/v3: the install seed - the pinned medium, the autoinstall user-data and its check (engine#712) - #732

Merged
bong-water-water-bong merged 4 commits into
mainfrom
os/v3-seed
Nov 1, 2026
Merged

bong-water-water-bong merged 4 commits into
mainfrom
os/v3-seed

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

First slice of the os/v3 build (engine#712, design in #717): the install seed, and the part of v3
that can be proven with no device — a few seconds of shell, no QEMU, no stick.

os/v3/pin.txt — the medium pinned whole: ubuntu-26.04.1-live-server-amd64.iso,
2,927,861,760 bytes, sha256 cc8a95cd…, volume label Ubuntu-Server 26.04.1 LTS amd64 read out of the
ISO's own primary volume descriptor (block 16, offset 32768+40) rather than guessed from the file name,
because casper finds its squashfs by that label and by nothing else. v3 has no snapshot timestamp to pin
the way os/v2/pin.txt does: the installed base is unpacked from this ISO's own pool, so the ISO's sha256
is the base pin.

os/v3/seed.sh — render, check, selftest:

  • render <out-dir> writes the two files the stick carries in /1bit/: autoinstall.yaml and
    identity (0600, key=value for postinstall and prepare-stick.sh).
  • The target disk is matched by serial, so a stick cannot wipe a machine it was not written for and a
    re-run finds the same disk; interactive-sections: [] keeps the install unattended.
  • Storage: 1 GiB ESP, 64 GiB root with /boot on it and no swap partition, 1BIT-DATA takes the rest
    with preserve: true — which is at once the fresh-disk path and the v2 → v3 /data adoption.
  • The password comes from a file or --mint-password (printed once), never argv. The salt is derived
    from the seed's own identity, so two renders of the same inputs are byte-identical and a stick can
    be reviewed as a diff.
  • check validates a rendered seed: field formats, the 0600 mode, no unsubstituted placeholder, every
    substituted value, and the document's structure with PyYAML (not a grep) — including a refusal of a
    file:// apt source, which would outlive the stick (the trap docs: 1bit OS v3 - the installed machine is an Ubuntu 26.04 Server (engine#712) #717's review found).

os/v3/seed-selftest.sh — 31 checks, no device: a good seed is accepted, 15 bad inputs are refused
with the message that says why, and six structure regressions are caught by breaking the template on
purpose (no preserve: true, a file:// apt source, an unsubstituted placeholder, a root size the
identity does not have, a /data that is not 1BIT-DATA, an md5 password hash).

One naming decision this pins down: the account is onebit, not 1bit. A Linux user name starts with
a letter — adduser's default NAME_REGEX is ^[a-zA-Z][a-zA-Z0-9_-]*$ (measured in this box's
/etc/adduser.conf) and the installer applies the same rule, so 1bit is refused before the first byte
is written. seed.sh refuses it too, with that reason, and the selftest pins it. #717 carries the matching
doc change.

Verified on strixhalo: bash -n clean, shellcheck rc=0 (all severities), seed-selftest.sh 31/31,
tools/copyright.py --check rc=0, and a real render (--mint-password, a real ed25519 key) passes
check. Not proven here: that subiquity accepts this user-data — that is QEMU phase I, the next slice
(mkstick.sh, postinstall, steps).

…a and its check

The first slice of the v3 build (docs/os-v3.md, engine#712), and the part that can be proven with no
device:

- os/v3/pin.txt: the server ISO pinned whole - ubuntu-26.04.1-live-server-amd64.iso,
  2,927,861,760 bytes, sha256 cc8a95cd..., volume label 'Ubuntu-Server 26.04.1 LTS amd64' read out of
  the ISO's primary volume descriptor (block 16), because casper matches that label and nothing else.
  v3 has no snapshot timestamp to pin: the installed base is unpacked from this ISO's own pool.
- os/v3/seed.sh render: writes /1bit/autoinstall.yaml and /1bit/identity (0600) from the stick's
  inputs - the target disk by *serial* (a stick cannot wipe a machine it was not written for), the user
  onebit, a keys-only ssh, the storage table (1 GiB ESP, 64 GiB root, 1BIT-DATA = the rest with
  preserve: true, which is also the v2 -> v3 path), the twelve stock packages, the step hooks. The
  password is read from a file or minted and printed once, never argv; the salt is derived from the
  seed's own identity, so two renders of the same inputs are byte-identical and a stick is reviewable.
- os/v3/seed.sh check: validates a rendered seed - field formats, the 0600 mode, no unsubstituted
  placeholder, every substituted value, and the document's structure with PyYAML (not a grep) - and
  refuses a file:// apt source, which would outlive the stick.
- os/v3/seed-selftest.sh: 31 checks, no device: a good seed is accepted, 15 bad ones are refused with
  the right message, and six structure regressions are caught by breaking the template on purpose.

The account is onebit and not 1bit: a Linux user name starts with a letter (adduser's default
NAME_REGEX is ^[a-zA-Z][a-zA-Z0-9_-]*$, measured in /etc/adduser.conf, and the installer applies the
same rule), and the selftest pins that refusal.
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 25a7fe6)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

712 - Partially compliant

Compliant requirements:

  • The installed 1bit OS is an Ubuntu-based full OS (26.04 LTS server base)
  • The install process is unattended by autoinstall from the same stick
  • The build is in os/v3 next to os/v2
  • The build is designed to be gated by QEMU A/R/I/B + board install test

Non-compliant requirements:

  • The build has not yet been implemented in the tree (the PR only adds the seed, not the full build)

Requires further human verification:

  • The QEMU A/R/I/B + board install test gates are not yet implemented in this PR

717 - Partially compliant

Compliant requirements:

  • The design doc is provided in docs/os-v3.md
  • Partition layouts are defined (stick and target)
  • Autoinstall user-data is implemented with disk matching by serial and interactive-sections: []
  • Package set is defined
  • Install screen is described
  • Firmware boot entry is described
  • Upgrade path is described
  • Gates are described

Non-compliant requirements:

  • The actual build implementation is not included in this PR (only the seed)
  • The QEMU/board gates are not yet implemented in this PR

Requires further human verification:

  • The actual implementation of the build and gates is not included in this PR
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Potential Security Issue with Password Salt

The salt used for password hashing is derived from the stick's identity (serial, username, hostname) rather than a random value. While this ensures deterministic rendering for reviewability, it could potentially make the system more vulnerable to rainbow table attacks if the same inputs are used across multiple installations. The salt should be sufficiently random to prevent such attacks.

salt=$(printf '%s:%s:%s' "$SERIAL" "$USER_NAME" "$HOSTNAME" | sha256sum | cut -c1-16)
hash=$(printf '%s' "$plain" | openssl passwd -6 -salt "$salt" -stdin)
Insecure File Permissions

The autoinstall.yaml file is created with permissions 644, which allows group and world read access. This could expose sensitive information in the autoinstall configuration, such as the password hash and other configuration details. The file should be created with more restrictive permissions (e.g., 600) to prevent unauthorized access.

chmod 644 "$out/autoinstall.yaml"

A server-ISO smoke run (2.93 GB pinned ISO, ds=nocloud;s=/cdrom/1bit/ with user-data+meta-data) drove
subiquity unattended through our seed and found three defects, all fixed here:

- match: {serial: ...} is not a curtin disk match: it answers 'matched no disk'. The config now matches
  size: largest, and the serial the seed names is enforced before curtin runs, by /1bit/steps in
  early-commands (the guard refuses when the serial does not land on exactly the largest disk). check
  asserts 'size: largest' instead of the serial.
- flag: boot alone is not a bootloader partition: curtin stops with 'autoinstall config did not create
  needed bootloader partition'. The ESP partition now carries grub_device: true as well, and check
  refuses a seed without it (measured: with both, block-meta partitions the disk and all three
  partitions cleanly).
- late-commands ran curtin in-target on /cdrom/1bit/postinstall, but the target chroot has no /cdrom.
  postinstall now runs in the live environment - where the medium and the console are - and drives the
  target itself with curtin in-target per step, which is also what makes its step lines visible on tty1
  and ttyS0 while subiquity is up (#710).

selftest 32/32 (the ESP tamper case is new), shellcheck rc=0, copyright rc=0.
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit d86e034

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY

At d86e034f (os/v3/pin.txt +33, os/v3/seed.sh +444, os/v3/seed-selftest.sh +152). The first slice of os/v3, and it is the runnable kind: I ran its selftest.

$ ./os/v3/seed-selftest.sh
…
  PASS  check: identity mode 644
  PASS  check: the seed is accepted again
seed selftest: 32 pass, 0 fail
seed selftest PASS 32/32                                    (exit 0, no device, no root)

That is a real gate for a device-free component, and it covers the behaviour the page promises: seed.sh dies on a malformed password hash (valid_hash, crypt(3) $6$) and on a malformed disk serial (valid_serial), and the selftest's last rows exercise the --check refusals including file modes. bash -n clean on both scripts; pin.txt carries the full Apache header like the rest of the repo.

So seed.sh + pin.txt + seed-selftest.sh are in the tree, self-checking, and pass — which is also the thing #717 currently claims prematurely (see below).

One number for #717's sake: its page says seed-selftest.sh has "31 checks"; at this head the script reports 32 pass / 0 fail. Whichever is true after this merges, the page should quote the selftest's own line rather than a hand-kept count — that is exactly how the "31" drifted.

Not verified: that pin.txt's pinned server ISO matches the real artifact (it is "pinned at the first build" per the design, and the ISO is not on this box), and the rendered autoinstall user-data against a real curtin run — that is the os/v3 VM gate's job, and its phase V does not exist yet.

tprs-ready applied.

@bong-water-water-bong bong-water-water-bong added the tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 8123be3

bong-water-water-bong pushed a commit that referenced this pull request Nov 1, 2026
…nd split the firmware row

Review at dd9be3d, three points, all addressed:

- the page pointed at files that are not in this branch in the present tense
  (docs/os-v3-live-puppy-eval.md and os/v3/puppy/ -> #739; os/v3/pin.txt, seed.sh, seed-selftest.sh ->
  #732). They are now named with their PRs and the page says plainly that none of it is in this PR, so
  every sentence is true at any merge order. The '31 checks' figure was #732's file and is now 32 (it grew
  the ESP/grub_device case), attributed there.
- the os/v3 tree table now opens by saying it is the tree this page proposes and that nothing in it lands
  in this PR.
- the firmware row had both split packages on one revision; measured here they are not:
  linux-firmware-amd-misc 20260319.git217ca6e4-0ubuntu1.1 and linux-firmware-amd-graphics
  20260319.git217ca6e4-0ubuntu3.1. Both places (the package-set paragraph and the measured table) now say
  so.

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY

At 8123be3, rebased after the merges ahead of it. The author patch is byte-identical to the head I reviewed (d86e034f) — patch-id from the merge base is the same before and after — so my review stands without re-reading: only main arrived in the rebase.

Nothing new to verify. Everything in my earlier verdict on this PR applies at this head unchanged, including what I noted as not-verified-by-me there.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 25a7fe6

@bong-water-water-bong bong-water-water-bong left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: READY

At 25a7fe69, rebased as the merges ahead of it landed. The author patch is byte-identical to the head I reviewed (patch-id from the merge base unchanged before and after), so only main arrived in the rebase and my review stands without re-reading.

Nothing new to verify; everything in my earlier verdict on this PR — including what I recorded there as not-verified-by-me — applies at this head unchanged.

@bong-water-water-bong
bong-water-water-bong merged commit 4ee55ef into main Nov 1, 2026
8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the os/v3-seed branch November 1, 2026 04:30
bong-water-water-bong added a commit that referenced this pull request Nov 1, 2026
…ngine#712) (#717)

* docs: 1bit OS v3 - the installed machine is an Ubuntu 26.04 Server (engine#712)

The design for #712: the live stick stays the os/mini image and becomes the
autoinstall carrier; the installed machine is a headless Ubuntu 26.04 Server
with our kernel, drivers, runtime, engine and Lemonade as apt packages.

Covers the stick and target partition layouts, the autoinstall user-data and
its nine postinstall steps, the install screen (#710), the firmware boot entry
and efivarfs fix (#709), the package set with measured sizes, the pinned
libhsa and the no-SVM trio (#715), the v2 -> v3 adopt-/data path, the QEMU
A/R/I/B gate plus the new V phase, and the board gate.

Numbers are measured on the rebuilt strixhalo box; what is not measured is
listed as the build's risk list.

* docs/os-v3: the board gate sentence says what is provable, and the headers package is on demand

* docs/os-v3: reflow the board gate paragraph

* docs/os-v3: one root size in both places, and no invented package count on the install screen

* docs/os-v3: postinstall's rows are the screen's steps 3-8, so the gate's 1-9 is one list

* docs/os-v3: our repo is never a persistent apt source - a file:///cdrom URI outlives the stick

The seed's apt.primary is the archive (stock packages only) with curtin's
offline-install fallback; postinstall installs the medium's repo through a
temporary source it removes, and 1bit.gg/apt stays the installed machine's one
source, as v2 has it.

* docs/os-v3: the account is onebit, and the medium's pin is measured not deferred

- a Linux user name starts with a letter (adduser's default NAME_REGEX is
  ^[a-zA-Z][a-zA-Z0-9_-]*$, measured here, and the installer applies the same
  rule): 1bit would be refused before the first byte is written, so the account
  is onebit. docs and the seed agree, and the seed refuses 1bit by name.
- the server ISO is pinned for real: 26.04.1, 2,927,861,760 bytes, sha256
  cc8a95cd..., volume label read out of the ISO's primary volume descriptor
  (the string casper matches), all in os/v3/pin.txt. It moves out of the
  not-measured list; what stays there is that the medium has never been booted.
- the tree table says what is in the tree (pin.txt, seed.sh, seed-selftest.sh)
  and what is still a design.

* docs/os-v3: Puppy is the plan if its gates pass; Ubuntu autoinstall is the documented fallback

The owner's 2026-11-01 direction (1bit OS v3 on Puppy, live stick and frugal install, with our kernel)
reframes this page rather than replacing it: the medium changes, the design does not - the same ESP
chain, the same #709 boot entry, the same #710 install screen, the same seed of identity and the same
package content. The Puppy evaluation (docs/os-v3-live-puppy-eval.md, os/v3/puppy/) carries the numbers
and the gates; this page now says which plan is the plan and why the Ubuntu plan stays as the fallback:
it needs no kernel rebuild, and its userland brings sshd, apt, efivarfs, a normal user and
unattended-upgrades for free, where Puppy adds them as packages and runs as root by model.

* docs/os-v3: name the PRs that carry the files this page references, and split the firmware row

Review at dd9be3d, three points, all addressed:

- the page pointed at files that are not in this branch in the present tense
  (docs/os-v3-live-puppy-eval.md and os/v3/puppy/ -> #739; os/v3/pin.txt, seed.sh, seed-selftest.sh ->
  #732). They are now named with their PRs and the page says plainly that none of it is in this PR, so
  every sentence is true at any merge order. The '31 checks' figure was #732's file and is now 32 (it grew
  the ESP/grub_device case), attributed there.
- the os/v3 tree table now opens by saying it is the tree this page proposes and that nothing in it lands
  in this PR.
- the firmware row had both split packages on one revision; measured here they are not:
  linux-firmware-amd-misc 20260319.git217ca6e4-0ubuntu1.1 and linux-firmware-amd-graphics
  20260319.git217ca6e4-0ubuntu3.1. Both places (the package-set paragraph and the measured table) now say
  so.

---------

Co-authored-by: bong-water-water-bong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Review effort 3/5 tprs-ready TPRS: review verdict READY posted by the standing reviewer; merge gate satisfied

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant