VConsole error during boot; localectl, loadkeys and dumpkeys not working correctly Can't use keyboard for my language (pt-BR) nor change it

Since I upgrade from Fedora 33 to 34, during boot the verbosity is partially re-enabled to show vconsole in error. As I saw just the message I was expecting it would correct after some updates. After trying to use my external keyboard of different layout with pt-BR, I discovered that I can’t put accent on letters and that loadkeys nor localectl are working properly: 'e 'c 'o 'a 'c

systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE

❯ doas loadkeys --verbose --default
loadkeys: Unable to find file: defkeymap.map

❯ sudo /usr/lib/systemd/systemd-vconsole-setup --version
Failed to open --version: No such file or directory


❯ sudo loadkeys br-abnt2
loadkeys: Unable to open file: br-abnt2: No such file or directory

❯ dumpkeys
Não foi possível obter um descritor de arquivo de referindo ao console.

❯ sudo/usr/bin/loadkeys
Não foi possível obter um descritor de arquivo de referindo ao console.

❯ sudo ls /usr/local/share/kbd/keymaps/
ls: cannot access '/usr/local/share/kbd/keymaps/': No such file or directory

❯ journalctl -xeu systemd-vconsole-setup.service
 A unidade systemd-vconsole-setup.service falhou.
 
 O resultado é failed.
mar 31 10:43:29 tars systemd[1]: Starting Setup Virtual Console...
 Subject: Unidade systemd-vconsole-setup.service sendo iniciado
 Defined-By: systemd
 Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
 
 A unidade systemd-vconsole-setup.service está sendo iniciada.
mar 31 10:43:29 tars systemd-vconsole-setup[5515]: loadkeys: Não foi possível abrir o arquivo: br-abnt2: Arquivo ou diretório inexistente
mar 31 10:43:29 tars systemd-vconsole-setup[5512]: /usr/bin/loadkeys failed with exit status 1.
mar 31 10:43:29 tars systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
 Subject: Unit process exited
 Defined-By: systemd
 Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
 
 An ExecStart= process belonging to unit systemd-vconsole-setup.service has exited.
 
 The process' exit code is 'exited' and its exit status is 1.
mar 31 10:43:29 tars systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
 Subject: Unit failed
 Defined-By: systemd
 Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
 
 The unit systemd-vconsole-setup.service has entered the 'failed' state with result 'exit-code'.
mar 31 10:43:29 tars systemd[1]: Failed to start Setup Virtual Console.
 Subject: A unidade systemd-vconsole-setup.service falhou
 Defined-By: systemd
 Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
 
 A unidade systemd-vconsole-setup.service falhou.
 
 O resultado é failed.

❯ dmesg --ctime | grep vconsole                                                                                                         
[qua mar 31 10:40:11 2021] systemd[1]: systemd-vconsole-setup.service: Main process exited, code=exited, status=1/FAILURE
[qua mar 31 10:40:11 2021] systemd[1]: systemd-vconsole-setup.service: Failed with result 'exit-code'.
[qua mar 31 10:40:11 2021] audit: type=1130 audit(1617198012.095:3): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=kernel msg='unit=systemd-vconsole-setup comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'

❯ cat /usr/lib/systemd/system/systemd-vconsole-setup.service
#  SPDX-License-Identifier: LGPL-2.1-or-later
#
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Setup Virtual Console
Documentation=man:systemd-vconsole-setup.service(8) man:vconsole.conf(5)
DefaultDependencies=no
Before=initrd-switch-root.target shutdown.target
ConditionPathExists=/dev/tty0

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/lib/systemd/systemd-vconsole-setup

❯ uname -a
Linux tars 5.11.11-300.fc34.x86_64 #1 SMP Tue Mar 30 16:37:11 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

❯ systemctl --version
systemd 248 (v248~rc4-3.fc34)
+PAM +AUDIT +SELINUX -APPARMOR +IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified

Also the messages in the terminal are sometimes in English and some time in Brazilian Portuguese (default language).

Se os files estiverem faltando, tente dnf provides ‘…’. Por exemplo:

$ dnf provides '*/br-abnt2*'

Opa!
Já tentei com alguns arquivos, mas o layout problemático e do teclado de layout US, o integrado ao laptop e externo ABNT2 sem problemas.

❯ doas dnf provides '*/br-abnt2*'
Last metadata expiration check: 3:06:37 ago on Fri Apr  2 11:42:31 2021.
aspell-pt_BR-50:20090702-20.fc34.x86_64 : Brazilian Portuguese dictionaries for Aspell
Repo        : @System
Matched from:
Filename    : /usr/lib64/aspell-0.60/br-abnt2.kbd

aspell-pt_BR-50:20090702-20.fc34.x86_64 : Brazilian Portuguese dictionaries for Aspell
Repo        : fedora
Matched from:
Filename    : /usr/lib64/aspell-0.60/br-abnt2.kbd

kbd-legacy-2.4.0-2.fc34.noarch : Legacy data for kbd package
Repo        : fedora
Matched from:
Filename    : /usr/lib/kbd/keymaps/legacy/i386/qwerty/br-abnt2.map.gz

❯ doas dnf install kbd-legacy

❯ loadkeys us-intl
Não foi possível obter um descritor de arquivo de referindo ao console.

Vou fazer um teste na media live e fazer outra instalação de teste no meu SSD externo.

Possivelmente?:

$ loadkeys -C /dev/console us-intl
❯ doas loadkeys -C /dev/console us-intl
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
unknown keysym 'leftquote'
lk_add_key called with bad keycode -1
❯ loadkeys -C /dev/console us-intl
Não foi possível abrir /dev/console

Se você estiver no modo gráfico, deve usar setxkbmap:

https://bugzilla.redhat.com/show_bug.cgi?id=1332648

Correção. Parece que ibus deve ser usado com wayland:

Thanks! I saw that one too.
As my installation has some Fedora “legacy” things, like a Swap partition that I am not using and every upgrade something new is not activated/changed. I’ll format my machine to also enable LUKS2 to avoid the risk of converting.

Not sure if I really understood the problem, however one can install and set locales like this:

localectl # Show your settings
dnf search glibc-langpack # find your language pack
dnf install "your language pack" # install your language
dnf install libxkbcommon-x11 # install X11-Layouts, may not be needed
localectl set-x11-keymap "language short" # sets your language

example:
localectl set-x11-keymap de # Sets your keymaps and system language to german

Remember to set a keyboard layout neutral password in advance.

You can fine-tune your keyboard layout the same way.
localectl list-keymaps
localectl set-keymap ...

Thanks! I solved the by changing Gnomes language (twice) and changing back to Brazilian Portuguese.
The vconsole message during boot persist, but at least I can type correctly.

I’m Brazilian and use my laptop in Brazilian Portuguese language with external mouse and keyboard; Our default keyboard layout is ABNT2, which is the laptop’s integrated one and of my previous external keyboard; I got back to my brown switches keyboard, that is in US layout; So to be able to type pt-BR special characters (é, í, á, à, ç ã, õ etc) we change the layout to USA International, but changing wasn’t enabling it.

After formatting and reinstalling Fedora 34 beta, which took me more than 6 hours because of some weird problems of speed with all Fedora mirrors I tried:

Actually I have to choose between layouts: one where I can use accents the other I can use single quotes and no 3 steps double quotes : *qdq = quotes/double quotes key.

  • USA Intern., with dead keys: ´ (single quote), ¨ ( shift + quotes/double quotes key), " (shift + quotes/double quotes key and Space), é (qdq + e), á (qdq + a), ç (qdq + c)) and so on;
  • USA Intern., with dead keys AltGr: ’ (qdq), " ( shift + qdq), (shift + qdq + space), 'e (qdq + e), 'a (qdq + a), 'c (qdq + c) and so on;
  • USA Intern. alt: ´ (qdq), ¨ ( shift + qdq), " (shift + qdq + space), é (qdq + e), 'a (qdq + a), 'c (qdq + c) and so on;

Looking at this post https://mustard-mine.herokuapp.com, it seems that something chaned.

I tried to set the pt-Layout in Gnome and for me it seems to work.
é í áà ç õ works if I hit the keys next to the return key and then the letter, like ´ and e.

Then it automatically combines ~ and o to õ.

If you ever happen to install Fedora once more, I’d suggest to install from a normal image, not using the net install images. You may save time and it is more secure anyway.

Hey!
The ABNT2 layout works great, but my curren USB (external) keyboard is hasn´t ABNT2 layout, it has US layout. I can type with not problems (yet) on the laptop´s keyboard and my USB ABNT2 keyboard, but the known combination of Brazilian Portuguese with US International layouts are not working as used to.

I´m using teh US layout one because is the only 10keyless with brown switches I have and the laptop screen I use as my secondary screen, so it far from me a bit.