Skip to content

Boot: a slow start says so, and Zyper says when the last start was restarted - #485

Draft
tarikbc wants to merge 6 commits into
mainfrom
boot-notice
Draft

tarikbc wants to merge 6 commits into
mainfrom
boot-notice

Conversation

@tarikbc

@tarikbc tarikbc commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

A start that takes longer than it should now says so on the boot screen, and when ZyperOS had to restart a start (or a handheld that froze while playing), the next start tells me once in Zyper's bubble, with a code I can ask for on the Discord.

Design record: the boot notice lab, ~/Documents/ZyperOS/labs/boot-notice-lab.html (https://claude.ai/artifact/5oDVrw8dKG4dJd53yJ7Eud). DESIGN.md 11.20 ("Slower than usual") and 11.70 ("The last start's restart") have it in words.

Pairs with the usb-hang PR (USB File Transfer and the watchdogs): #487. Either order builds and passes on its own, but I'd merge usb-hang first: its hardware watchdog and the launcher's watchdog are what this one's reasons W and the "The handheld froze" bubble report on. Whichever goes second takes main with two small conflicts, plastron/buildroot/package/zyperos/zyperos.init and plastron/buildroot/board/px2/rootfs-overlay/etc/init.d/datapart, where both sides keep their lines (this one's stage calls, usb-hang's hung_panic_off).

My picks in the lab, and where they are

  • When it talks: two steps, 5 s and 20 s. SLOW_STAGE_S and SLOW_HELP_S, plastron/buildroot/package/splash/src/slowline.h:64.
  • Where the lines go: top and foot. "Taking longer than usual" over Zyper (label, text-soft, baseline 80), the step at the foot in the first start's line's place (meta, baseline 706).
  • The words: "Taking longer than usual". res/strings/boot.txt, boot.slow, in 8 languages.
  • The stage: words and code, "Checking the card · C3", the code in text-dim. The steps come from datapart and zyperos.init (/tmp/splash-stage and a zyboot: stage= line in the kernel's log): C1 to C3, U1, L1.
  • If the first start's copy stops: the help after 60 s still (SLOW_STALL_S): its line becomes "Stuck? Hold POWER for 10 s, then turn it on."; the bar stays.
  • Where the next start says it: Zyper's bubble on the home, held hold-heat (4 s), as Getting hot and Update ready are. lastboot_watch, src/main.c:4750; lastboot_bubble, src/shelf_draw.c:2058.
  • What it says: with the report line. "I had to restart!" then "The last start did not finish. Code K1W · 0.6 s. Sending your logs on the Discord helps."
  • The code: letters, "K1W · 0.6 s". Stage, reason, the kernel's time at its last line, the same in every language, its spaces no-break (src/lastboot.c).
  • Which restarts: both. A freeze after the home says "The handheld froze." with stage H.
  • Where it can be read again: a Last Restart row on About ZyperOS's first page for 30 days (src/about_screen.c:189, src/lastboot_ui.c).
  • The tester's view: hold SELECT 2 s on the boot screen: the kernel's latest lines and under them the step, the time and the frames, on a dark band; let go and the screen is as it was, to the pixel.
  • The heartbeat: every 2 s, "splash: 12.0 s, 663 frames, stage=L1" in the kernel's log until ZyperOS draws.

crashlog writes the summary the launcher reads (/run/zyperos-lastboot.txt, and zyperos-lastboot.txt on PX2BOOT beside the report): reason W/P/T/R/X, stage K1/K2/C1-C3/U1/U2/L1/H.

Where it differs from the lab, measured

  • The help sits under "Taking longer than usual" at the top, not under the step at the foot. Measured on the frames: the animation runs from 157 to 658 units on every handheld, and a Chinese or Japanese letter at meta reaches 35 units over its baseline and 11 under, so two lines under the wordmark either touch it or pass the screen's inset. Over Zyper there is room for both (first line baseline 80, help 136, Zyper from 157). The step stays at the foot. With the help up there, the lab's "step glides up 16 as the help comes" has nothing to make room for: the first line and the help come down 14 together as they fade in (quick, out), and the step fades in where it is.
  • The bubble's report line is shorter than the lab's: "Sending your logs on the Discord helps." in place of "A report is in your logs. Sending it on the Discord helps.". With the lab's two sentences after the code, the bubble needed a fourth line in most languages. French says "Le dernier démarrage a échoué" where the lab had "n'a pas abouti": the lab's words cut the bubble's third line ("...nous aid...") on the Pixel 2 and the Brick.
  • The code in the bubble is plain meta text, not the lab's small chip: the bubble balances one string onto its lines, and a chip would break the balance.
  • The About row shows the code alone ("L1W · 118 s"), not "Nov 23 · K1W": with the day in it, German's row did not fit the panel.

What I fixed on review

  • The tester's band cut the wordmark in half on the Brick and the Smart Pro and touched Zyper's chin on the Pixel 2. It now starts at one place on every handheld, between Zyper (ends at 458) and the wordmark (starts at 505): SLOW_TESTER_TOP_Y, slowline.h:282. As many rows as fit, the foot on the last, wrapped at spaces. Its letters are drawn at each handheld's scale (slow/<handheld>/glyphs.bin from tools/genbootslow.py), so the Brick's are no longer 0.6 of the Pixel 2's. The first line and the help stay over Zyper while it is up.
  • The lines now arrive in quick on the out curve, as the lab played them (slow_in, slow_frame, slowline.h:510).
  • A cut in Zyper's bubble was only a note, so check-i18n-shots passed a French bubble that ended in "...". ui_fit_cut (src/ui.c:978) says it as a cut, and the check fails on it; I proved it with the lab's French.

Checks

  • make native: clean (the two warnings are main's).
  • check-bootslow: 32 handheld and language sets: nothing before 5 s, the step from 5 s, the first line and the help from 20 s, each arriving in quick (its first frame, half way and the end), clear of every frame, taken away to the pixel, the tester's view, the copy's help, the beat.
  • check-genbootslow, check-lastboot, check-crashlog: pass.
  • check-i18n-shots for the bubble (start and froze) and the About row in 8 languages on the Pixel 2, the Brick and the Smart Pro (wide), light and dark: everything fits. I looked at them, and at the boot screen's shots for every handheld, theme and language.
  • The splash compiled for Linux (splash.c with libdrm, splash-fb.c): clean.
  • make check CHECK_JOBS=4: all 277 checks passed in 30 min, none flaky.

On a spare card

  1. Build the image with both PRs together (python3 tools/merge-train.py --integrate-only 487 485), write it to a spare card, and start it once to the home.
  2. A start that hangs: put zytest=hang in zytest.txt on PX2BOOT and start. init is held before any step, so the boot screen shows no step and no lines (they come only for a step it knows). Hold SELECT 2 s: the kernel's lines show, hwdog: zytest=hang ... among them, and the beat every 2 s; let go and the screen is as it was. About 60 s in the chip's watchdog resets it.
  3. The next start reaches the home and Zyper says "I had to restart!" and "The last start did not finish. Code K2W · 60 s ..." (the time is the kernel's last line). MENU > About ZyperOS shows it as Last Restart. zyperos-lastboot.txt and zyperos-crash.txt are on PX2BOOT. Start again: the bubble does not come back for the same restart.
  4. A freeze after the home: zytest=stall in zytest.txt, start. It reaches the home; about 60 s later the chip resets. The next start says "The handheld froze. Code HX · ...".
  5. A slow step: hold POWER 10 s while a game runs (a power-off that is not clean), then start. The card check runs (C3); if it passes 5 s, the foot says "Checking the card · C3", and at 20 s "Taking longer than usual" and the help come down over Zyper.

From 5 s the boot screen says the step under way at the foot, where the
first start's line is ("Checking the card · C3"), and from 20 s "Taking
longer than usual" over Zyper with what to do if it never ends ("Stuck?
Hold POWER for 10 s, then turn it on."). The first start's line says the
same when its bar has not moved for a minute. SELECT held 2 s shows the
kernel's latest lines, and every 2 s the splash beats into the kernel's
log, so a restart's console tells a stuck start from a frozen chip.

The steps come from datapart and zyperos.init (/tmp/splash-stage and a
zyboot: stage= line). The lines are pictures from tools/genbootslow.py
in all eight languages for each handheld's scale. slowline.h is shared by
splash.c (Pixel 2, R36S) and splash-fb.c (Brick, Smart Pro), whose hold
now lasts as long as the start takes. check-bootslow holds it on the
splash's own frames, check-genbootslow the pictures.
When ZyperOS restarted a start that did not finish, or a handheld that
froze while playing, the next start says it once, in Zyper's bubble on the
home: "I had to restart!" and "The last start did not finish. Code K1W ·
0.6 s. Sending your logs on the Discord helps." The code is the stage,
the reason and the kernel's time, the same in every language. About
ZyperOS keeps it as Last Restart for 30 days, so it is still there once
the bubble has gone.

It reads crashlog's summary in /run/zyperos-lastboot.txt and keeps a copy
on the card, so one report is said once. check-lastboot holds the summary,
the code, the once and the 30 days; check-i18n-shots the bubble and the row
in every language.
…s first line

crashlog writes what the next start says beside its report:
/run/zyperos-lastboot.txt and PX2BOOT's zyperos-lastboot.txt, key=value.
The reason is P (a panic, lockups and RCU stalls too), T (hung_task), R
(rootwait), W (the launcher's watchdog, or a reset with no panic before
the home, the chip's watchdog) or X (a reset after the home with nothing
to say). The stage is the last zyboot: stage= line, H once ZyperOS drew,
and before any K1, K2 or C1 from the console. Then the kernel's time and
its last line, the version, the device and the report's name.

The splash says "splash: started" first, so a console that ends before
it stopped before init started it.
…atchdog

The launcher's watchdog is read by the line it says as it restarts ("an
emergency sync, and a restart"), not by any watchdog line: one that came
round again restarted nothing. The header no longer says there is no
hardware watchdog: where the image starts the chip's, a reset with no panic
before the home is it.

The splash keeps the last step when it reads /tmp/splash-stage half
written: the scripts write it with a plain echo.
…s arrive

The tester's band now starts at one place on every handheld, between
Zyper's chin (458) and the wordmark (505): it cut the wordmark in half on
the Brick and the Smart Pro and touched Zyper's chin on the Pixel 2. As
many rows fit as the band holds, the foot's on the last row, and a line
wraps at a space. Its letters are drawn at each handheld's scale
(slow/<handheld>/glyphs.bin from tools/genbootslow.py), so the Brick's are
not 0.6 of the Pixel 2's. The first line and the help stay over Zyper while
it is up: they are no longer at the foot.

Each slow line now arrives in quick on the out curve, as the lab's picks
had it: the step fades in, the first line and the help come down 14 as they
do. check-bootslow holds the first frame, half way and the end.

Zyper's bubble says a cut on the host: its lines are formatted from the
table (a code, a version), so a cut was only a note and check-i18n-shots
passed a French bubble that ended in "...".

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant