vconsole-setup: skip setting fonts when setfont returns EX_OSERR
On a machine without a VGA console, /dev/tty{0,1,…} exist, so systemd-vconsole-setup is started, but all setfont operations fail. setfont has a bunch of return codes for different failure modes. It uses EX_OSERR when the communication with the kernel using ioctls fails. This isn't too specific, but at least it's only used this general class of errors. Let's swallow the error in this case to avoid systemd-vconsole-setup.service failing on cloud vms. On a machine from https://bugzilla.redhat.com/show_bug.cgi?id=1272686#c4: $ build/systemd-vconsole-setup setfont: putfont: 512,8x16: failed: -1 putfont: PIO_FONT: Invalid argument /usr/bin/setfont failed with error code 71. Setting fonts failed with a "system error", ignoring. $ SYSTEMD_LOG_LEVEL=debug build/systemd-vconsole-setup Found container virtualization none. Sysfs UTF-8 flag enabled UTF-8 kbdmode enabled on /dev/tty0 Executing "/usr/bin/setfont -C /dev/tty0 eurlatgr"... setfont: putfont: 512,8x16: failed: -1 putfont: PIO_FONT: Invalid argument /usr/bin/setfont failed with error code 71. Executing "/usr/bin/loadkeys -q -C /dev/tty0 -u us"... /usr/bin/loadkeys succeeded. Setting fonts failed with a "system error", ignoring. $ lspci | grep -i vga $ ls /dev/tty? /dev/tty0 /dev/tty2 /dev/tty4 /dev/tty6 /dev/tty8 /dev/tty1 /dev/tty3 /dev/tty5 /dev/tty7 /dev/tty9 If we have a better test for /dev/tty? being connected to something that has a font, we could avoid running setfont at all… ATM, I'm not aware of a simple test like that.
Loading