Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,6 +868,9 @@ def minimal_installation(
pacman_conf.enable(optional_repositories)
pacman_conf.apply()

if locale_config:
self.set_vconsole(locale_config)

self.pacman.strap(self._base_packages)
self._helper_flags['base-strapped'] = True

Expand Down Expand Up @@ -1783,6 +1786,29 @@ def chown(self, owner: str, path: str, options: list[str] = []) -> bool:
except SysCallError:
return False

def set_vconsole(self, locale_config: 'LocaleConfiguration') -> None:
# use the already set kb layout
kb_vconsole: str = locale_config.kb_layout
# this is the default used in ISO other option for hdpi screens TER16x32
# can be checked using
# zgrep "CONFIG_FONT" /proc/config.gz
# https://wiki.archlinux.org/title/Linux_console#Fonts

font_vconsole = 'default8x16'

# Ensure /etc exists
vconsole_dir: Path = self.target / 'etc'
vconsole_dir.mkdir(parents=True, exist_ok=True)
vconsole_path: Path = vconsole_dir / 'vconsole.conf'

# Write both KEYMAP and FONT to vconsole.conf
vconsole_content = f'KEYMAP={kb_vconsole}\n'
# Corrects another warning
vconsole_content += f'FONT={font_vconsole}\n'

vconsole_path.write_text(vconsole_content)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it certain that this file does not exist at this point? If so then this iwll override any existing content

Copy link
Collaborator

@svartkanin svartkanin Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, shouldn't we use localectl to update the file?
Running a localectrl set-keymap XXX will update this file for me, so I don't understand why we would want to do this manually?

For convenience, localectl may be used to set the console keymap. It will change the KEYMAP variable in /etc/vconsole.conf and also set the keymap for the current session:

We may have to update the call here https://github.com/svartkanin/archinstall/blob/275259928c34d59cd166055e675938719b2b7276/archinstall/lib/installer.py?plain=1#L1779 to also call localectl on target

Copy link
Contributor Author

@h8d13 h8d13 Nov 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically without it the first base hook fails hence why i needed to place it before_base

And calling localectl before base well this was more straightforward and uses already existing content of config.

https://www.reddit.com/r/archlinux/comments/1otgoas/issue_with_mkinitcpio/

This also makes encryption layouts possible i guess ? I was using ckbcomp with grub manually before to generate layout files for French keyboard from AUR 😩

These need to be latin compatible to my understanding at least with grub which why I had added all the docs comments lmao but since you validate ASCII for passwords and such

And i think these are different things needs specifically
KEYMAP= and FONT=

Maybe we could detect screen size to set font to larger alternative dynamically

Sorry for bad img from reddit

image

Currently same happens with archinstall but keeps going (non-fatal) with vconsole.conf being set:

Screenshot_20251111_134321

Copy link
Contributor Author

@h8d13 h8d13 Nov 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also since it's called before it doesn't get overwritten in the subsequent calls

514026282-1a2f1a6d-5a1f-4e7a-a199-7c8ded4540e4.png

Continuation of #1187 with a earlier approach @svartkanin would be great to get some feedback as this could help many users using different kb than US (altho I'm unsure about limitation outside of latin range). Or update instructions: https://github.com/archlinux/archinstall/blob/master/archinstall/locales/README.md

You test on branch: testing in https://github.com/h8d13/archinstall-patch

Which also includes my hardware draft for laptops

info(f'Wrote to {vconsole_path} using {kb_vconsole} and {font_vconsole}')

def set_keyboard_language(self, language: str) -> bool:
info(f'Setting keyboard language to {language}')

Expand Down