[systemd-devel] Issues discovered with systemd_vconsole_setup helper

Michal Soltys soltys at ziu.info
Sat Jun 18 15:28:22 UTC 2016


1) font_copy_to_all_vcs(): copying fonts of height different from 
"standard" 16 produces garbage on all other terminals (with exception of 
builtin basic vga).

The workaround is to call setfont directly providing another terminal 
with -C option (or log in and type the command blindly), e.g.

setfont -C /dev/tty2 latarcyrheb-sun32

The issue is (probably) following line:

  cfo.height = vcs.v_active-1; /* tty1 == index 0 */

as terminal index is not its height (in near all cases the height value 
will be 0 as vconsole helper operates on tty1 - so copying works fine as 
long as the actual height doesn't change, again probably). It probably 
needs KD_FONT_OP_GET or maybe GIO_FONTX. Initial tests I did so far 
though failed miserably (I always get 0 from those calls).

Wouldn't it be better (or at least safer) to just call setfont for each 
iterated terminal ?

2) PIO/GIO_UNISCRNMAP & PIO/GIO_SCRNMAP

Or ITOW - setfont -m / FONT_MAP.

a) These are not necessary during copying, as the mapping is global - 
once it's set at any terminal, it becomes the new default for all 
consoles (regardless of their modes).

b) There's nasty issue here as well - if PIO_SCRNMAP is called 
(unnecessarily it seems) before PIO_UNISCRNMAP, it will invalidate all 
mappings beyond 255 (including source console, as the setting is 
global). This usually leads to terminals with non-working tab, 
backspace, etc.

The workaround is to log in and use setfont with -m option.

I discovered this bug due to another bug in kdb:
https://lists.altlinux.org/pipermail/kbd/2016-June/000591.html

as currently to have polish letters, setfont's -m/vconsole's FONT_MAP 
(normally needed only in non-utf8 modes) have to be provided as well in 
utf8 mode (or - alternatively - kdb downgraded to 1.15.5 for correctly 
working loadkeys -u).

The fix here is simple - remove [UNI]SCRNMAP invocations.



I can provide patches, though what would be the best approach to the 
first issue (just call setfont per terminal) ?
Also, vconsole helper iterates over 15 terminals always (hardcoded), 
maybe it would be more flexible to provide a setting for it (or lower it 
to 12) ?


More information about the systemd-devel mailing list