Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] How to change TTY font permanently? (It gets reset immediately) (Read 2876 times) previous topic - next topic
0 Members and 6 Guests are viewing this topic.

[SOLVED] How to change TTY font permanently? (It gets reset immediately)

Until recently (previous install), it was enough to have this in /etc/vconsole.conf

Code: [Select]
FONT=LatGrkCyr-8x16

However, now that I have reinstalled Artix (while switching to UEFI & GPT, and runit to s6), the setting doesn’t work anymore.

(I have enabled the console-setup service.) The font is set for a slight moment after reboot (the login prompt contains ‘artixlinux’ as the hostname, so some services aren’t probably started yet), then the screen goes blank for about a second, and then the default font is used again (the hostname is corrected just a blink later).

Do you know what might be wrong or what I can do to get the font I want?

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #1
I'm using s6 and my font remains set. Try adding the
Code: [Select]
KEYMAP=us
to /etc/vconsole.conf. For reference, I'm using Terminus font in tty as well, with the font being in /usr/share/kbd/consolefonts/ter-c12n.psf.gz so my /etc/vconsole.conf is:
Code: [Select]
FONT=ter-c12n
KEYMAP=us
You can check what's being done by taking a look at /etc/s6/sv/console-setup/shell_up:
Code: [Select]
#!/bin/sh

[ -r /etc/vconsole.conf ] && . /etc/vconsole.conf
TTYS=${TTYS:-6}
_index=0
while [ ${_index} -le $TTYS ]; do
    if [ -n "$FONT" ]; then
        setfont ${FONT_MAP:+-m $FONT_MAP} ${FONT_UNIMAP:+-u $FONT_UNIMAP} \
                $FONT -C "/dev/tty${_index}"
    fi
    printf "\033%s" "%G" >/dev/tty${_index}
    _index=$((_index + 1))
done
if [ -n "$KEYMAP" ]; then
    loadkeys -q -u ${KEYMAP}
fi
You can try those commands manually in the console to check if everything is going ok.

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #2
I’m pretty sure that console-setup is working, because if I disable it, the default font is used even in the first phase. The problem is that something overrides it and I don’t know what.

I have tried the keymap (I used cz instead to check) and it (but not the font) persists.

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #3
I can only suggest checking files under /etc/local.d and /etc/rc.*, in addition to files under /etc/s6/sv/*.

For example, /etc/issue is generated upon every startup by /etc/local.d/branding.start:

Code: [Select]
#!/bin/sh

neofetch >| /etc/issue

 

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #5
I can only suggest checking files under /etc/local.d and /etc/rc.*

I have none. Also, I have done some file substituting and checked that setfont is only called with the font that I want.

add in /etc/mkinitcpio.conf In HOOKS line "consolefont" (between "keyboard" and "keymap")
and generate new initial ramdisk :
Code: [Select]
mkinitcpio -P

Unfortunately, this didn’t help. The situation is still: ‘The font is set for a slight moment after reboot (…) and then the default font is used again.’

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #6
Huh, interesting it sounds like udev starting (that's what the screen blanking out is) resets the font. The fix should just be to add an explict dependency on udevadm so console-setup starts afterwards. I'll push a new version of s6-scripts later today.


Re: How to change TTY font permanently? (It gets reset immediately)

Reply #8
Just now I have realised that there was an update to s6-scripts yesterday, and that was enough to fix the issue. (And so the +udevadm update won’t be needed.)

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #9
Just now I have realised that there was an update to s6-scripts yesterday, and that was enough to fix the issue. (And so the +udevadm update won’t be needed.)

Ah oops, so that did work. Thanks for checking back on this.

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #10
I have the same problem with open-rc. The console font is set and then removed after the black screen

Re: How to change TTY font permanently? (It gets reset immediately)

Reply #11
Activate consolefont in default runlevel: rc-update add consolefont.



Re: [SOLVED] How to change TTY font permanently? (It gets reset immediately)

Reply #14
Then append a line in /etc/rc.local (or create an executable /etc/local.d/consolefont.start file containing):
Code: [Select]
rc-service consolefont restart
Thanks ; That did the job ;)