From 2281334cb71bb1f94deef323df09fb897efd117d Mon Sep 17 00:00:00 2001 From: Chunmei Xu Date: Mon, 28 Mar 2022 11:30:46 +0800 Subject: [PATCH] add xkb and leagcy keymaps subdirs to loadkeys search paths unicode_start init from /etc/vconsole.conf Signed-off-by: Chunmei Xu --- ...acy-keymaps-subdirs-to-loadkyes-sear.patch | 40 +++++++++++++++++++ ...de_start-init-from-etc-vconsole.conf.patch | 37 +++++++++++++++++ kbd.spec | 10 ++++- 3 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 0001-adds-xkb-and-legacy-keymaps-subdirs-to-loadkyes-sear.patch create mode 100644 0002-unicode_start-init-from-etc-vconsole.conf.patch diff --git a/0001-adds-xkb-and-legacy-keymaps-subdirs-to-loadkyes-sear.patch b/0001-adds-xkb-and-legacy-keymaps-subdirs-to-loadkyes-sear.patch new file mode 100644 index 0000000..a66fa5d --- /dev/null +++ b/0001-adds-xkb-and-legacy-keymaps-subdirs-to-loadkyes-sear.patch @@ -0,0 +1,40 @@ +From 2e2106a4b05f28bb83f829f9ee915956ebfa448c Mon Sep 17 00:00:00 2001 +From: Chunmei Xu +Date: Mon, 28 Mar 2022 10:48:16 +0800 +Subject: [PATCH] adds xkb and legacy keymaps subdirs to loadkyes search path + +Signed-off-by: Chunmei Xu +--- + src/loadkeys.c | 2 ++ + src/paths.h | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/src/loadkeys.c b/src/loadkeys.c +index c27bf7e..2b05a45 100644 +--- a/src/loadkeys.c ++++ b/src/loadkeys.c +@@ -28,6 +28,8 @@ + static const char *const dirpath1[] = { + "", + DATADIR "/" KEYMAPDIR "/**", ++ DATADIR "/" LEGACYKEYMAPDIR "/**", ++ DATADIR "/" XKBKEYMAPDIR "/", + KERNDIR "/", + NULL + }; +diff --git a/src/paths.h b/src/paths.h +index 66830e2..414a29f 100644 +--- a/src/paths.h ++++ b/src/paths.h +@@ -5,6 +5,8 @@ + * The following five subdirectories are defined: + */ + #define KEYMAPDIR "keymaps" ++#define XKBKEYMAPDIR "keymaps/xkb" ++#define LEGACYKEYMAPDIR "keymaps/legacy" + #define UNIMAPDIR "unimaps" + #define TRANSDIR "consoletrans" + #define VIDEOMODEDIR "videomodes" +-- +2.19.1.6.gb485710b + diff --git a/0002-unicode_start-init-from-etc-vconsole.conf.patch b/0002-unicode_start-init-from-etc-vconsole.conf.patch new file mode 100644 index 0000000..e709dfb --- /dev/null +++ b/0002-unicode_start-init-from-etc-vconsole.conf.patch @@ -0,0 +1,37 @@ +From 5890ac3d532e3438c856233f76bd8cd4f510eb26 Mon Sep 17 00:00:00 2001 +From: Chunmei Xu +Date: Mon, 28 Mar 2022 16:55:27 +0800 +Subject: [PATCH] unicode_start init from /etc/vconsole.conf + +Signed-off-by: Chunmei Xu +--- + src/unicode_start | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/unicode_start b/src/unicode_start +index d5234a8..86e3b01 100755 +--- a/src/unicode_start ++++ b/src/unicode_start +@@ -72,6 +72,11 @@ stty iutf8 + # have a Unicode map attached, or explicitly specified, e.g., + # by giving `def.uni' as a second argument. + ++# Source /etc/vconsole.conf to get default font ++. /etc/vconsole.conf ++ ++DEFAULT_UNICODE_FONT=$FONT ++ + case "$#" in + 2) + setfont "$1" -u "$2" +@@ -80,6 +85,7 @@ case "$#" in + setfont "$1" + ;; + 0) ++ setfont $DEFAULT_UNICODE_FONT + ;; + *) + echo "usage: unicode_start [font [unicode map]]" +-- +2.34.1 + diff --git a/kbd.spec b/kbd.spec index c9975a3..33a623a 100644 --- a/kbd.spec +++ b/kbd.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 # {_exec_prefix}/lib/kbd is correct even on x86_64. # It is traditionally used for kdb data (console fonts, keymaps, ...). # It is not used for any shared objects/executables. @@ -12,6 +12,8 @@ License: GPLv2+ URL: http://www.kbd-project.org/ Source0: https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-2.4.0.tar.xz +Patch1: 0001-adds-xkb-and-legacy-keymaps-subdirs-to-loadkyes-sear.patch +Patch2: 0002-unicode_start-init-from-etc-vconsole.conf.patch BuildRequires: gcc, bison, flex, gettext, pam-devel, check-devel, automake BuildRequires: console-setup, xkeyboard-config @@ -43,7 +45,7 @@ The %{name}-legacy package contains original keymaps for kbd package. Please note that %{name}-legacy is not helpful without kbd. %prep -%setup -q +%autosetup -p1 aclocal autoconf @@ -137,5 +139,9 @@ make check %{kbd_datadir}/keymaps/legacy %changelog +* Mon Mar 28 2022 Chunmei Xu - 2.4.0-1 +- adds xkb and legacy keymaps subdirs to loadkyes search path +- unicode_start init from /etc/vconsole.conf + * Tue Mar 8 2022 Liwei Ge - 2.4.0-1 - Init version from upstream v2.4.0 -- Gitee