-
-
Notifications
You must be signed in to change notification settings - Fork 206
International keyboad keymaps support through Options-> Change configuration Settings -> Change Keyboard layout #1961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
International keyboad keymaps support through Options-> Change configuration Settings -> Change Keyboard layout #1961
Conversation
25351ab to
9717f02
Compare
This comment was marked as outdated.
This comment was marked as outdated.
…s (terminfo/l/linux -> /etc/terminfo/l/linux previously under tools.cpio) TODO: detail work done here prior of merge For the moment, see this uncleaned branch https://github.com/tlaurion/heads/tree/transition_to_data_cpio Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…source keyboard keymaps under data.cpio user@localhost:~/heads$ ls -alh /home/user/heads/build/x86/qemu-coreboot-whiptail-tpm2/data.cpio -rw-r--r-- 1 root root 2.4M Apr 23 12:33 /home/user/heads/build/x86/qemu-coreboot-whiptail-tpm2/data.cpio user@localhost:~/heads$ sudo xz --check=crc32 --lzma2=dict=1MiB build/x86/qemu-coreboot-whiptail-tpm2/data.cpio -z -9 user@localhost:~/heads$ ls -alh build/x86/qemu-coreboot-whiptail-tpm2/data.cpio.xz -rw-r--r-- 1 root root 158K Apr 23 12:33 build/x86/qemu-coreboot-whiptail-tpm2/data.cpio.xz So adding all source based keymaps add 158Kb compressed to initrd.cpio.xz TODO: - init: if exported keymap_path and file exists: loadkeys it; otherwise ontinue as of now and defaults to default US keymap - Configurator deitor: show filelist, loadkeys keymap, test input with user, confirm keymap selection, persist setting - Add to oem-factory-reset (but adds another step: in default steps? in non-default? Desired workflow?) - This is desired for a long time since OEM customize keyboard selected by end user prior of shipping: so should customize keymap under Heads and OS install. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…yboard mappings for this board
TODO: Would need patching
Error:
user@localhost:~/heads$ cat /home/user/heads/build/ppc64/log/kbd.log
make -C "/home/user/heads/build/ppc64/kbd-2.6.1" -j12 --load-average=18 CC=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-gcc -fdebug-prefix-map=/home/user/heads=heads -gno-record-gcc-switches -D__MUSL__ --sysroot /home/user/heads/install/ppc64 -isystem /home/user/heads/install/ppc64/include -L/home/user/heads/install/ppc64/lib AR=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-ar LD=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-ld STRIP=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-strip NM=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-nm OBJCOPY=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-objcopy OBJDUMP=/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-objdump PKG_CONFIG_PATH= PKG_CONFIG_LIBDIR=/home/user/heads/install/ppc64/lib/pkgconfig PKG_CONFIG_SYSROOT_DIR=/home/user/heads/install/ppc64
make[1]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1'
make all-recursive
make[2]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1'
Making all in src
make[3]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
Making all in libcommon
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libcommon'
CC getfd.o
CC error.o
CC version.o
AR libcommon.a
/home/user/heads/crossgcc/ppc64/bin/powerpc64le-linux-musl-ar: `u' modifier ignored since `D' is the default (see `U')
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libcommon'
Making all in libkbdfile
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkbdfile'
CC init.lo
CC kbdfile.lo
CCLD libkbdfile.la
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkbdfile'
Making all in libkfont
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkfont'
CC psffontop.lo
CC psfxtable.lo
CC utf8.lo
CC kdmapop.lo
CC context.lo
CC unicode.lo
CC kdfontop.lo
CC loadunimap.lo
CC mapscrn.lo
CC setfont.lo
setfont.c: In function 'try_loadfont':
setfont.c:102:14: warning: conversion from 'int' to 'unsigned char' may change value [-Wconversion]
102 | b2 |= 3 << (j * 2);
| ^
mapscrn.c: In function 'kfont_load_consolemap':
mapscrn.c:161:13: warning: conversion from 'int' to 'short unsigned int' may change value [-Wconversion]
161 | ubuf[i] = (0xf000 + i);
| ^
loadunimap.c: In function 'parseline':
loadunimap.c:220:24: warning: conversion from 'int' to 'short unsigned int' may change value [-Wconversion]
220 | unsigned short un = un0 - fp0;
| ^~~
loadunimap.c:221:38: warning: conversion from 'int' to 'short unsigned int' may change value [-Wconversion]
221 | if ((ret = add_unipair(ctx, i, un + i, list, listsz, listct)) < 0)
| ~~~^~~
CCLD libkfont.la
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkfont'
Making all in libkeymap
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
make all-am
make[5]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
CC array.lo
CC common.lo
CC dump.lo
CC kernel.lo
CC kmap.lo
CC func.lo
CC diacr.lo
CC loadkeys.lo
CC summary.lo
CC parser.lo
CC modifiers.lo
CC analyze.lo
kernel.c: In function 'lk_kernel_diacrs':
kernel.c:101:16: warning: conversion from 'long unsigned int' to 'int' may change value [-Wconversion]
101 | if (ioctl(fd, request, (unsigned long)&kd)) {
| ^~~~~~~
CC ksyms.lo
CCLD libkeymap.la
make[5]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/libkeymap'
Making all in vlock
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/vlock'
make[4]: Nothing to be done for 'all'.
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src/vlock'
make[4]: Entering directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
CC mapscrn.o
CC loadunimap.o
CC dumpkeys.o
CC showkey.o
CC loadkeys.o
CC setfont.o
CC showconsolefont.o
CC setmetamode.o
CC setleds.o
CC kbd_mode.o
CC psfxtable.o
CC fgconsole.o
CC kbdrate.o
CC chvt.o
CC deallocvt.o
CC openvt.o
CC kbdinfo.o
CC getkeycodes.o
CC setvtrgb.o
CC setkeycodes.o
CC resizecons.o
CCLD mapscrn
CCLD loadunimap
resizecons.c: In function 'main':
resizecons.c:303:19: warning: signed conversion from 'long unsigned int' to 'int' changes value from '2148037735' to '-2146929561' [-Wsign-conversion]
303 | if (ioctl(fd, TIOCSWINSZ, &winsize))
| ^~~~~~~~~~
CCLD dumpkeys
CCLD loadkeys
resizecons.c: In function 'vga_set_cursor':
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
394 | __asm__ volatile("outb %0,%1"
| ^~~~~~~
resizecons.c:402:2: error: inconsistent operand constraints in an 'asm'
402 | __asm__ volatile("inb %1,%0"
| ^~~~~~~
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
394 | __asm__ volatile("outb %0,%1"
| ^~~~~~~
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
394 | __asm__ volatile("outb %0,%1"
| ^~~~~~~
resizecons.c:402:2: error: inconsistent operand constraints in an 'asm'
402 | __asm__ volatile("inb %1,%0"
| ^~~~~~~
resizecons.c:394:2: error: inconsistent operand constraints in an 'asm'
394 | __asm__ volatile("outb %0,%1"
| ^~~~~~~
CCLD showkey
make[4]: *** [Makefile:993: resizecons.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
make[3]: *** [Makefile:1040: all-recursive] Error 1
make[3]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1/src'
make[2]: *** [Makefile:489: all-recursive] Error 1
make[2]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1'
make[1]: *** [Makefile:420: all] Error 2
make[1]: Leaving directory '/home/user/heads/build/ppc64/kbd-2.6.1'
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…llback/save to persist across reboots Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…it after usb drivers loaded for optional usb keyboard support Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…ib/kbd/keymaps/i386/qwerty/us.map' explicitely since qemu don't support internal flashing still Signed-off-by: Thierry Laurion <insurgo@riseup.net>
…y/qwertz/azerty) prior of chossing, testing one, rejecting, testing one until confirming ok. Signed-off-by: Thierry Laurion <insurgo@riseup.net>
9717f02 to
e74852a
Compare
|
Notes: https://novacustom.com/product/keyboard-for-v56-series/ keyboard customization would be covered by end user customization at reception for now with 33be47f and e74852a Updated OP with pictures. |
Signed-off-by: Thierry Laurion <insurgo@riseup.net>
|
The t420 an x220 don't have enough space in their 8MB SPI chips. Will need to explicitly disable kdb+loadkeys+keymap inclusions for those boards, otherwise more R&D needed under #590 (not planned) |
…ard keymaps) for those boards with insufficient SPI space (8MB) Signed-off-by: Thierry Laurion <insurgo@riseup.net>
|
@JonathonHall-Purism comments on the approach, UX? What should be added to oem-factory-reset so OEM can easily set proper keyboard layout (keymap) without further complexifying UX? (oem can already do early 'o' to enter custom codepath under testing for further requirements). |
This is the actual default keymap the kernel loads by default (it is different from any of the keymaps provided by kbd, although possibly not in any way anyone would care about). This makes loadkeys --default work. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
Put a board's keymap at /etc/board_keys.map and support it in the normal logic, instead of with ad-hoc logic in the board init. Whenever loading a new keymap, reset the current keymap first, and load the board's override last (if there is one). This way, the result is always the same even if the new keymap does not define all keys, and the board's overridden keys stay overridden. Use the actual kernel default instead of us.map (which is different, but possibly not in any way anyone would care about). Remove some redundant loads of the current keymap when canceling. We already restore the current keymap any time a change was made that was rejected. Signed-off-by: Jonathon Hall <jonathon.hall@puri.sm>
|
@tlaurion I put a few commits here: https://github.com/JonathonHall-Purism/heads/commits/inconditional_kdb_inclusion-PoC-include_all_keymaps/ Mainly improves how this interacts with the Librem 11 keymap, couple other things we chatted about. Re: OEM reset - I would rather not add anything to the OEM reset flow that occurs from the main menu. That's our go-to solution for customers who get stuck in a confusing situation, and we can't complicate that further. I'm biased for the OEM reset that OEMs actually do - we don't currently use the 'o' key early OEM reset, and all of our shipping devices only have US keyboard layouts so we don't need to change anything when shipping. If others want something I'd be OK as long as it doesn't complicate the OEM reset flow that we have users follow. If you're good with the above commits and don't have anything else, let's merge this 🚢 |
…G message where useful, add context in case linux shipped keymap not loading for DO_WITH_DEBUG Signed-off-by: Thierry Laurion <insurgo@riseup.net>
bugfix: Fix data.cpio reproductibility issue introduced by #1961

Fixes #555 #1831
See #1961 (comment) for current state (screenshots)
To test this PoC under Qemu
./docker_repro.sh make BOARD=qemu-coreboot-whiptail-tpm2 real.remove_canary_files-extract_patch_rebuild_what_changed./docker_repro.sh make BOARD=qemu-coreboot-whiptail-tpm2./docker_repro.sh make BOARD=qemu-coreboot-whiptail-tpm2 runTODOs
@JonathonHall-Purism comments?
How to Change Keyboard Keymap









old (2025-04-23)
Then go to Recovery shell on main console.Then explore keyboards keymaps under /etc/keymaps/i386:
