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 <hias@horus.com>
This commit is contained in:
Matthias Reichl 2019-08-13 21:27:02 +02:00
parent 7da4fa4dc9
commit 4533bf3ea7

View File

@ -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
@ -1047,6 +1049,9 @@ for arg in $(cat /proc/cmdline); do
break=*)
BREAK="${arg#*=}"
;;
bigfont=*)
BIGFONT="${arg#*=}"
;;
esac
done