Repository navigation
fix(console): fall back to the kernel's 8x16 font on a small framebuffer - #368
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-consolenow reads the VTsize at startup and, when it is below the floor
RenderDashboardalready uses to drop into its compact view, requests the kernel's
built-in VGA8x16 font via
KDFONTOPbefore the first draw, thenre-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/consolenow exportsNeedsCompactso the console binaryreuses 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
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 internalgolangci-lint run ./...go test ./...(under the systemd-run memory-capped scope), includingthe new
TestNeedsCompactMatchesTheFramedFloorand the threeTestEnsureConsoleFits*cases covering below-floor, at/above-floor, anda fallback-error path.