From dcf0437b9233d9ef8b5e017229b7cf26d8431f5ff70b4e6bb936286d8c2a8376 Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Thu, 18 Feb 2010 14:16:14 +0000 Subject: [PATCH 1/6] Updating link to change in openSUSE:Factory/kbd revision 34.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=8372611b39a1daa092849b3dfe558f1d --- kbd-1.12-chvt-userwait.patch | 141 +++++++++++++++++++++++++++++++++++ kbd.changes | 8 ++ kbd.spec | 4 +- 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 kbd-1.12-chvt-userwait.patch diff --git a/kbd-1.12-chvt-userwait.patch b/kbd-1.12-chvt-userwait.patch new file mode 100644 index 0000000..cce1063 --- /dev/null +++ b/kbd-1.12-chvt-userwait.patch @@ -0,0 +1,141 @@ +chvt: add --userwait option + +From: Daniel Drake + +At http://bugs.gentoo.org/159729 we see chvt hanging in some scenario's. As +the solution to this is not immediately obvious, add a --userwait option +which repeatedly tries changing the terminal until the change has taken place. + +Index: kbd-1.14.1/man/man1/chvt.1 +=================================================================== +--- kbd-1.14.1.orig/man/man1/chvt.1 ++++ kbd-1.14.1/man/man1/chvt.1 +@@ -4,6 +4,9 @@ + chvt \- change foreground virtual terminal + .SH SYNOPSIS + .B chvt ++[ ++.B --userwait ++] + .I N + .SH DESCRIPTION + The command +@@ -21,3 +24,10 @@ The key combination + (with + .I N + in the range 1-12) usually has a similar effect. ++.LP ++The ++.B --userwait ++option causes the system to loop in userspace waiting for the new terminal ++to become active, as opposed to the kernel-side ++.I VT_WAITACTIVE ++ioctl. +Index: kbd-1.14.1/src/chvt.c +=================================================================== +--- kbd-1.14.1.orig/src/chvt.c ++++ kbd-1.14.1/src/chvt.c +@@ -7,13 +7,43 @@ + #include + #include + #include ++#include ++#include + #include "getfd.h" + #include "nls.h" + #include "version.h" + ++#define USER_WAIT_SLEEP_US 100000 ++#define USER_WAIT_MAX_ITERATIONS 50 ++ ++static int fd; ++ ++static void chvt(int num) ++{ ++ if (ioctl(fd,VT_ACTIVATE,num)) { ++ perror("VT_ACTIVATE"); ++ exit(1); ++ } ++} ++ ++static int fgconsole(void) ++{ ++ struct vt_stat vtstat; ++ if (ioctl(fd, VT_GETSTATE, &vtstat)) { ++ perror("VT_GETSTATE"); ++ exit(1); ++ } ++ return vtstat.v_active; ++} ++ + int + main(int argc, char *argv[]) { +- int fd, num; ++ int c, num; ++ int user_wait = 0; ++ const struct option long_opts[] = { ++ { "version", no_argument, NULL, 'V' }, ++ { "userwait", no_argument, NULL, 'u' }, ++ }; + + set_progname(argv[0]); + +@@ -21,22 +51,46 @@ main(int argc, char *argv[]) { + bindtextdomain(PACKAGE_NAME, LOCALEDIR); + textdomain(PACKAGE_NAME); + +- if (argc == 2 && !strcmp(argv[1], "-V")) +- print_version_and_exit(); ++ while ((c = getopt_long(argc, argv, "Vu", long_opts, NULL)) != -1) { ++ switch (c) { ++ case 'V': ++ print_version_and_exit(); ++ case 'u': ++ user_wait = 1; ++ break; ++ } ++ } + +- if (argc != 2) { +- fprintf(stderr, _("usage: chvt N\n")); ++ if (optind >= argc) { ++ fprintf(stderr, _("usage: chvt [--userwait] N\n")); + exit(1); + } ++ + fd = getfd(NULL); +- num = atoi(argv[1]); +- if (ioctl(fd,VT_ACTIVATE,num)) { +- perror("chvt: VT_ACTIVATE"); +- exit(1); +- } +- if (ioctl(fd,VT_WAITACTIVE,num)) { +- perror("VT_WAITACTIVE"); +- exit(1); ++ num = atoi(argv[optind++]); ++ chvt(num); ++ ++ if (user_wait) { ++ int active = 0; ++ int i; ++ for (i = 0; i < USER_WAIT_MAX_ITERATIONS; i++) { ++ if (fgconsole() == num) { ++ active = 1; ++ break; ++ } ++ ++ chvt(num); ++ usleep(USER_WAIT_SLEEP_US); ++ } ++ if (!active) { ++ fprintf(stderr, _("VT change timed out\n")); ++ exit(1); ++ } ++ } else { ++ if (ioctl(fd,VT_WAITACTIVE,num)) { ++ perror("VT_WAITACTIVE"); ++ exit(1); ++ } + } + exit(0); + } diff --git a/kbd.changes b/kbd.changes index 18ff279..acc9bb0 100644 --- a/kbd.changes +++ b/kbd.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Feb 16 11:14:18 PST 2010 - vuntz@opensuse.org + +- Add kbd-1.12-chvt-userwait.patch, taken from Gentoo to add a + --userwait option to chvt. This can be used to avoid situation + where chvt can hang forever waiting for the vt switch: the wait + is done in userspace, and has a timeout of 5 seconds. (bnc#575123) + ------------------------------------------------------------------- Thu Feb 4 12:22:49 UTC 2010 - jengelh@medozas.de diff --git a/kbd.spec b/kbd.spec index 7d6077d..74c618f 100644 --- a/kbd.spec +++ b/kbd.spec @@ -24,7 +24,7 @@ License: GPLv2+ Group: System/Console AutoReqProv: on Version: 1.14.1 -Release: 22 +Release: 23 Summary: Keyboard and Font Utilities Source: kbd-%{version}.tar.bz2 Source1: kbd_fonts.tar.bz2 @@ -53,6 +53,7 @@ Patch9: kbd-1.14.1-setfont-no-cruft.patch Patch10: kbd-1.14.1-dumpkeys-C-opt.patch Patch11: kbd-1.14.1-defkeymap.patch Patch12: kbd-remove-kbio.diff +Patch13: kbd-1.12-chvt-userwait.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %fillup_prereq %insserv_prereq BuildRequires: bison flex @@ -89,6 +90,7 @@ Authors: %patch10 %patch11 -p1 %patch -P 12 -p1 +%patch13 -p1 %build for i in `find data/keymaps/mac -type f` ; do From 55f292fb01da3510fc3c4338bae2f5c4204ac65cf796f85df198d1fce520d564 Mon Sep 17 00:00:00 2001 From: Anna Maresova Date: Fri, 19 Feb 2010 14:16:01 +0000 Subject: [PATCH 2/6] - respect KBD_TTY="" set in sysconfig (bnc#405658) OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=13 --- kbd.changes | 5 +++++ kbd.init | 13 ++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kbd.changes b/kbd.changes index acc9bb0..94bd737 100644 --- a/kbd.changes +++ b/kbd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Feb 19 14:39:29 CET 2010 - anicka@suse.cz + +- respect KBD_TTY="" set in sysconfig (bnc#405658) + ------------------------------------------------------------------- Tue Feb 16 11:14:18 PST 2010 - vuntz@opensuse.org diff --git a/kbd.init b/kbd.init index e762ebf..c72d652 100644 --- a/kbd.init +++ b/kbd.init @@ -80,23 +80,18 @@ fi # # Calculate KBD_TTY array only once -# Caution: Keep in sync with earlykbd.init # -# >=tty7 left out intentionaly (Bug #302010) -KBD_TTY_DEFAULT="tty1 tty2 tty3 tty4 tty5 tty6" +KBD_TTY_DEFAULT="${KBD_TTY:-tty1 tty2 tty3 tty4 tty5 tty6}" newkbd="" for tty in $KBD_TTY_DEFAULT; do + # >=tty7 left out intentionaly (Bug #302010) + test ${tty#tty} -ge 7 2>/dev/null && continue test -w /dev/$tty || continue test -c /dev/$tty || continue > /dev/$tty &> /dev/null || continue - # consider settings in /etc/sysconfig/keyboard:KBD_TTY - test -z "$KBD_TTY" && continue - case ":${KBD_TTY// /:}:" in - *:$tty:*) - newkbd="${newkbd:+$newkbd }/dev/$tty" - esac + newkbd="${newkbd:+$newkbd }/dev/$tty" done KBD_TTY="$newkbd" unset newkbd From 1d66b995accfa2bdc7e6b87bb23fd74afb6c383c8f2bad1e377b036f83e14a88 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Wed, 24 Feb 2010 01:10:47 +0000 Subject: [PATCH 3/6] Accepting request 32965 from Base:System checked in (request 32965) OBS-URL: https://build.opensuse.org/request/show/32965 OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=14 --- kbd.changes | 5 ----- kbd.init | 13 +++++++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kbd.changes b/kbd.changes index 94bd737..acc9bb0 100644 --- a/kbd.changes +++ b/kbd.changes @@ -1,8 +1,3 @@ -------------------------------------------------------------------- -Fri Feb 19 14:39:29 CET 2010 - anicka@suse.cz - -- respect KBD_TTY="" set in sysconfig (bnc#405658) - ------------------------------------------------------------------- Tue Feb 16 11:14:18 PST 2010 - vuntz@opensuse.org diff --git a/kbd.init b/kbd.init index c72d652..e762ebf 100644 --- a/kbd.init +++ b/kbd.init @@ -80,18 +80,23 @@ fi # # Calculate KBD_TTY array only once +# Caution: Keep in sync with earlykbd.init # -KBD_TTY_DEFAULT="${KBD_TTY:-tty1 tty2 tty3 tty4 tty5 tty6}" +# >=tty7 left out intentionaly (Bug #302010) +KBD_TTY_DEFAULT="tty1 tty2 tty3 tty4 tty5 tty6" newkbd="" for tty in $KBD_TTY_DEFAULT; do - # >=tty7 left out intentionaly (Bug #302010) - test ${tty#tty} -ge 7 2>/dev/null && continue test -w /dev/$tty || continue test -c /dev/$tty || continue > /dev/$tty &> /dev/null || continue - newkbd="${newkbd:+$newkbd }/dev/$tty" + # consider settings in /etc/sysconfig/keyboard:KBD_TTY + test -z "$KBD_TTY" && continue + case ":${KBD_TTY// /:}:" in + *:$tty:*) + newkbd="${newkbd:+$newkbd }/dev/$tty" + esac done KBD_TTY="$newkbd" unset newkbd From 350bb890f5dfd5c52b58afba188ca3e3759412e388e2e021facaa4fea5efcc40 Mon Sep 17 00:00:00 2001 From: Anna Maresova Date: Mon, 29 Mar 2010 15:32:00 +0000 Subject: [PATCH 4/6] - add lt.std map (bnc#569554) OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=15 --- kbd.changes | 10 ++++++++++ kbd.init | 13 ++++--------- kbd.spec | 2 +- suse-add.tar.bz2 | 4 ++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/kbd.changes b/kbd.changes index acc9bb0..ff425b6 100644 --- a/kbd.changes +++ b/kbd.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Mar 29 17:31:11 CEST 2010 - anicka@suse.cz + +- add lt.std map (bnc#569554) + +------------------------------------------------------------------- +Fri Feb 19 14:39:29 CET 2010 - anicka@suse.cz + +- respect KBD_TTY="" set in sysconfig (bnc#405658) + ------------------------------------------------------------------- Tue Feb 16 11:14:18 PST 2010 - vuntz@opensuse.org diff --git a/kbd.init b/kbd.init index e762ebf..c72d652 100644 --- a/kbd.init +++ b/kbd.init @@ -80,23 +80,18 @@ fi # # Calculate KBD_TTY array only once -# Caution: Keep in sync with earlykbd.init # -# >=tty7 left out intentionaly (Bug #302010) -KBD_TTY_DEFAULT="tty1 tty2 tty3 tty4 tty5 tty6" +KBD_TTY_DEFAULT="${KBD_TTY:-tty1 tty2 tty3 tty4 tty5 tty6}" newkbd="" for tty in $KBD_TTY_DEFAULT; do + # >=tty7 left out intentionaly (Bug #302010) + test ${tty#tty} -ge 7 2>/dev/null && continue test -w /dev/$tty || continue test -c /dev/$tty || continue > /dev/$tty &> /dev/null || continue - # consider settings in /etc/sysconfig/keyboard:KBD_TTY - test -z "$KBD_TTY" && continue - case ":${KBD_TTY// /:}:" in - *:$tty:*) - newkbd="${newkbd:+$newkbd }/dev/$tty" - esac + newkbd="${newkbd:+$newkbd }/dev/$tty" done KBD_TTY="$newkbd" unset newkbd diff --git a/kbd.spec b/kbd.spec index 74c618f..fbfcbd5 100644 --- a/kbd.spec +++ b/kbd.spec @@ -24,7 +24,7 @@ License: GPLv2+ Group: System/Console AutoReqProv: on Version: 1.14.1 -Release: 23 +Release: 24 Summary: Keyboard and Font Utilities Source: kbd-%{version}.tar.bz2 Source1: kbd_fonts.tar.bz2 diff --git a/suse-add.tar.bz2 b/suse-add.tar.bz2 index 1360c10..04db640 100644 --- a/suse-add.tar.bz2 +++ b/suse-add.tar.bz2 @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0a34e4267d8fb7bbf8f8e6de396ecd5c65ea565d6388b558d9e353a2c601b661 -size 40327 +oid sha256:fec4adb38cb96561e0f431bb7ea6710118553a4ac674218b2dd1035f6d7c7bf2 +size 41756 From 0baeb51c578cb7d0e76d358c33702bd573ef185d7ec846fb322f7fcd98f7777c Mon Sep 17 00:00:00 2001 From: OBS User buildservice-autocommit Date: Wed, 31 Mar 2010 13:04:18 +0000 Subject: [PATCH 5/6] Updating link to change in openSUSE:Factory/kbd revision 37.0 OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=f3df724c044a7efcd98512ca13823be6 --- kbd.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kbd.spec b/kbd.spec index fbfcbd5..93fd53c 100644 --- a/kbd.spec +++ b/kbd.spec @@ -24,7 +24,7 @@ License: GPLv2+ Group: System/Console AutoReqProv: on Version: 1.14.1 -Release: 24 +Release: 25 Summary: Keyboard and Font Utilities Source: kbd-%{version}.tar.bz2 Source1: kbd_fonts.tar.bz2 From 2b522c2c3610667f9bf26e7a2c1fc124546ace2414ed93f7a0a59f0653e429e8 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Wed, 31 Mar 2010 13:04:18 +0000 Subject: [PATCH 6/6] Accepting request 36003 from Base:System checked in (request 36003) OBS-URL: https://build.opensuse.org/request/show/36003 OBS-URL: https://build.opensuse.org/package/show/Base:System/kbd?expand=0&rev=16 --- ready | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ready diff --git a/ready b/ready deleted file mode 100644 index 473a0f4..0000000