Skip to content

Commit 42d4529

Browse files
committed
20-console-autosize.sh: use full path to font file
setfont 2.6.3 removed '.' from the font search path. Fonts were loaded by name and not file name, breaking the hook on distributions with a recent kbd package. Loading fonts by filename at an absolute path was tested on: * Void (setfont 2.6.3) * Arch (setfont 2.6.3) * Debian (setfont 2.5.1) * Ubuntu (setfont 2.3.0) * Alpine (busybox setfont) * Chimera (setfont 2.6.3) Fixes: #552 Closes: #553
1 parent f0088ce commit 42d4529

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

testing/TPSReport.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ of the kernel list. That BE should be selected when entering the list.
213213
- [ ] Pressing the left/right arrow keys moves to the next/previous screen shown
214214
in the header. Screens will not wrap around.
215215

216+
- [ ] When booting a test VM with GTK output and efifb, the font will be resized
217+
to change the apparent resolution of the console. Successful font changes are
218+
logged via `zinfo()`.
219+
216220
## General Testing
217221

218222
- [ ] If every encryption root specifies an `org.zfsbootmenu:keysource`

zfsbootmenu/hooks/early-setup.d/20-console-autosize.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# vim: softtabstop=2 shiftwidth=2 expandtab
33

44
## This early-setup hook attempts to get a physical (non-serial) console
5-
## to at least 100 columns.
5+
## to at least 110 columns.
66

77
#shellcheck disable=SC1091
88
source /lib/zfsbootmenu-kcl.sh || exit 1
@@ -24,13 +24,13 @@ tty_re='/dev/tty[0-9]'
2424
# If the user has specified a specific font/size, do not attempt to override it
2525

2626
if get_zbm_bool 1 zbm.autosize && ! font=$( get_zbm_arg rd.vconsole.font ) ; then
27-
cd /usr/share/zfsbootmenu/fonts/ || exit 0
28-
for font in ter-v32b ter-v28b ter-v24b ter-v20b ter-v14b ter-v12n; do
29-
[ -f "${font}.psf" ] && setfont "${font}" >/dev/null 2>&1
27+
for font in /usr/share/zfsbootmenu/fonts/ter-v{{32,28,24,20,14}b,12n}.psf ; do
28+
[ -f "${font}" ] || continue
29+
setfont "${font}" >/dev/null 2>&1 || continue
3030

3131
# 110 columns is the current minimum to show both the sort key and a note on the snapshot screen
3232
if [ "${COLUMNS}" -ge 110 ]; then
33-
zdebug "set font to ${font}, screen is ${COLUMNS}x${LINES}"
33+
zinfo "font set to ${font}, ${control_term} is ${COLUMNS}x${LINES}"
3434
break
3535
fi
3636
done

0 commit comments

Comments
 (0)