SHA256
1
0
forked from pool/kbd
OBS User unknown 2008-06-05 15:31:52 +00:00 committed by Git OBS Bridge
parent 58b9f33336
commit 99dce23e2a
4 changed files with 118 additions and 14 deletions

View File

@ -0,0 +1,78 @@
--- man/man1/dumpkeys.1.in
+++ man/man1/dumpkeys.1.in 2008-06-04 18:26:00.885947236 +0200
@@ -4,6 +4,7 @@
dumpkeys \- dump keyboard translation tables
.SH SYNOPSIS
.B dumpkeys
+.RI [ \-C\ '<vc>' | \-\-console='<vc>' ]
[
.B \-hilfn
.BI \-c charset
@@ -197,6 +198,12 @@ This option produces an output line `cha
loadkeys how to interpret the keymap. (For example, "division" is
0xf7 in iso-8859-1 but 0xba in iso-8859-8.)
.LP
+The affected console device can be specified using the
+.I -C
+(or
+.I --console
+) option. This option supports exactly one device name.
+.LP
.SH FILES
.PD 0
.TP 20
--- src/dumpkeys.c
+++ src/dumpkeys.c 2008-06-04 18:20:51.762445784 +0200
@@ -31,6 +31,7 @@
static int fd;
static int verbose;
static int nr_keys = 0; /* probably 112, 128, 256 or 512 */
+static char * console;
int keymap_index[MAX_NR_KEYMAPS]; /* inverse of good_keymap */
int good_keymap[MAX_NR_KEYMAPS], keymapnr, allocct;
@@ -560,6 +561,8 @@ valid options are:\n\
--funcs-only display only the function key strings\n\
--keys-only display only key bindings\n\
--compose-only display only compose key combinations\n\
+ -C <vc>\n\
+ --console=<vc> Indicate the virtual console device to be used.\n\
-c --charset="));
list_charsets(stderr);
fprintf(stderr, _("\
@@ -571,7 +574,7 @@ valid options are:\n\
int
main (int argc, char *argv[]) {
- const char *short_opts = "hilvsnf1S:c:V";
+ const char *short_opts = "hilvsnf1S:c:C:V";
const struct option long_opts[] = {
{ "help", no_argument, NULL, 'h' },
{ "short-info", no_argument, NULL, 'i' },
@@ -584,6 +587,7 @@ main (int argc, char *argv[]) {
{ "keys-only", no_argument, NULL, 'k' },
{ "compose-only",no_argument, NULL, 'd' },
{ "charset", required_argument, NULL, 'c' },
+ { "console", required_argument, NULL, 'C' },
{ "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
@@ -642,6 +646,9 @@ main (int argc, char *argv[]) {
usage();
printf("charset \"%s\"\n", optarg);
break;
+ case 'C':
+ console = optarg;
+ break;
case 'V':
print_version_and_exit();
case 'h':
@@ -653,7 +660,7 @@ main (int argc, char *argv[]) {
if (optind < argc)
usage();
- fd = getfd(NULL);
+ fd = getfd(console);
find_nr_keys();

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 4 18:53:46 CEST 2008 - werner@suse.de
- Add "-C" option also to dumpkeys to make kbd init script work on
/dev/console and /dev/tty even within e.g. xterm (bnc#337238)
------------------------------------------------------------------- -------------------------------------------------------------------
Mon May 19 12:39:16 CEST 2008 - jw@suse.de Mon May 19 12:39:16 CEST 2008 - jw@suse.de

View File

@ -95,10 +95,11 @@ for tty in $KBD_TTY_DEFAULT; do
test -c /dev/$tty || continue test -c /dev/$tty || continue
> /dev/$tty &> /dev/null || continue > /dev/$tty &> /dev/null || continue
# consider settings in /etc/sysconfig/keyboard:KBD_TTY # consider settings in /etc/sysconfig/keyboard:KBD_TTY
if test -n "$KBD_TTY"; then test -z "$KBD_TTY" && continue
echo "$KBD_TTY" | grep -q $tty || continue case ":${KBD_TTY// /:}:" in
fi *:$tty:*)
newkbd="${newkbd:+$newkbd }/dev/$tty" newkbd="${newkbd:+$newkbd }/dev/$tty"
esac
done done
KBD_TTY="$newkbd" KBD_TTY="$newkbd"
unset newkbd unset newkbd
@ -161,9 +162,16 @@ function set_kbdrate ()
if test -n "$KBD_DELAY"; then if test -n "$KBD_DELAY"; then
KBDOPT="${KBDOPT:+$KBDOPT }-d $KBD_DELAY" KBDOPT="${KBDOPT:+$KBDOPT }-d $KBD_DELAY"
fi fi
if test -n "$KBDOPT" ; then if test -n "$KBDOPT" -a -x /bin/kbdrate ; then
echo -n "Keyboard: " echo -n "Keyboard: "
/bin/kbdrate $KBDOPT for tty in $KBD_TTY; do
/bin/kbdrate $KBDOPT < $tty 2> /dev/null
rc_status
case "$KBDOPT" in
*-s*) continue ;;
esac
KBDOPT="${KBDOPT:+$KBDOPT }-s"
done
rc_status -v1 rc_status -v1
fi fi
fi fi
@ -446,32 +454,39 @@ case "$1" in
case "$RUNLEVEL" in case "$RUNLEVEL" in
S|N|1|\#) true ;; S|N|1|\#) true ;;
*) *)
trap "rm -f /dev/shm/defkeymap.map" EXIT SIGTERM
if test -n "$KBD_TTY" ; then
dumpkeys -C ${KBD_TTY%% *}
else
dumpkeys
fi > /dev/shm/defkeymap.map
case $LOCALE_CHARMAP in case $LOCALE_CHARMAP in
UTF-8) UTF-8)
# Change the keyboard mapping in such a way that the # Change the keyboard mapping in such a way that the
# non-ASCII keys produce UTF-8 encoded multibyte sequences # non-ASCII keys produce UTF-8 encoded multibyte sequences
# instead of single bytes >= 0x80 in a legacy 8-bit encoding. # instead of single bytes >= 0x80 in a legacy 8-bit encoding.
( dumpkeys | loadkeys -C "$KBD_TTY" --unicode ) > /dev/null 2>&1 loadkeys -C "$KBD_TTY" --unicode /dev/shm/defkeymap.map > /dev/null 2>&1
;; ;;
*) *)
;; ;;
esac esac
dumpkeys=yes
if type -p cmp > /dev/null 2>&1 && \ if type -p cmp > /dev/null 2>&1 && cmp -s /etc/defkeymap.map /dev/shm/defkeymap.map
dumpkeys | cmp -s /etc/defkeymap.map
then then
dumpkeys=no rm -f /dev/shm/defkeymap.map
fi fi
if test "$dumpkeys" = "yes" ; then if test -s /dev/shm/defkeymap.map ; then
# FIXME: this should be done much earlier # FIXME: this should be done much earlier
# to avoid bugzilla# 259694 or similar. # to avoid bugzilla# 259694 or similar.
( dumpkeys > /etc/defkeymap.map ) > /dev/null 2>&1 mv /dev/shm/defkeymap.map /etc/defkeymap.map
if test ! -z "$KEYMAP" && test "$KEYMAP" != "/etc/defkeymap.map" ; then if test ! -z "$KEYMAP" && test "$KEYMAP" != "/etc/defkeymap.map" ; then
test ! -e "$KEYMAP" && KEYMAP=$K test ! -e "$KEYMAP" && KEYMAP=$K
echo $KEYMAP > /etc/defkeymap.name echo $KEYMAP > /etc/defkeymap.name
fi fi
fi fi
trap - EXIT SIGTERM
esac esac
;; ;;

View File

@ -17,7 +17,7 @@ License: GPL v2 or later
Group: System/Console Group: System/Console
AutoReqProv: on AutoReqProv: on
Version: 1.12 Version: 1.12
Release: 182 Release: 186
Summary: Keyboard and Font Utilities Summary: Keyboard and Font Utilities
Source: ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/kbd/%{name}-%{version}.tar.bz2 Source: ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/kbd/%{name}-%{version}.tar.bz2
Source1: kbd_fonts.tar.bz2 Source1: kbd_fonts.tar.bz2
@ -61,6 +61,7 @@ Patch25: sv-latin1-keycode10.diff
Patch26: kbd-%{version}-setfont-no-cruft.diff Patch26: kbd-%{version}-setfont-no-cruft.diff
Patch27: kbd-%{version}-be-nice-to-kdm.diff Patch27: kbd-%{version}-be-nice-to-kdm.diff
Patch28: bnc147581_jp106.diff Patch28: bnc147581_jp106.diff
Patch29: kbd-%{version}-dumpkeys-C-opt.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %fillup_prereq %insserv_prereq PreReq: %fillup_prereq %insserv_prereq
BuildRequires: bison flex BuildRequires: bison flex
@ -117,6 +118,7 @@ Authors:
%patch26 -p1 %patch26 -p1
# %patch27 -p1 # obsoleted. #302010 # %patch27 -p1 # obsoleted. #302010
%patch28 -p1 %patch28 -p1
%patch29 -p0
%build %build
for i in `find data/keymaps/mac -type f` ; do for i in `find data/keymaps/mac -type f` ; do
@ -334,6 +336,9 @@ rm -rf $RPM_BUILD_ROOT
#rm -rf $RPM_BUILD_DIR/kbd-%{version} #rm -rf $RPM_BUILD_DIR/kbd-%{version}
%changelog %changelog
* Wed Jun 04 2008 werner@suse.de
- Add "-C" option also to dumpkeys to make kbd init script work on
/dev/console and /dev/tty even within e.g. xterm (bnc#337238)
* Mon May 19 2008 jw@suse.de * Mon May 19 2008 jw@suse.de
- added ru1_win-utf.map fixing bnc#337238 - added ru1_win-utf.map fixing bnc#337238
* Wed May 07 2008 werner@suse.de * Wed May 07 2008 werner@suse.de