#859458 Because of displays with very high dpi, not only the keyboard, but the font has to be configured early

#859458#5
Date:
2017-04-03 19:12:21 UTC
From:
To:
Hi,

I have a display with a high resolution (280 dpi) and use full disk
encryption. For the frame buffer console, I've changed the font to

CODESET="Lat15"
FONTFACE="Terminus"
FONTSIZE="16x32"

But the prompt for the master password before the system starts (and after
grub) is still the default and very small.

To fix this, I've added these scripts to initramfs-tools:
------------- /etc/initramfs-tools/hooks/setup-console -------------
#!/bin/sh

case $1 in
prereqs)
     echo ''
     exit 0
     ;;
esac

. /usr/share/initramfs-tools/hook-functions
# Begin real processing below this line

copy_exec /bin/setfont
cp /etc/console-setup/cached_Lat15-Terminus32x16.psf.gz "$DESTDIR"/etc/console-font.psf.gz
------------- cat /etc/initramfs-tools/scripts/init-top/setup-console ------------- #!/bin/sh case $1 in prereqs) echo "udev" exit 0 ;; esac . /scripts/functions # Begin real processing below this line if test -x /bin/setfont && test -e /etc/console-font.psf.gz then setfont /etc/console-font.psf.gz log_success_msg 'Set console font' fi
------------- Can you add files like these to the package, please? Regards Jörg
#859458#16
Date:
2017-04-04 10:43:37 UTC
From:
To:
rename 859458 Because of displays with very high dpi, not only the keyboard, but the font has to be configured early
thanks

Console packages have always configured the keyboard as early as
possible in order to facilitate interaction during bad fsck.  They have
never tried (at least in Debian) to configure the font.  But your
argument is valid so I am renaming this bug accordingly.

I am considering this issue closed because there are already files like
these in the package. :)  See the option

setupcon --setup-dir

which is supposed to be used by initrd builders.  At the moment Dracut
uses this option, I don't know if there are other initrd builders in
Debian which use it.

But even with Dracut, the font will not be configured by initrd because
console-setup does not try to do this.  Which is unfortunate because
earlier versions of console-setup included font configuration in initrd.

Anton Zinoviev

#859458#21
Date:
2017-04-07 05:14:15 UTC
From:
To:
----- Forwarded message from Torne Wuff -----

Date: Thu, 6 Apr 2017 21:21:39 -0400
From: Torne Wuff
To: 620041@bugs.debian.org
Subject: Bug#620041:

Being able to set the font during initramfs would be immensely useful on my
HiDPI laptop, since the default console font renders the LUKS decryption
prompt at a minuscule size I can barely read.
----- End forwarded message -----
#859458#26
Date:
2017-10-18 18:00:13 UTC
From:
To:
Here's the initramfs hook script I'm using. It just copies
/etc/console-setup and /bin/setupcon into the initramfs wholesale, and
relies on udev to trigger the setting of the font via the usual
initramfs rules.

One weirdness I've yet to solve is that something resets the font to the
default tiny one, after the cryptsetup passphrase prompt. The real root
filesystem's udev proceeds to set the font, correctly, in the normal way
once control has been handed over to systemd.

It would be nice if there was a --save-font command for the hook to use,
that is analogous to --save-keyboard. Alternatively, it would be nice if
- --setup-dir configured the font as well as the keymap.

It seems a bit weird that the keymap initramfs hook and script aren't
provided by console-setup. It would be nice if console-setup adopted
them and for them to be enhanced to handle both the keymap and font,
rather than initramfs-tools having to concern itself with the details.

- -- System Information:
Debian Release: 9.2
  APT prefers stable-updates
  APT policy: (550, 'stable-updates'), (550, 'stable-debug'), (550, 'stable'), (530, 'testing'), (520, 'unstable-debug'), (520, 'unstable'), (510, 'experimental-debug'), (510, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: arm64

Kernel: Linux 4.9.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages console-setup depends on:
ii  console-setup-linux     1.164
ii  debconf                 1.5.61
ii  keyboard-configuration  1.164
ii  xkb-data                2.19-1+deb9u1

console-setup recommends no packages.

Versions of packages console-setup suggests:
ii  locales   2.24-11+deb9u1
ii  lsb-base  9.20161125

Versions of packages keyboard-configuration depends on:
ii  debconf                 1.5.61
ii  liblocale-gettext-perl  1.07-3+b1

Versions of packages console-setup-linux depends on:
ii  init-system-helpers     1.48
ii  kbd                     2.0.3-2+b1
ii  keyboard-configuration  1.164

console-setup-linux suggests no packages.

Versions of packages console-setup is related to:
pn  console-common        <none>
pn  console-data          <none>
pn  console-tools         <none>
ii  gnome-control-center  1:3.22.2-3
ii  kbd                   2.0.3-2+b1
ii  systemd               232-25+deb9u1

- -- debconf information excluded
-----BEGIN PGP SIGNATURE-----

iQJGBAEBCAAwFiEEyqqqGsppqDqJKxhV0gtCAlzaJ7kFAlnnlqkSHHNhbUByb2Jv
dHMub3JnLnVrAAoJENILQgJc2ie5jJUQAKdP0hkEwBLVyPeDHtlE7cz41GP8K5A9
BAqMpEkLkHpDj0J5id+jCTUpSZ7R4LVDSHZ07I4bv3DhNsXPkJX+RCmjajIfHaap
wD5C8tcnE2KT9GengTHHfWZ7HOoKEu4GQCCcPoWAR49s3d2GZ29MCKvWtlEMjmAn
r30NKpPan/OVIgJXT5Dn7BMsyK0Oz8mtiUwIxZ2k/UzYd5lOlB0N2Snv47Zz/+yM
4yEe30dmUJajhqlhlAogwxkr2NxhF51m6cnzl3puHlNxRjfa9eawHSe9MwgTDPWy
YzADsr87y2jnTuu9FTPfKbE1UYnBU0Lwu/hENyTZ+Zxdb91cHJKFFnqrviGtDld7
MWJXQEjCWhfo52/GAov38OG5Ot8Q0A4+ze3hvn77TnL9GBB9E84VoHTuyx2uAavh
hJAzEJLF8merPulDjreBFhFXpDTjWDzWLuR+58wQY771k3WCKKR4Vn5AOsf9xmAz
bpWjUUPARDLYN0dIruTXcQ2MW2cMUq0iGhsw1Cwa/1ZI8+x0XmtShYlRIjM1bnYw
gUxvLWfVWTVRBG0RfPIKMLAu86Idb1mqDChP81v4xqHvdT3v4muh/mPK59DTEpRt
umhRKrdSv2XdP6nN60qWDS+s8kCXFCfiyxkdjfddor2DQzObaqfEGOH2DCzdjySX
FpztKrUv6F+W
=NVMV
-----END PGP SIGNATURE-----

#859458#31
Date:
2017-10-18 19:00:24 UTC
From:
To:
Does this system end up using a VGA console, or a framebuffer console?
  I don't think the loaded font is retained when the console driver
changes.

I'd be happy to discuss such a change.

Ben.

#859458#36
Date:
2019-08-16 11:39:54 UTC
From:
To:
I recently installed Buster and ran into this issue. The prompt for my
cryptsetup password was almost unreadable because of the font size, the
debian-installer was very very painful to use too.

I tried Sam's console-setup hook that relies on udev but I was unable to
get the font set. However, the two-script solution by Jörg did work for me.

I was not able to reproduce the "double" font jump that Sam observed in
between the crypt prompt and the system hand-over. I did see a difference
in the "weight" (normal to thin) of the font and the color (white to grey),
even though I was using the same in both contexts (initramfs, proper
system).

#859458#41
Date:
2020-08-04 23:16:07 UTC
From:
To:
I seem unable to reproduce in my current unstable/sid system. At first I
thought it was because I had switched to `dracut`, but seems like I
can't reproduce the original issue with `initramfs-tools`.

Perhaps something else solved this? Maybe a newer `udev`? Can anyone
confirm?

#859458#46
Date:
2020-11-13 17:51:29 UTC
From:
To:
Hello,

After installing Debian Buster, the luks-crypt font was too small.
It all went away when I installed Jörg Sommer scripts: I have a readable
font now, in my case the one I'm using in the console:
Lat15-Terminus20x10.psf.gz.

Just to add that I had to chmod 0755 both scripts - don't know if it was
needed or not, but after regenerating the initrd (update-initramfs -c -v -k
all) without the files being executable nothing happened.
Had to regenerate the initramfs with the scripts being executable.

Best regards,