Skip to content

fix(console): fall back to the kernel's 8x16 font on a small framebuffer - #368

Merged
Bugs5382 merged 1 commit into
mainfrom
fix/appliance-21-console-font-fallback
Oct 14, 2026
Merged

Bugs5382 merged 1 commit into
mainfrom
fix/appliance-21-console-font-fallback

Conversation

@Bugs5382

@Bugs5382 Bugs5382 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The prod cmdline fixes fbcon to TER16x32, so a small on-screen
framebuffer can leave the VT with fewer rows/columns than even the
dashboard's compact render needs. cryptos-console now reads the VT
size at startup and, when it is below the floor RenderDashboard
already uses to drop into its compact view, requests the kernel's
built-in VGA8x16 font via KDFONTOP before the first draw, then
re-reads the size. A failed switch is logged and the original size is
kept, so the compact view still runs. The ioctl is wrapped behind an
interface so the decision is unit-tested with a fake switcher.

internal/console now exports NeedsCompact so the console binary
reuses the existing floor instead of duplicating the numbers.

No kernel cmdline change in cryptos-appliance; nothing so far shows
this doesn't fully resolve the small-screen case there.

Refs CryptOS-PKI/cryptos-appliance#21

Verification

  • Lint clean
  • Tests pass
  • Build succeeds
  • Documentation updated (if behavior or API changed)

No docs change: this is an internal boot-time fallback with no new
CLI flag, config, or API surface.

How this was verified

  • go build ./...
  • go vet ./...
  • gofmt -l cmd internal
  • golangci-lint run ./...
  • go test ./... (under the systemd-run memory-capped scope), including
    the new TestNeedsCompactMatchesTheFramedFloor and the three
    TestEnsureConsoleFits* cases covering below-floor, at/above-floor, and
    a fallback-error path.

The prod cmdline fixes fbcon to TER16x32, so a cramped on-screen
framebuffer (a small panel, or a management console's low-resolution
GOP mode) can leave the VT with fewer rows and columns than even the
dashboard's compact render needs. Nothing checked the real console
geometry against that floor before drawing.

cryptos-console now reads the VT size at startup and, when it is below
the floor RenderDashboard already uses to drop into its compact view,
requests the kernel's built-in VGA8x16 font via KDFONTOP before the
first draw, then re-reads the size. A failed switch is logged and the
original size kept, so the compact view still runs. The ioctl sits
behind a small interface so the decision logic is unit-tested with a
fake switcher.

internal/console now exports NeedsCompact so the console binary can
reuse the existing floor instead of duplicating the numbers.

Signed-off-by: Bugs5382 <12115015+Bugs5382@users.noreply.github.com>
@Bugs5382
Bugs5382 marked this pull request as ready for review October 14, 2026 00:10
@github-actions github-actions Bot added the fix Bug fix (fix). Patch. label Oct 14, 2026
@Bugs5382
Bugs5382 merged commit 6bd5eae into main Oct 14, 2026
29 checks passed
@Bugs5382
Bugs5382 deleted the fix/appliance-21-console-font-fallback branch October 14, 2026 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix (fix). Patch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant