core icon indicating copy to clipboard operation
core copied to clipboard

Feature: Console menu option for changing keyboard layout

Open maurice-w opened this issue 2 years ago • 2 comments

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

  • [x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [x] I am convinced that my issue is new after having checked both open and closed issues at https://github.com/opnsense/core/issues?q=is%3Aissue

Is your feature request related to a problem? Please describe.

The OPNsense installer prompts you to choose a keyboard layout for the VGA console. But preinstalled images like nano or vm just default to a US layout and there is no user-friendly way to change this.

Describe the solution you like

I would like an additional option in the console menu for changing the keyboard layout. Something like this:

image

Describe alternatives you considered

Google freebsd change keyboard layout and go from there. :-)

maurice-w avatar Jul 25 '22 19:07 maurice-w

There is such a thing as kbdmap utility but it doesn't seem to store the value. You can also launch the installer's keymap screen via bsdinstall keymap which also fails to render the resulting value in /etc/rc.conf. We could probably add a wrapper around the later one and install the resulting change from /tmp/bsdinstall_etc/rc.conf.keymap in the system file?

Cheers, Franco

fichtner avatar Jul 26 '22 06:07 fichtner

It's indeed incredible how confusing something as basic as changing the keymap can get.

In addition to kbdmap (non-persistent) and bsdinstall keymap (only intended for new installs), there is also bsdconfig syscons_keymap. It does write to /etc/rc.conf, but seems outdated and still uses a hardcoded list of syscons keymaps instead of vt keymaps: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=231591 freebsd/freebsd-src/blob/master/usr.sbin/bsdconfig/console/keymap

The best option would be getting bsdconfig fixed upstream, the second best writing a wrapper for bsdinstall as you suggested.

Cheers Maurice

maurice-w avatar Jul 26 '22 12:07 maurice-w

This issue has been automatically timed-out (after 180 days of inactivity).

For more information about the policies for this repository, please read https://github.com/opnsense/core/blob/master/CONTRIBUTING.md for further details.

If someone wants to step up and work on this issue, just let us know, so we can reopen the issue and assign an owner to it.

OPNsense-bot avatar Jan 21 '23 19:01 OPNsense-bot

@maurice-w I've played with this a tiny bit:

# rm -f /etc/rc.conf.d/syscons && env KEYMAPFILE=/etc/rc.conf.d/syscons bsdinstall keymap && /etc/rc.d/syscons start

This obviously doesn't work for SSH and I doubt the placement a little in the console menu either way. It would perhaps fit the GUI but that would also require registering and hooking the values which is more work than worth it perhaps and doesn't work nice for initial deployment/console-based setup.

Cheers, Franco

fichtner avatar Aug 14 '23 10:08 fichtner

# rm -f /etc/rc.conf.d/syscons && env KEYMAPFILE=/etc/rc.conf.d/syscons bsdinstall keymap && /etc/rc.d/syscons start

Very nice, works fine! Placing it in the console menu would be a good choice imho, because that's the place where you really need it (for initial deployment or troubleshooting when the Web GUI doesn't work). I wouldn't bother with placing it in the Web GUI.

Cheers Maurice

maurice-w avatar Aug 30 '23 17:08 maurice-w

Coincidentally, we discussed this today and the problem with the console menu entry is that it does not work for SSH which will be a source of confusion and unnecessary support. Not sure how to solve this. Conditionally showing the entry is not a good solution either for the same reason.

Cheers, Franco

fichtner avatar Aug 30 '23 17:08 fichtner

Setting the keymap works just fine over SSH or serial console, but of course you'll only notice the change when using a locally attached keyboard. Maybe adding something like this would help avoid any confusion?

&& echo 'The local keyboard layout has been changed. This does not affect SSH or serial console behaviour.'

maurice-w avatar Aug 30 '23 19:08 maurice-w

We discussed priorities and this one dropped of the list. Too much work for too little use.

AdSchellevis avatar Jan 03 '24 09:01 AdSchellevis