Hello community, here is the log from the commit of package kbd for openSUSE:Factory checked in at 2018-01-30 15:37:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kbd (Old) and /work/SRC/openSUSE:Factory/.kbd.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kbd" Tue Jan 30 15:37:59 2018 rev:87 rq:569978 version:2.0.4 Changes: -------- --- /work/SRC/openSUSE:Factory/kbd/kbd.changes 2017-12-10 18:14:33.875426402 +0100 +++ /work/SRC/openSUSE:Factory/.kbd.new/kbd.changes 2018-01-30 15:38:01.728462058 +0100 @@ -1,0 +2,14 @@ +Fri Jan 12 17:39:18 CET 2018 - [email protected] + +- Move initial NumLock handling from systemd back to kbd: + * Add kbdsettings service written by Thomas Blume (boo#1010880, + kbdsettings, kbdsettings.service, numlockbios.c, + update sysconfig.console and sysconfig.keyboard). + * Exclude numlockbios support for non x86 platforms + (kbdsettings-nox86.patch). +- Drop references to KEYTABLE and COMPOSETABLE (boo#1010880#c32, + boo#1010880#c54, sysconfig.keyboard.del, README.SUSE, + drop kbd.fillup). +- Fix paths in kbd.pl. + +------------------------------------------------------------------- Old: ---- kbd.fillup New: ---- kbdsettings kbdsettings-nox86.patch kbdsettings.service numlockbios.c ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kbd.spec ++++++ --- /var/tmp/diff_new_pack.jN1Fxc/_old 2018-01-30 15:38:03.152395578 +0100 +++ /var/tmp/diff_new_pack.jN1Fxc/_new 2018-01-30 15:38:03.156395391 +0100 @@ -1,7 +1,7 @@ # # spec file for package kbd # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -35,7 +35,6 @@ Source2: suse-add.tar.bz2 Source3: README.SUSE Source4: vlock.pamd -Source5: kbd.fillup Source8: sysconfig.console Source9: sysconfig.keyboard Source11: fbtest.c @@ -43,6 +42,9 @@ Source13: guess_encoding.pl Source14: kbd.pl Source15: cz-map.patch +Source20: kbdsettings +Source21: kbdsettings.service +Source22: numlockbios.c Source42: convert-kbd-mac.sed Source43: repack_kbd.sh Source44: xml2lst.pl @@ -61,6 +63,8 @@ # Patch13: adds xkb and legacy keymaps subdirs to loadkyes search path # (openSUSE FATE#318355, sle FATE#318426) Patch13: kbd-1.15.5-loadkeys-search-path.patch +# PATCH-FEATURE-OPENSUSE kbdsettings-nox86.patch [email protected] -- Disable "bios" option for NumLock settings on non x86 platforms. +Patch14: kbdsettings-nox86.patch BuildRequires: automake BuildRequires: bison BuildRequires: check-devel @@ -102,8 +106,13 @@ %prep %setup -q -a 1 -a 2 -n kbd-%{version} +cp -fp %{SOURCE8} . +cp -fp %{SOURCE9} . cp -fp %{SOURCE44} . cp -fp %{SOURCE45} . +cp -fp %{SOURCE20} . +cp -fp %{SOURCE21} . +cp -fp %{SOURCE22} . %patch0 -p1 %patch2 %patch3 @@ -116,6 +125,9 @@ %patch11 %patch12 -p1 %patch13 -p1 +%ifnarch %{ix86} x86_64 +%patch14 -p0 +%endif %build for i in `find data/keymaps/mac -type f` ; do @@ -141,6 +153,9 @@ --enable-optional-progs make %{?_smp_mflags} gcc %{optflags} -o fbtest $RPM_SOURCE_DIR/fbtest.c +%ifarch %{ix86} x86_64 +gcc %{optflags} -o numlockbios $RPM_SOURCE_DIR/numlockbios.c +%endif # fix lat2-16.psfu (bnc#340579) font=data/consolefonts/lat2a-16.psfu ./src/psfxtable -i $font -it data/unimaps/lat2u.uni \ @@ -241,9 +256,8 @@ ) FILLUP_DIR=%{buildroot}%{_fillupdir} mkdir -p $FILLUP_DIR -install -m 644 %{SOURCE8} $FILLUP_DIR/sysconfig.console -install -m 644 %{SOURCE9} $FILLUP_DIR/sysconfig.keyboard -cat %{SOURCE5} >> $FILLUP_DIR/sysconfig.keyboard +install -m 644 sysconfig.console $FILLUP_DIR/sysconfig.console +install -m 644 sysconfig.keyboard $FILLUP_DIR/sysconfig.keyboard %ifnarch %{ix86} x86_64 rm -f %{buildroot}%{_mandir}/man8/resizecons.8* %endif @@ -252,6 +266,10 @@ rm -f %{buildroot}%{_mandir}/man8/setkeycodes.8* %endif install -m 755 fbtest %{buildroot}%{_sbindir} +%ifarch %{ix86} x86_64 +install -d %{buildroot}%{_libexecdir}/%{name} +install -m 755 numlockbios %{buildroot}%{_libexecdir}/%{name} +%endif install -d %{buildroot}%{_sysconfdir}/pam.d install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/pam.d/vlock install -m 644 %{SOURCE12} %{buildroot}%{_mandir}/man8/ @@ -341,14 +359,32 @@ sh ./genmap4systemd.sh %{buildroot}%{kbd}/keymaps/xkb \ > %{buildroot}%{_datadir}/systemd/kbd-model-map.xkb-generated +install -m0755 kbdsettings %{buildroot}%{_sbindir}/ +install -d %{buildroot}%{_prefix}/lib/systemd/system +install -m0644 kbdsettings.service %{buildroot}%{_prefix}/lib/systemd/system + %find_lang %{name} +%pre +%{service_add_pre kbdsettings.service} + %post %{fillup_only -n console} %{fillup_only -n keyboard} +# Variables deleted before Leap 15 and SLE 15 +%{remove_and_set -n keyboard KEYTABLE COMPOSETABLE} +%ifnarch %{ix86} x86_64 +# "bios" was accepted but ingnored on non-x86 platforms up to Leap 42.* and SLE 12.* +sed -i 's/^KBD_NUMLOCK="bios"/KBD_NUMLOCK="no"/' /etc/sysconfig/keyboard +%endif +%{service_add_post kbdsettings.service} %{?regenerate_initrd_post} +%preun +%{service_del_preun kbdsettings.service} + %postun +%{service_del_postun kbdsettings.service} %{?regenerate_initrd_post} %posttrans @@ -448,6 +484,10 @@ %{_bindir}/spawn_console %{_bindir}/spawn_login %{_bindir}/vlock +%ifarch %{ix86} x86_64 +%dir %{_libexecdir}/%{name} +%{_libexecdir}/%{name}/numlockbios +%endif %{_mandir}/man1/* %{_mandir}/man5/keymaps.5%{ext_man} %ifnarch %{sparc} m68k @@ -472,7 +512,9 @@ %{_mandir}/man8/vcstime.8%{ext_man} %config(noreplace) %{_sysconfdir}/pam.d/vlock %dir %{_datadir}/systemd +%{_prefix}/lib/systemd/system/kbdsettings.service %{_datadir}/systemd/kbd-model-map.xkb-generated +%{_sbindir}/kbdsettings %files legacy %{kbd}/keymaps/legacy ++++++ README.SUSE ++++++ --- /var/tmp/diff_new_pack.jN1Fxc/_old 2018-01-30 15:38:03.200393336 +0100 +++ /var/tmp/diff_new_pack.jN1Fxc/_new 2018-01-30 15:38:03.200393336 +0100 @@ -1,16 +1,17 @@ Handling of composition of characters -========================================= +===================================== + Most of the fonts have much more characters than you can reach directly -through the keyboard. To access all of them you may use showconsolefont, -deduce the decimal code and enter it by holding down <alt> and entering +through the keyboard. To access all of them you may use showconsolefont, +deduce the decimal code and enter it by holding down <alt> and entering the code via the keypad. There's a much better way, though: Most characters may be entered via composition. Many characters are just consisting of a standard character with some sort of accent or change. Such characters can be composed by composition. Just press the <compose> key, let it go again, enter the accent and then the letter. Some examples: (Assuming Iso-Latin-1/9 character set:) -<compose> " a => � -<compose> , c => � +<compose> " a => ä +<compose> , c => ç <compose> | S => $ Support for composition is unfortunately not contained in most keymaps. @@ -18,21 +19,16 @@ (a) The <compose> key is not mapped (b) The compose tables are not included -The kbd setup scripts uses another /etc/sysconfig/keyboard variable to -determine which compose tables should be loaded and whether the compose key -should be mapped: COMPOSETABLE. -For all words listed there, loadkeys will be called with the argument -compose.word. (Except for clear which sets a flag to clear the compose -table.) Look at the compose.* files in /usr/share/kbd/keymaps/include/: +Look at the compose.* files in /usr/share/kbd/keymaps/include/: (a) You find there two files for having the <compose> key mapped. -(b) You find there compose tables which are suitable for different +(b) You find there compose tables which are suitable for different character sets. ad (a): winkeys: The compose key will be mapped on the W*n menu key shiftctrl: The compose key will be mapped to Shift Ctrl. You can use both, if you like. -ad (b): latin, latinX, latin1.add, 8859_X: Contains the compose - combinations suitable for the respective character set. +ad (b): latin, latinX, latin1.add, 8859_X: Contains the compose + combinations suitable for the respective character set. Many people will want to use latin1 or latin1.add. Just using latin is also sort of an acceptable compromise for many Latin character sets. @@ -40,10 +36,7 @@ If you want the combination of more than one table, you have to create a file which includes what you want. -Example: (/etc/sysconfig/keyboard) -COMPOSETABLE="clear winkeys shiftctrl latin1.add" - -Please keep in mind, that all these settings only affect the console, +Please keep in mind, that all these settings only affect the console, i.e. text mode. Your SuSE team ++++++ kbd.pl ++++++ --- /var/tmp/diff_new_pack.jN1Fxc/_old 2018-01-30 15:38:03.336386987 +0100 +++ /var/tmp/diff_new_pack.jN1Fxc/_new 2018-01-30 15:38:03.336386987 +0100 @@ -3,8 +3,8 @@ # simple script to switch the keyboard language # (c) 2014 [email protected] -my $sysconffile = '/etc/sysconfig/keyboard'; -my $mapdir = '/usr/share/kbd/keymaps/i386'; +my $sysconffile = '/etc/vconsole.conf'; +my $mapdir = '/usr/share/kbd/keymaps/xkb'; my $version = '1.0'; @@ -74,7 +74,7 @@ die "$what: keymap not found.\n Try $0 -h\n" unless $m->{$what}; -write_sysconf($sysconffile, { 'KEYTABLE' => $what } ); +write_sysconf($sysconffile, { 'KEYMAP' => $what } ); # system("kbd_mode -u"); # switch to unicode. Should be the default anyway. system("loadkeys $what"); # now set the keymap. ++++++ kbdsettings ++++++ #! /bin/sh . /etc/sysconfig/keyboard [ $KBD_DELAY ] && /usr/bin/kbdrate -s -d $KBD_DELAY [ $KBD_RATE ] && /usr/bin/kbdrate -s -r $KBD_RATE for i in NUM SCR CAPS; do conf=$(eval echo KBD_${i}LOCK) [ -z ${!conf} ] && continue param=$(echo ${i,,} | sed 's/scr/scroll/') for tty in ${KBD_TTY:-tty1 tty2 tty3 tty4 tty5 tty6}; do case "${!conf}" in yes) if [ $param = "num" ]; then touch /run/numlock-on fi /usr/bin/setleds -D +$param < /dev/$tty ;; no) if [ $param = "num" ]; then rm -f /run/numlock-on fi /usr/bin/setleds -D -$param < /dev/$tty ;; bios) bios=$(/usr/lib/kbd/numlockbios 2>/dev/null) if [ $param = "num" ]; then if [ "$bios" = "on" ]; then touch /run/numlock-on /usr/bin/setleds -D +$param < /dev/$tty elif [ "$bios" = "off" -o "$bios" = "unknown" ]; then rm -f /run/numlock-on /usr/bin/setleds -D -$param < /dev/$tty fi else echo "Value ${!conf} invalid for $conf" fi ;; *) echo "error: unknown value ${!conf} in $conf" ;; esac done done if [ "$KBD_DISABLE_CAPS_LOCK" = "yes" ]; then /usr/bin/dumpkeys | sed 's/ *58 *= *Caps_Lock/ 58 = Control/' | /usr/bin/loadkeys -q - fi ++++++ kbdsettings-nox86.patch ++++++ --- kbdsettings +++ kbdsettings @@ -24,20 +24,6 @@ fi /usr/bin/setleds -D -$param < /dev/$tty ;; - bios) - bios=$(/usr/lib/kbd/numlockbios 2>/dev/null) - if [ $param = "num" ]; then - if [ "$bios" = "on" ]; then - touch /run/numlock-on - /usr/bin/setleds -D +$param < /dev/$tty - elif [ "$bios" = "off" -o "$bios" = "unknown" ]; then - rm -f /run/numlock-on - /usr/bin/setleds -D -$param < /dev/$tty - fi - else - echo "Value ${!conf} invalid for $conf" - fi - ;; *) echo "error: unknown value ${!conf} in $conf" ;; --- sysconfig.keyboard +++ sysconfig.keyboard @@ -15,12 +15,12 @@ # Keyboard repeat rate (2.0 - 30.0) KBD_RATE="" -## Type: list(bios,yes,no) -## Default: bios +## Type: yesno +## Default: no # -# NumLock on? ("yes" or "no" or "bios" for BIOS setting) +# NumLock on? ("yes" or "no") # This setting may interfere with GNOME /org/gnome/settings-daemon/peripherals/keyboard/remember-numlock-state DConf key. -KBD_NUMLOCK="bios" +KBD_NUMLOCK="no" ## Type: yesno ## Default: no ++++++ kbdsettings.service ++++++ [Unit] Description=Apply settings from /etc/sysconfig/keyboard After=basic.target After=systemd-vconsole-setup.service PartOf=systemd-vconsole-setup.service ConditionPathExists=/dev/tty0 [Service] Type=oneshot ExecStart=/usr/sbin/kbdsettings RemainAfterExit=yes [Install] WantedBy=multi-user.target ++++++ numlockbios.c ++++++ #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <unistd.h> int main() { #define BIOS_DATA_AREA 0x400 #define BDA_KEYBOARD_STATUS_FLAGS_4 0x97 #define BDA_KSF4_NUMLOCK_MASK 0x02 int fdmem; char c; errno=0; fdmem = open("/dev/mem", O_RDONLY); if (fdmem < 0) { fprintf(stderr, "Couldn't open /dev/mem; %s\n", strerror(errno)); goto finish; } if (lseek(fdmem, BIOS_DATA_AREA + BDA_KEYBOARD_STATUS_FLAGS_4, SEEK_SET) == (off_t) -1) { fprintf(stderr, "Failed to seek /dev/mem: %s\n", strerror(errno)); goto finish; } if (read (fdmem, &c, sizeof(char)) == -1) { fprintf(stderr, "Failed to read /dev/mem: %s\n", strerror(errno)); goto finish; } if (c & BDA_KSF4_NUMLOCK_MASK) printf("on\n"); else printf("off\n"); finish: close(fdmem); if (errno) { printf("unknown\n"); exit(EXIT_FAILURE); } return 0; } ++++++ sysconfig.console ++++++ --- /var/tmp/diff_new_pack.jN1Fxc/_old 2018-01-30 15:38:03.428382692 +0100 +++ /var/tmp/diff_new_pack.jN1Fxc/_new 2018-01-30 15:38:03.428382692 +0100 @@ -1,5 +1,44 @@ ## Path: Hardware/Console ## Description: Text console settings (see also Hardware/Keyboard) +# + +## Type: string +## Default: "" +# +# Console settings. +# Note: The KBD_TTY setting from Hardware/Keyboard (sysconfig/keyboard) +# also applies for the settings here. +# +# Load this console font on bootup: +# (/usr/share/kbd/consolefonts/) +# +CONSOLE_FONT="" + +## Type: string +## Default: "" +# +# Some fonts come without a unicode map. +# (.psfu fonts supposedly have it, others often not.) +# You can then specify the unicode mapping of your font +# explicitly. (/usr/share/kbd/unimaps/) +# Normally not needed. +# +CONSOLE_UNICODEMAP="" + +## Type: string +## Default: "" +# +# Most programs output 8 bit characters, so you need a table to +# translate those characters into unicode. That one can be specified +# here. (/usr/share/kbd/consoletrans/) +# (Note: If your console is in utf-8 mode you don't need this.) +# If your code does not use a unicode mapping at all (because you +# e.g. explicitly specified UNICODEMAP="none") you may circumvent +# the translation via unicode, but load a map which directly maps +# 8 bit output of your program to a font position. +# +CONSOLE_SCREENMAP="" + ## Type: string ## Default: "" # @@ -8,4 +47,3 @@ # Normally not needed (automatically handled by setfont). # CONSOLE_MAGIC="" - ++++++ sysconfig.keyboard ++++++ --- /var/tmp/diff_new_pack.jN1Fxc/_old 2018-01-30 15:38:03.452381572 +0100 +++ /var/tmp/diff_new_pack.jN1Fxc/_new 2018-01-30 15:38:03.452381572 +0100 @@ -1,5 +1,8 @@ ## Path: Hardware/Keyboard -## Description: Keyboard settings +## Description: Keyboard settings for the text console +## ServiceRestart: kbdsettings +# + ## Type: integer ## Default: # @@ -15,8 +18,8 @@ ## Type: list(bios,yes,no) ## Default: bios # -# NumLock on? ("yes" or "no" or empty or "bios" for BIOS setting) -# This setting may interfere with GNOME /desktop/gnome/peripherals/keyboard/remember_numlock_state GConf key. +# NumLock on? ("yes" or "no" or "bios" for BIOS setting) +# This setting may interfere with GNOME /org/gnome/settings-daemon/peripherals/keyboard/remember-numlock-state DConf key. KBD_NUMLOCK="bios" ## Type: yesno
