Skip to content

os/mini: log what /data can hold, on the stick, at boot (#706) - #768

Merged
bong-water-water-bong merged 4 commits into
mainfrom
os/mini-data-size-log
Nov 1, 2026
Merged

bong-water-water-bong merged 4 commits into
mainfrom
os/mini-data-size-log

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Closes #706 with the measurement and the line it asked for.

Measured on the real stick (the c19 image on the owner's 64 GB UDisk, after prepare-stick):

sda2   122,540,033 sectors ≈ 58.5 GiB        (the image ships 4,339,712 sectors = 2.1 GiB)
read-only mount:  58G total, 1.5G used, 54G free (3%)      (c18, per the issue: 2.0G total, 351M free)

54 GB free is more than the biggest catalogue file (27B 17.6 GB, Coder-30B 18.6 GB), so the live appliance can pull a model.

What this PR adds is the last piece of the issue's own wording: the result in /data/boot.log, where it outlives the boot:

stage "/data: $(df -h /data | awk 'NR==2 {print $2" total, "$4" free"}') on ${data:-?}"

— written with the other stage markers, right after the data partition is mounted, and only when /data is actually mounted.

What was already there (and is not changed here): prepare-stick.sh grows the partition at prepare time with sgdisk -e + size=+ + resize2fs, --check never grows anything, and the growth is proved on a loop copy (2.1 → 5.8 GiB) as well as on the device.

sh -n clean.

The data partition is grown at prepare time (prepare-stick.sh: sgdisk -e, size=+, resize2fs), proved on a loop copy of
the image (2.1 -> 5.8 GiB) and on the owner's 64 GB stick (58G total, 54G free, measured read-only). What was missing
is the line the issue asks for: the result in /data/boot.log, where it outlives the boot and can be read from another
system. init now records "/data: <total> total, <free> free on <device>" with the other stage markers, right after the
data partition is mounted.
@bong-water-water-bong bong-water-water-bong added the os 1bit OS image, installer and appliance console (os/mini, os/v2, os/v3) label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Preparing review...

@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 fbf091b5 — first review, build green. One file, os/mini/init.sh, +5 −0 (plus a mode fix 100644 → 100755 on an executable script, which is correct).

The #706 close-out: the appliance now logs what /data can actually hold, in the place that outlives the boot:

if grep -q " /data " /proc/mounts; then
    stage "/data: $(df -h /data 2>/dev/null | awk 'NR==2 {print $2" total, "$4" free"}') on ${data:-?}"
fi

Three things make this the right shape rather than decorative:

  • it goes through stage, so the line lands on the screen, ttyS0 and /data/boot.log at once — the same three destinations as every other wait line, which is what the gates and the 26 Oct debugging reads;
  • it is guarded by the mount check, so a boot with no /data prints nothing rather than a df error or a bogus "? total";
  • it prints the device as ${data:-?}, so the line says which partition it is reporting on — the distinction #711 was about, and the reason this is useful rather than just a size.

That is the pair to #724's prepare-stick.sh growth: the growth happens at prepare time and this is "the first place the result is visible from inside the appliance", as the comment says. A 2 GiB /data and a 58 GiB one now look different in the boot log, which is exactly what was missing when no catalogue model could be pulled on the live system.

pr_agent was failing on this head when I looked; that check has been unreliable all session (coder-llm availability) and does not gate content — build is green.

Not verified: the line on a real boot (needs the QEMU gate or the board). The df -h parsing is the standard NR==2 row and the mount guard is the same idiom used elsewhere in this file.

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

PR Reviewer Guide 🔍

(Review updated until commit e59aba7)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

706 - Partially compliant

Compliant requirements:

  • The PR adds logging of /data size and free space into /data/boot.log as requested
  • The PR acknowledges that the partition is grown at prepare time, which aligns with the fix
  • The PR ensures the log is written only when /data is actually mounted

Non-compliant requirements:

  • The PR does not implement the release check to run chat-npu on the smallest NPU entry when space allows

Requires further human verification:

  • The claim of 54 GB free space needs to be verified on the actual hardware
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing NPU model check

The PR adds logging of the /data partition size and free space as requested in the issue, but does not implement the part about running chat-npu on the smallest NPU entry when space allows. This functionality is still needed to fully address the ticket's requirements.

if grep -q " /data " /proc/mounts; then
    stage "/data: $(df -h /data 2>/dev/null | awk 'NR==2 {print $2" total, "$4" free"}') on ${data:-?}"
fi

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit 8d048c4

@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

Confirmation at 8d048c4a: Merge branch 'main' into os/mini-data-size-log, author commit unchanged
(fbf091b), own diff still the single +5 hunk in os/mini/init.sh.

Re-checked the content at this head rather than trusting the rebase: bash -n os/mini/init.sh clean, and the two
lines are the ones reviewed — stage "stick mounted at ${data:-nothing}" (line 121) and the df -h /data line
(125), both through stage so they reach the screen, ttyS0 and /data/boot.log, and ${data:-?} so the line names
which partition. Label stays.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit b0f2a07

@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

Confirmation at b0f2a070: Merge branch 'main' bringing #766's Laya gitlink into the branch; the PR's own content is
still the one fbf091b commit, +5 in os/mini/init.sh, unchanged. bash -n os/mini/init.sh clean at this head, and
the two stageed lines are as reviewed (stick mounted at ${data:-nothing}, and the df -h /data readout with
${data:-?}). Label stays.

@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

Confirmation at e59aba7c: merge-of-main, the PR's own commit fbf091b unchanged (+5 in os/mini/init.sh), so the
content is byte-identical to what I reviewed and re-checked (bash -n clean, both stageed lines present, ${data:-?}
naming the partition). Label stays.

@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

Persistent review updated to latest commit e59aba7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

os 1bit OS image, installer and appliance console (os/mini, os/v2, os/v3) Review effort 2/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.

os: the live stick's /data is 2 GB (351 MB free after boot) - no catalogue model can be pulled on the live appliance

1 participant