Skip to content

os: the banner and the release check read the image's own release identity (#704) - #720

Merged
bong-water-water-bong merged 6 commits into
osv2/703-quiet-vtfrom
osv2/704-image-version
Nov 1, 2026
Merged

bong-water-water-bong merged 6 commits into
osv2/703-quiet-vtfrom
osv2/704-image-version

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Fixes #704. /init printed a hard-coded v2026.43 on a stick shipping Lemonade 2026.46.0, and
/etc/1bit/release-identity (which 1bit-release-check reports as SKIP when missing) was never written.

mkimage.sh now writes it at build time - tag (IMAGE_TAG, else the tree's describe), the Lemonade version from
the package being shipped (lemond --version), the engine commit, the HRX pin, the image kernel, and the build
timestamp - and the grub menuentry and the boot banner print it. The artifact sha256 stays in the release table
beside the .img.zst: it cannot be inside the image it hashes.
PR-READY.

@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: CHANGES

At 8cf48b0d. The change is the right idea and it works end to end — but the identity file it writes contains a false provenance line, produced by the command in this diff.

Built and inspected (LEMONADE prebuilt, EC_MODULE=skip AMDXDNA_KO=skip, 36 s): bash -n clean on both scripts; image assembles; the file inside the initramfs is real:

/etc/1bit/release-identity
tag: rc-test-720
lemonade: 2026.46.0          <- from `lemond --version`, not a constant: good
engine: 8cf48b0dbd62
hrx-system: 8cf48b0dbd62     <- this is the ENGINE commit, not the HRX pin
kernel: 7.3.0-rc4-1bit-perfopt+
built: 2026-11-01T02:51:03Z

IMAGE_TAG=rc-test-720 propagated correctly, and the banner line interpolates it while still containing the literal gate string — grep -c "LIVE: runs from RAM" init → 1, so the QEMU gate assertion is intact.

The defect. mkimage.sh writes the HRX pin as:

echo "hrx-system: $(git -C "$repo/third_party/hrx-system" rev-parse --short=12 HEAD 2>/dev/null || echo unknown)"

When the submodule is not checked out, git -C resolves upward to the parent repository and answers with the parent's HEAD. Measured here:

git -C .../third_party/hrx-system rev-parse --short=12 HEAD   -> 8cf48b0dbd62   (= engine HEAD)
git -C .../third_party/hrx-system rev-parse --show-toplevel   -> /home/bcloud/wt/tprs-os   (the engine tree, not the submodule)
git ls-tree HEAD third_party/hrx-system                       -> 160000 commit 82804197bcbe…

So the image ships a file that says the HRX pin is the engine commit, and the || echo unknown fallback never fires — it looks like a successful read. That matters more than a normal wrong field because the whole point of this PR is "the image's own release identity": someone bisecting an HRX regression against that file would be comparing the wrong revision, and every image built from a tree with uninitialised submodules (which is how the release lane builds) gets it.

One-line fix — report the recorded gitlink, which is the pin the release actually ships:

echo "hrx-system: $(git -C "$repo" ls-tree HEAD third_party/hrx-system 2>/dev/null | awk '{print substr($3,1,12)}')"

(and [ -n "$hrx" ] || hrx=unknown, so "unknown" still means unknown). If you would rather keep rev-parse, guard it with --show-toplevel equal to the submodule path, otherwise it will silently return the parent again.

Everything else in the diff is right: the version comes from the shipped lemond rather than a constant, one file is the only source for banner and 1bit-release-check, the c18 v2026.43-on-a-2026.46.0-stick bug is exactly the class this closes, and no page hard-codes a version any more. Fix the pin line and this is READY.

@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: CHANGES

At 86dbe7ed. The head moved but the blocker did not: the hrx-system pin line is unchanged, still line 409:

echo "hrx-system: $(git -C "$repo/third_party/hrx-system" rev-parse --short=12 HEAD 2>/dev/null || echo unknown)"

What changed between the heads is os/mini/init.sh +49 −10 — that is #721's boot-flow content (menu countdown, per-wait say lines), now folded into this PR since #721 is closed. I had verified that content separately and it reads right: say() defined at 47 with first use at 55, countdown i=12 → decrement → unset -f repaint_choice, read -r -t 1 already proven in this image, and grep -c "LIVE: runs from RAM" → 1 so the QEMU gate assertion survives. So nothing regressed there.

The blocker, unchanged and measured at the previous head (same code):

/etc/1bit/release-identity  ->  hrx-system: 8cf48b0dbd62      <- the ENGINE commit
git -C third_party/hrx-system rev-parse HEAD    -> 8cf48b0dbd62
git -C third_party/hrx-system rev-parse --show-toplevel -> <the engine tree>   (git walks UP: submodule not checked out)
git ls-tree HEAD third_party/hrx-system         -> 160000 commit 82804197bcbe…  (the real pin)

The || echo unknown fallback never fires, so the artifact silently states the engine sha is the HRX pin — in a file whose entire purpose is to tell the truth about what the image contains, and built exactly the way the release lane builds (tree with uninitialised submodules). Someone bisecting an HRX regression against that line compares the wrong revision.

One line, which also keeps "unknown" meaning unknown:

hrx=$(git -C "$repo" ls-tree HEAD third_party/hrx-system 2>/dev/null | awk '{print substr($3,1,12)}')
echo "hrx-system: ${hrx:-unknown}"

Everything else in this PR I have verified and would keep as is: the tag comes from IMAGE_TAG (rc-test-720 propagated in a real build), lemonade: 2026.46.0 comes from the shipped lemond --version rather than a constant, the identity file is the single source for banner and 1bit-release-check, and no page hard-codes a version any more — that is the c18 v2026.43-on-a-2026.46.0-stick bug closed.

No tprs-ready. This is the line that unblocks #722-#727 as well, since they stack on it.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit 5c16804)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

704 - Partially compliant

Compliant requirements:

  • The boot chooser banner no longer hard-codes the Lemonade version
  • The shipped Lemonade version is derived from the package at mkimage time
  • The banner now reads from /etc/1bit/release-identity
  • /etc/1bit/release-identity is written by mkimage.sh
  • The release check now reads from /etc/1bit/release-identity instead of skipping it

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Version String Parsing

The ident() function in init.sh uses sed to extract values from /etc/1bit/release-identity. If the file contains unexpected formats or special characters in the version strings, it could lead to incorrect parsing. This is especially relevant for version strings that may contain spaces or other special characters, which could break the parsing logic.

ident() { sed -n "s/^$1: *//p" /etc/1bit/release-identity 2>/dev/null | head -n 1; }
TAG=$(ident tag); TAG=${TAG:-dev}
LEMVER=$(ident lemonade)
Lemonade Version Extraction

The lemver variable in mkimage.sh extracts the Lemonade version using lemond --version. If lemond is not available or its output format changes, this could result in an incorrect or empty version string. The script should handle cases where lemond is not found or its output does not match the expected format.

lemver=$("$lem/bin/lemond" --version 2>/dev/null | sed -n 's/^lemond version \([^ ~]*\).*/\1/p' | head -n 1)
[ -n "$lemver" ] || lemver=unknown

bong-water-water-bong added 3 commits November 1, 2026 01:21
…704)

Review of #720: `git -C third_party/hrx-system rev-parse HEAD` walks up to the parent repository when the
submodule is not checked out - the way the release lane builds - so the image shipped
'hrx-system: <engine sha>' and the '|| unknown' fallback never fired. The gitlink recorded in this tree is
the pin the release ships: `git ls-tree HEAD third_party/hrx-system`. Measured before/after below.
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Both blockers addressed at the new head 9c9a260.

1. the HRX pin line (the real defect). git -C third_party/hrx-system rev-parse walks up to the parent when the submodule is not checked out — reproduced exactly as you described, in a throwaway worktree of this branch (no submodules initialised):

$ ls /tmp/wt-nosub/third_party/hrx-system | wc -l
0
$ git -C /tmp/wt-nosub/third_party/hrx-system rev-parse --short=12 HEAD
9c9a2603523e                       <- the ENGINE commit (the old line's answer)
$ git -C /tmp/wt-nosub ls-tree HEAD third_party/hrx-system | awk '{print substr($3,1,12)}'
82804197bcbe                       <- the pin the release ships (the new line's answer)

mkimage now writes the recorded gitlink, with ${hrx:-unknown} so a genuinely absent submodule still says unknown:

hrx=$(git -C "$repo" ls-tree HEAD third_party/hrx-system 2>/dev/null | awk '{print substr($3, 1, 12)}')
echo "hrx-system: ${hrx:-unknown}"

2. head content. The head also carries #705's boot-flow content, which you already read and approved in the previous round (init.sh +49 −10: say() at 47, countdown i=12, unset -f repaint_choice, one LIVE: runs from RAM). Both changed scripts are bash -n clean; the three other files it touches (mkimage.sh, init.sh, grub.cfg heredoc) are unchanged apart from the pin line.

PR-READY. Reviewing notes: the image build in your round is the same command I use (LEMONADE=~/wt/release-rc/work/lemonade EC_MODULE=skip AMDXDNA_KO=skip), so /etc/1bit/release-identity should now read hrx-system: 82804197bcbe on the next build.

@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 9c9a2603. The hrx-system line is fixed exactly as the measurement required, and the comment records why:

# the pin the release actually ships: the gitlink recorded in this tree. `git -C third_party/hrx-system
# rev-parse HEAD` walks UP to the parent repository when the submodule is not checked out - which is how
# the release lane builds - and silently reported the ENGINE commit as the HRX pin (review of #720).
hrx=$(git -C "$repo" ls-tree HEAD third_party/hrx-system 2>/dev/null | awk '{print substr($3, 1, 12)}')
echo "hrx-system: ${hrx:-unknown}"

That is the fix I proposed, with the :-unknown guard kept so "unknown" still means unknown. On this tree the same command yields 82804197bcbe — the value the release row in #729 quotes and the one I read out of the gitlink while reviewing this PR, so the file will now say the same thing as the release documentation.

The rest of the identity file is unchanged and was already right: tag from IMAGE_TAG, lemonade from the shipped lemond --version, engine/kernel/built as before, one file as the single source for the banner and 1bit-release-check.

Not verified: the value as printed by a fresh image build (I verified the derivation command and the expected output against the tree rather than rebuilding; the build path itself I exercised repeatedly at this stack's other heads and it assembles cleanly). Worth one grep hrx-system on the next image that comes off the release lane — the number should be 82804197bcbe, not an engine sha.

tprs-ready applied. This also unblocks #722-#727, which are stacked on it.

@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
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

The pin fix is now measured in a built image, not just in the command:

$ cat <image>/root/etc/1bit/release-identity
tag: rc-test-703-704
lemonade: 2026.46.0              <- `lemond --version` of the shipped package
engine: 9c9a2603523e
hrx-system: 82804197bcbe         <- the recorded gitlink, i.e. the pin (#704 review)
kernel: 7.3.0-rc4-1bit-perfopt
built: 2026-11-01T04:24:18Z

Same image, same command you used (LEMONADE=…/work/lemonade prebuilt, EC_MODULE=skip AMDXDNA_KO=skip-equivalent
module staging, bash -n clean). The old line, in a worktree without submodules, answered 9c9a2603523e for that
field — the ticket's exact complaint.

One thing worth knowing for your own runs on this box: /tmp is a 62 GB tmpfs (RAM-backed) and it was 100 % full
when I ran the image build there — every /tmp/osimg* tree is ~4 GB of memory the kernel cannot drop, and my run died
at gzip: stdout: No space left on device with 1.2 TB free on /. I moved this lane's VM output to /
(~/wt/trel3/.vmtest-*) and cleared only my own /tmp dirs.

PR-READY.

bong-water-water-bong and others added 3 commits November 1, 2026 01:27
…) (#723)

* os: a 16x32 console font and a full-width selection bar (#707)

* os: drop the sound modules and refuse unsigned modules in mkimage (#708)

---------

Co-authored-by: bong-water-water-bong <[email protected]>
…706) (#724)

* os: a 16x32 console font and a full-width selection bar (#707)

* os: drop the sound modules and refuse unsigned modules in mkimage (#708)

* os: prepare-stick grows the data partition to the stick's full size (#706)

---------

Co-authored-by: bong-water-water-bong <[email protected]>
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 5c16804

@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 5c168042. The delta since my last verdict is my own fix still in place plus the rest of this stack arriving through the rebase (1bit-menu from #722, the init.sh module list from #723, prepare-stick.sh from #724) — all of which I have reviewed and verdicted in their own PRs. The identity-file change itself is unchanged: hrx=$(git -C "$repo" ls-tree HEAD third_party/hrx-system …) → 82804197bcbe on this tree, with :-unknown intact.

So my review stands at this head, and this PR now also carries the stack it unblocks.

tprs-ready stands.

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

Superseded by #742 — the same reviewed content as one commit on origin/main (+598 −63, six files in os/mini/), because #721/#725/#727 were merged into their base branches rather than main and each later branch was then built on a base that had moved (which is why #726 read CONFLICTING). Both review fixes are in #742 (/dev/kmsg transcript for #703; ls-tree HRX pin for #704). Please close this one and merge #742 so nothing lands twice.

@bong-water-water-bong
bong-water-water-bong merged commit bea68a1 into osv2/703-quiet-vt Nov 1, 2026
3 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the osv2/704-image-version branch November 1, 2026 05:06
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