Here you go. Both scripts are in the attached "SCRIPTS.txt". Note that on my
systems I keep only the one PSF font that I actually use, so my hook script
does not need to update cached fonts + my systems are without PLYMOUTH. Check
Pedro's scripts if you need to handle those more complex usages.
Regards,
Jmkr
SCRIPT 1 "/etc/initramfs-tools/hooks/console-setup":
#!/bin/sh
case "$1" in
prereqs)
echo 'keymap'
exit 0;;
esac
. /usr/share/initramfs-tools/hook-functions
if [ -x /bin/plymouth ]; then
echo 'W: Graphical boot splash prevents setting console fonts.'
fi
fontfile=$(ls -1 -t /etc/console-setup/cached_*.psf.gz 2>/dev/null | head -n 1)
if [ -n "$fontfile" ] && [ -r "$fontfile" ]; then
copy_exec /bin/setfont
copy_file font "$fontfile"
fi
if [ ! -x "$DESTDIR"/bin/setfont ]; then
echo 'E: Failed to copy the "/bin/setfont" executable.'
exit 1
fi
if [ ! -r "$DESTDIR$fontfile" ]; then
echo "E: Failed to copy the \"$fontfile\" file."
exit 1
fi
----------------------------------------------------------------------
SCRIPT 2 "/etc/initramfs-tools/scripts/init-top/console-setup":
#!/bin/sh
case "$1" in
prereqs)
echo 'udev keymap'
exit 0;;
esac
fontfile=$(ls -1 -t /etc/console-setup/cached_*.psf.gz 2>/dev/null | head -n 1)
if [ -x /bin/setfont ] && [ -n "$fontfile" ] && [ -r "$fontfile" ]; then
setfont "$fontfile"
fi