-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1459 from JonathonHall-Purism/hires_scale
Scale fbwhiptail and console font for high resolution displays
- Loading branch information
Showing
11 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -eo pipefail | ||
. /etc/functions | ||
|
||
TRACE "Under /bin/setconsolefont.sh" | ||
|
||
# If the board ships setfont, and the console size is >=1600 lines tall, | ||
# increase the console font size. | ||
if [ ! -x /bin/setfont ]; then | ||
DEBUG "Board does not ship setfont, not checking console font" | ||
exit 0 | ||
fi | ||
|
||
if [ ! -f /sys/class/graphics/fb0/virtual_size ]; then | ||
DEBUG "fb0 virtual size is not known" | ||
exit 0 | ||
fi | ||
|
||
CONSOLE_HEIGHT="$(cut -d, -f2 /sys/class/graphics/fb0/virtual_size)" | ||
|
||
# Deciding scale based on resolution is inherently heuristic, as the scale | ||
# really depends on resolution, physical size, how close the display is to the | ||
# user, and personal preference. | ||
# | ||
# fbwhiptail starts using 1.5x scale at 1350 lines, but we can only choose 1x | ||
# or 2x (without shipping more fonts). Err toward making the console too large | ||
# rather than too small and go to 2x at 1350 lines. | ||
if [ "$CONSOLE_HEIGHT" -ge 1350 ]; then | ||
DEBUG "Double console font size due to framebuffer height $CONSOLE_HEIGHT" | ||
# Double the default font size by reading it out, then applying it again | ||
# with setfont's -d option (double font size) | ||
setfont -O /tmp/default_font | ||
setfont -d /tmp/default_font | ||
rm /tmp/default_font | ||
else | ||
DEBUG "Keep default console font size due to framebuffer height $CONSOLE_HEIGHT" | ||
fi |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
modules-$(CONFIG_KBD) += kbd | ||
|
||
kbd_version := 2.6.1 | ||
kbd_dir := kbd-$(kbd_version) | ||
kbd_tar := kbd-$(kbd_version).tar.gz | ||
kbd_url := https://www.kernel.org/pub/linux/utils/kbd/$(kbd_tar) | ||
kbd_hash := aaed530a1490d63d041448372e2ad4f38c3179042903251000b71d527c46e945 | ||
|
||
kbd_configure := CFLAGS=-Os ./configure \ | ||
$(CROSS_TOOLS) \ | ||
--prefix "" \ | ||
--host i386-elf-linux \ | ||
--disable-optional-progs \ | ||
--disable-libkeymap \ | ||
--disable-libkfont \ | ||
--disable-vlock \ | ||
|
||
kbd_target := \ | ||
$(MAKE_JOBS) $(CROSS_TOOLS) | ||
|
||
kbd_output := \ | ||
src/setfont | ||
|
||
kbd_depends := $(musl_dep) |