Artix Linux Forum

Artix Linux => Installation / Migration / Configuration => Topic started by: tiosgz on 07 March 2021, 12:18:02

Title: [SOLVED] How to change TTY font permanently? (It gets reset immediately)
Post by: tiosgz on 07 March 2021, 12:18:02
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?
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: strajder on 07 March 2021, 23:20:09
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.
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: tiosgz on 08 March 2021, 08:38:12
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.
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: strajder on 08 March 2021, 12:56:02
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
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: alium on 08 March 2021, 13:26:13
add in /etc/mkinitcpio.conf In HOOKS line "consolefont" (between "keyboard" and "keymap")
and generate new initial ramdisk :
Code: [Select]
mkinitcpio -P


for more details see https://wiki.archlinux.org/index.php/Mkinitcpio#Common_hooks
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: tiosgz on 08 March 2021, 14:12:07
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.’
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: Dudemanguy on 08 March 2021, 15:06:53
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.
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: tiosgz on 08 March 2021, 15:20:57
The fix should just be to add an explict dependency on udevadm so console-setup starts afterwards.

That worked, thank you!
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: tiosgz on 08 March 2021, 16:45:11
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.)
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: Dudemanguy on 08 March 2021, 23:15:24
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.
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: ukemi on 19 March 2021, 12:01:46
I have the same problem with open-rc. The console font is set and then removed after the black screen
Title: Re: How to change TTY font permanently? (It gets reset immediately)
Post by: nous on 19 March 2021, 12:37:51
Activate consolefont in default runlevel: rc-update add consolefont.
Title: Re: [SOLVED] How to change TTY font permanently? (It gets reset immediately)
Post by: ukemi on 19 March 2021, 17:28:43
Activate consolefont in default runlevel: rc-update add consolefont.
I 've already done that
Title: Re: [SOLVED] How to change TTY font permanently? (It gets reset immediately)
Post by: nous on 21 March 2021, 14:29:54
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
Title: Re: [SOLVED] How to change TTY font permanently? (It gets reset immediately)
Post by: ukemi on 26 March 2021, 14:57:07
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 ;)