From a100d8f7cc3d95cabc3defcf7d398872e2450434 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Fonzo?= Date: Mon, 15 Mar 2021 09:56:40 -0300 Subject: [PATCH] recipes: tools/kbd: Improve kbd using patches MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Matías Fonzo --- patches/kbd/kbd-1.15-keycodes-man.patch | 52 +++++++++++++++++++++++++++++++ patches/kbd/kbd-1.15-unicode_start.patch | 21 +++++++++++++ patches/kbd/kbd-2.0.4-covscan-fixes.patch | 11 +++++++ recipes/tools/kbd/recipe | 10 ++++-- 4 files changed, 92 insertions(+), 2 deletions(-) create mode 100644 patches/kbd/kbd-1.15-keycodes-man.patch create mode 100644 patches/kbd/kbd-1.15-unicode_start.patch create mode 100644 patches/kbd/kbd-2.0.4-covscan-fixes.patch diff --git a/patches/kbd/kbd-1.15-keycodes-man.patch b/patches/kbd/kbd-1.15-keycodes-man.patch new file mode 100644 index 00000000..e400c9df --- /dev/null +++ b/patches/kbd/kbd-1.15-keycodes-man.patch @@ -0,0 +1,52 @@ +diff -up kbd-2.3.0/docs/man/man1/showkey.1.orig kbd-2.3.0/docs/man/man1/showkey.1 +--- kbd-2.3.0/docs/man/man1/showkey.1.orig 2020-07-08 19:25:47.000000000 +0200 ++++ kbd-2.3.0/docs/man/man1/showkey.1 2020-07-16 08:56:15.970254183 +0200 +@@ -84,6 +84,19 @@ corresponds to what the keyboard hardwar + to know the scan codes sent by various keys it is better to boot a + 2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0 + that tells the 2.6 kernel to return the actual scan codes. ++ ++.SH NOTES ++The raw scan codes are available only on AT and PS/2 keyboards, ++and even then they are disabled unless the ++.B atkbd.softraw=0 ++kernel parameter is used. ++When the raw scan codes are not available, the kernel uses a fixed built-in ++table to produce scan codes from keycodes. Thus, ++.BR setkeycodes (8) ++can affect the output of ++.B showkey ++in scan code dump mode. ++ + .SH "SEE ALSO" + .BR loadkeys (1), + .BR dumpkeys (1), +diff -up kbd-2.3.0/docs/man/man8/setkeycodes.8.orig kbd-2.3.0/docs/man/man8/setkeycodes.8 +--- kbd-2.3.0/docs/man/man8/setkeycodes.8.orig 2020-07-08 19:35:35.000000000 +0200 ++++ kbd-2.3.0/docs/man/man8/setkeycodes.8 2020-07-16 08:57:52.293900997 +0200 +@@ -42,6 +42,10 @@ the command + will assign the keycode 112 to it, and then + .BR loadkeys (1) + can be used to define the function of this key. ++ ++USB keyboards have standardized keycodes and ++.B setkeycodes ++doesn't affect them at all. + .LP + Some older kernels might hardwire a low scancode range to the + equivalent keycodes; setkeycodes will fail when you try to remap +@@ -60,6 +64,14 @@ None. + .SH BUGS + The keycodes of X have nothing to do with those of Linux. + Unusual keys can be made visible under Linux, but not under X. ++ ++.B setkeycodes ++affects only the "first" input device ++that has modifiable scancode-to-keycode mapping. ++If there is more than one such device, ++.B setkeycodes ++cannot change the mapping of other devices than the "first" one. ++ + .SH "SEE ALSO" + .BR dumpkeys (1), + .BR loadkeys (1), diff --git a/patches/kbd/kbd-1.15-unicode_start.patch b/patches/kbd/kbd-1.15-unicode_start.patch new file mode 100644 index 00000000..119fe78d --- /dev/null +++ b/patches/kbd/kbd-1.15-unicode_start.patch @@ -0,0 +1,21 @@ +diff -up kbd-1.15.2/src/unicode_start.orig kbd-1.15.2/src/unicode_start +--- kbd-1.15.2/src/unicode_start.orig 2011-01-05 13:28:22.079662644 +0100 ++++ kbd-1.15.2/src/unicode_start 2011-01-05 13:29:01.327353698 +0100 +@@ -72,6 +72,9 @@ stty iutf8 + # have a Unicode map attached, or explicitly specified, e.g., + # by giving `def.uni' as a second argument. + ++DEFAULT_UNICODE_FONT=latarcyrheb-sun16 ++# Also drdos8x16 is a good candidate. ++ + case "$#" in + 2) + setfont "$1" -u "$2" +@@ -80,6 +83,7 @@ case "$#" in + setfont "$1" + ;; + 0) ++ setfont $DEFAULT_UNICODE_FONT + ;; + *) + echo "usage: unicode_start [font [unicode map]]" diff --git a/patches/kbd/kbd-2.0.4-covscan-fixes.patch b/patches/kbd/kbd-2.0.4-covscan-fixes.patch new file mode 100644 index 00000000..53601411 --- /dev/null +++ b/patches/kbd/kbd-2.0.4-covscan-fixes.patch @@ -0,0 +1,11 @@ +diff -up kbd-2.3.0/src/libkfont/kdmapop.c.orig kbd-2.3.0/src/libkfont/kdmapop.c +--- kbd-2.3.0/src/libkfont/kdmapop.c.orig 2020-04-27 17:53:01.000000000 +0200 ++++ kbd-2.3.0/src/libkfont/kdmapop.c 2020-07-16 09:06:45.246742724 +0200 +@@ -166,6 +166,7 @@ kfont_get_unicodemap(struct kfont_contex + + if (ioctl(fd, GIO_UNIMAP, &ud)) { + KFONT_ERR(ctx, "ioctl(GIO_UNIMAP): %m"); ++ free(ud.entries); + return -1; + } + if (ct != ud.entry_ct) diff --git a/recipes/tools/kbd/recipe b/recipes/tools/kbd/recipe index 48836ea1..9c6d6b5d 100644 --- a/recipes/tools/kbd/recipe +++ b/recipes/tools/kbd/recipe @@ -19,7 +19,7 @@ set -e program=kbd version=2.4.0 -release=1 +release=2 # Define a category for the output of the package name pkgcategory=tools @@ -51,6 +51,11 @@ build() # Set sane permissions chmod -R u+w,go-w,a+rX-s . + # Use patches from Fedora to improve kbd + patch -Np1 -i "${worktree}/patches/kbd/kbd-1.15-keycodes-man.patch" + patch -Np1 -i "${worktree}/patches/kbd/kbd-1.15-unicode_start.patch" + patch -Np1 -i "${worktree}/patches/kbd/kbd-2.0.4-covscan-fixes.patch" + # Fix inconsistent behaviour of Backspace and Delete keys # for i386 keymaps (Thanks to "Linux From Scratch") patch -Np1 -i "${worktree}/patches/kbd/kbd-2.4.0-backspace-1.patch" @@ -62,7 +67,8 @@ build() sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in - ./configure CPPFLAGS="$QICPPFLAGS" CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ + ./configure CPPFLAGS="$QICPPFLAGS" \ + CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \ $configure_args \ --libdir=/usr/lib${libSuffix} \ --mandir=$mandir \ -- 2.11.4.GIT