From 81c0c5a2a90bc7084ed7957d8d9182f95fa7cf2b Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 13 Aug 2019 15:47:19 +0200 Subject: [PATCH 1/5] terminus-font: add package Signed-off-by: Matthias Reichl --- packages/sysutils/terminus-font/package.mk | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 packages/sysutils/terminus-font/package.mk diff --git a/packages/sysutils/terminus-font/package.mk b/packages/sysutils/terminus-font/package.mk new file mode 100644 index 0000000000..a3cf428c01 --- /dev/null +++ b/packages/sysutils/terminus-font/package.mk @@ -0,0 +1,30 @@ +# SPDX-License-Identifier: GPL-2.0-or-later +# Copyright (C) 2019 Matthias Reichl + +PKG_NAME="terminus-font" +PKG_VERSION="4.48" +PKG_SHA256="34799c8dd5cec7db8016b4a615820dfb43b395575afbb24fc17ee19c869c94af" +PKG_LICENSE="OFL1_1" +PKG_SITE="https://terminus-font.sourceforge.net/" +PKG_URL="https://downloads.sourceforge.net/project/${PKG_NAME}/${PKG_NAME}-${PKG_VERSION}/${PKG_NAME}-${PKG_VERSION}.tar.gz" +PKG_DEPENDS_INIT="toolchain Python3:host" +PKG_LONGDESC="This package contains the Terminus Font" +PKG_TOOLCHAIN="manual" + +pre_configure_init() { + cd $PKG_BUILD + rm -rf .${TARGET_NAME}-${TARGET} +} + +configure_init() { + ./configure INT=${TOOLCHAIN}/bin/python3 +} + +make_init() { + make ter-v32b.psf +} + +makeinstall_init() { + mkdir -p ${INSTALL}/usr/share/consolefonts + cp ter-v32b.psf ${INSTALL}/usr/share/consolefonts +} From a6ef4e5c595808e60d17bc22b8f5546342739605 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 13 Aug 2019 16:54:20 +0200 Subject: [PATCH 2/5] busybox: enable setfont Signed-off-by: Matthias Reichl --- packages/sysutils/busybox/config/busybox-init.conf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/sysutils/busybox/config/busybox-init.conf b/packages/sysutils/busybox/config/busybox-init.conf index 2c39056f81..bb94ead7a5 100644 --- a/packages/sysutils/busybox/config/busybox-init.conf +++ b/packages/sysutils/busybox/config/busybox-init.conf @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.31.0 -# Wed Jun 12 00:51:44 2019 +# Tue Aug 13 17:29:50 2019 # CONFIG_HAVE_DOT_CONFIG=y @@ -365,10 +365,14 @@ CONFIG_CLEAR=y # CONFIG_FGCONSOLE is not set # CONFIG_KBD_MODE is not set # CONFIG_LOADFONT is not set -# CONFIG_SETFONT is not set +CONFIG_SETFONT=y # CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set -CONFIG_DEFAULT_SETFONT_DIR="" -# CONFIG_FEATURE_LOADFONT_PSF2 is not set +CONFIG_DEFAULT_SETFONT_DIR="/usr/share" + +# +# Common options for loadfont and setfont +# +CONFIG_FEATURE_LOADFONT_PSF2=y # CONFIG_FEATURE_LOADFONT_RAW is not set # CONFIG_LOADKMAP is not set # CONFIG_OPENVT is not set From 017212ee84beb49896c77fa91f0241edefc743f9 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 13 Aug 2019 16:57:25 +0200 Subject: [PATCH 3/5] initramfs: add terminus-font dependency Signed-off-by: Matthias Reichl --- packages/virtual/initramfs/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/virtual/initramfs/package.mk b/packages/virtual/initramfs/package.mk index ae5cec6b00..cbc35a12b8 100644 --- a/packages/virtual/initramfs/package.mk +++ b/packages/virtual/initramfs/package.mk @@ -7,7 +7,7 @@ PKG_VERSION="" PKG_LICENSE="GPL" PKG_SITE="http://www.openelec.tv" PKG_URL="" -PKG_DEPENDS_TARGET="toolchain libc:init busybox:init plymouth-lite:init util-linux:init e2fsprogs:init dosfstools:init fakeroot:host" +PKG_DEPENDS_TARGET="toolchain libc:init busybox:init plymouth-lite:init util-linux:init e2fsprogs:init dosfstools:init fakeroot:host terminus-font:init" PKG_SECTION="virtual" PKG_LONGDESC="debug is a Metapackage for installing initramfs" From 5f9248eb591c818f70b5fb5d4cd5b133f7a70a20 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 13 Aug 2019 17:07:34 +0200 Subject: [PATCH 4/5] init: use terminus 16x32 font on >1080 lines displays Signed-off-by: Matthias Reichl --- packages/sysutils/busybox/scripts/init | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/sysutils/busybox/scripts/init b/packages/sysutils/busybox/scripts/init index 36551c134e..504fed15f2 100755 --- a/packages/sysutils/busybox/scripts/init +++ b/packages/sysutils/busybox/scripts/init @@ -367,6 +367,18 @@ load_modules() { done } +set_consolefont() { + local vres + + progress "Set console font" + if [ -e /dev/fb0 ]; then + vres="$(fbset 2>/dev/null | awk '/geometry/ { print $3 }')" + if [ $vres -gt 1080 ]; then + setfont -C /dev/tty0 ter-v32b.psf + fi + fi +} + load_splash() { local set_default_res=no local vres @@ -1052,6 +1064,7 @@ debug_msg "Unique identifier for this client: ${MACHINE_UID:-NOT AVAILABLE}" # main boot sequence for BOOT_STEP in \ load_modules \ + set_consolefont \ check_disks \ mount_flash \ update_bootmenu \ From 1cb0af881c4d744e83169edcdebdaec0e7db29c0 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 13 Aug 2019 21:27:02 +0200 Subject: [PATCH 5/5] init: make resolution limit for using big console font configurable The vertical resulution limit can be set with the "bigfont" option. Signed-off-by: Matthias Reichl --- packages/sysutils/busybox/scripts/init | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/sysutils/busybox/scripts/init b/packages/sysutils/busybox/scripts/init index 504fed15f2..c2f6395673 100755 --- a/packages/sysutils/busybox/scripts/init +++ b/packages/sysutils/busybox/scripts/init @@ -48,6 +48,8 @@ LIVE="no" BREAK_TRIPPED="no" +BIGFONT="1080" + # Get a serial number if present (eg. RPi) otherwise use MAC address from eth0 MACHINE_UID="$(cat /proc/cpuinfo | awk '/^Serial/{s=$3; gsub ("^0*","",s); print s}')" [ -z "$MACHINE_UID" ] && MACHINE_UID="$(cat /sys/class/net/eth0/address 2>/dev/null | tr -d :)" @@ -373,7 +375,7 @@ set_consolefont() { progress "Set console font" if [ -e /dev/fb0 ]; then vres="$(fbset 2>/dev/null | awk '/geometry/ { print $3 }')" - if [ $vres -gt 1080 ]; then + if [ $vres -gt "$BIGFONT" ]; then setfont -C /dev/tty0 ter-v32b.psf fi fi @@ -1041,6 +1043,9 @@ for arg in $(cat /proc/cmdline); do break=*) BREAK="${arg#*=}" ;; + bigfont=*) + BIGFONT="${arg#*=}" + ;; esac done