OBS User unknown 2007-08-23 23:14:59 +00:00 committed by Git OBS Bridge
parent 8a51752471
commit 8117c12a58
5 changed files with 211 additions and 156 deletions

View File

@ -52,157 +52,3 @@
if (i) { if (i) {
fprintf(stderr, "%s: putfont: %d,%dx%d: failed: %d\n", progname, count, width, height, i); fprintf(stderr, "%s: putfont: %d,%dx%d: failed: %d\n", progname, count, width, height, i);
perror("putfont: PIO_FONT"); perror("putfont: PIO_FONT");
--- kbd-1.12/man/man1/loadkeys.1.in.orig 2005-03-04 19:10:30.000000000 +0000
+++ kbd-1.12/man/man1/loadkeys.1.in 2005-03-04 19:11:13.000000000 +0000
@@ -7,6 +7,10 @@
[
.I -c --clearcompose
] [
+.I -C '<cons1 cons2 ...>'
+|
+.I --console=cons1,cons2,...
+] [
.I -d --default
] [
.I -h --help
@@ -28,6 +32,11 @@
reads the file or files specified by
.IR filename... .
Its main purpose is to load the kernel keymap for the console.
+The affected console device or devices can be specified using the
+.I -C
+(or
+.I --console
+) option. This option supports a list of device names
.SH "RESET TO DEFAULT"
If the
.I -d
--- kbd-1.12/src/loadkeys.y.orig 2005-03-08 17:55:08.000000000 +0000
+++ kbd-1.12/src/loadkeys.y 2005-03-08 17:10:06.000000000 +0000
@@ -62,7 +62,7 @@
static void compose(int diacr, int base, int res);
static void do_constant(void);
static void do_constant_key (int, u_short);
-static void loadkeys(void);
+static void loadkeys(char *console, int *warned);
static void mktable(void);
static void strings_as_usual(void);
static void keypad_as_usual(char *keyboard);
@@ -250,6 +250,8 @@
"valid options are:\n"
"\n"
" -c --clearcompose clear kernel compose table\n"
+" -C <cons1,cons2,...>\n"
+" --console=<...> Indicate console device(s) to be used.\n"
" -d --default load \"" DEFMAP "\"\n"
" -h --help display this help text\n"
" -m --mktable output a \"defkeymap.c\" to stdout\n"
@@ -269,9 +271,10 @@
int
main(unsigned int argc, char *argv[]) {
- const char *short_opts = "cdhmsuqvV";
+ const char *short_opts = "cC:dhmsuqvV";
const struct option long_opts[] = {
{ "clearcompose", no_argument, NULL, 'c' },
+ { "console", 1, NULL, 'C' },
{ "default", no_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ "mktable", no_argument, NULL, 'm' },
@@ -283,6 +286,8 @@
{ NULL, 0, NULL, 0 }
};
int c;
+ char *console = NULL;
+ int warned = 0;
set_progname(argv[0]);
@@ -292,6 +297,9 @@
case 'c':
nocompose = 1;
break;
+ case 'C':
+ console = optarg;
+ break;
case 'd':
optd = 1;
break;
@@ -330,8 +338,26 @@
do_constant();
if(optm)
mktable();
+ else if (console)
+ {
+ char *buf = strdup(console); /* make writable */
+ char *e, *s = buf;
+ while (*s)
+ {
+ while ( *s == ' ' || *s == '\t' || *s == ',') s++;
+ e = s;
+ while (*e && *e != ' ' && *e != '\t' && *e != ',') e++;
+ char c = *e;
+ *e = '\0';
+ if (verbose) printf("%s\n", s);
+ loadkeys(s, &warned);
+ *e = c;
+ s = e;
+ }
+ free(buf);
+ }
else
- loadkeys();
+ loadkeys(NULL, &warned);
exit(0);
}
@@ -760,7 +786,7 @@
}
static int
-defkeys(int fd) {
+defkeys(int fd, char *cons, int *warned) {
struct kbentry ke;
int ct = 0;
int i,j,fail;
@@ -845,9 +871,21 @@
fprintf(stderr, _("%s: failed to restore keyboard mode\n"),
progname);
}
- fprintf(stderr, _("%s: warning: this map uses Unicode symbols\n"
- " (perhaps you want to do `kbd_mode -u'?)\n"),
- progname);
+
+ if (!warned++)
+ {
+ int kd_mode = -1;
+ if (ioctl(fd, KDGETMODE, &kd_mode) || (kd_mode != KD_GRAPHICS))
+ {
+ /*
+ * It is okay for the graphics console to have a non-unicode mode.
+ * only talk about other consoles
+ */
+ fprintf(stderr, _("%s: warning: this map uses Unicode symbols, %s mode=%d\n"
+ " (perhaps you want to do `kbd_mode -u'?)\n"),
+ progname, cons ? cons : "NULL", kd_mode);
+ }
+ }
}
return ct;
}
@@ -981,12 +1019,12 @@
}
static void
-loadkeys (void) {
+loadkeys (char *console, int *warned) {
int fd;
int keyct, funcct, diacct;
- fd = getfd(NULL);
- keyct = defkeys(fd);
+ fd = getfd(console);
+ keyct = defkeys(fd, console, &warned);
funcct = deffuncs(fd);
if (accent_table_size > 0 || nocompose)
diacct = defdiacs(fd);

View File

@ -0,0 +1,154 @@
--- kbd-1.12/man/man1/loadkeys.1.in.orig 2005-03-04 19:10:30.000000000 +0000
+++ kbd-1.12/man/man1/loadkeys.1.in 2005-03-04 19:11:13.000000000 +0000
@@ -7,6 +7,10 @@
[
.I -c --clearcompose
] [
+.I -C '<cons1 cons2 ...>'
+|
+.I --console=cons1,cons2,...
+] [
.I -d --default
] [
.I -h --help
@@ -28,6 +32,11 @@
reads the file or files specified by
.IR filename... .
Its main purpose is to load the kernel keymap for the console.
+The affected console device or devices can be specified using the
+.I -C
+(or
+.I --console
+) option. This option supports a list of device names
.SH "RESET TO DEFAULT"
If the
.I -d
--- kbd-1.12/src/loadkeys.y.orig 2005-03-08 17:55:08.000000000 +0000
+++ kbd-1.12/src/loadkeys.y 2005-03-08 17:10:06.000000000 +0000
@@ -62,7 +62,7 @@
static void compose(int diacr, int base, int res);
static void do_constant(void);
static void do_constant_key (int, u_short);
-static void loadkeys(void);
+static void loadkeys(char *console, int *warned);
static void mktable(void);
static void strings_as_usual(void);
static void keypad_as_usual(char *keyboard);
@@ -250,6 +250,8 @@
"valid options are:\n"
"\n"
" -c --clearcompose clear kernel compose table\n"
+" -C <cons1,cons2,...>\n"
+" --console=<...> Indicate console device(s) to be used.\n"
" -d --default load \"" DEFMAP "\"\n"
" -h --help display this help text\n"
" -m --mktable output a \"defkeymap.c\" to stdout\n"
@@ -269,9 +271,10 @@
int
main(unsigned int argc, char *argv[]) {
- const char *short_opts = "cdhmsuqvV";
+ const char *short_opts = "cC:dhmsuqvV";
const struct option long_opts[] = {
{ "clearcompose", no_argument, NULL, 'c' },
+ { "console", 1, NULL, 'C' },
{ "default", no_argument, NULL, 'd' },
{ "help", no_argument, NULL, 'h' },
{ "mktable", no_argument, NULL, 'm' },
@@ -283,6 +286,8 @@
{ NULL, 0, NULL, 0 }
};
int c;
+ char *console = NULL;
+ int warned = 0;
set_progname(argv[0]);
@@ -292,6 +297,9 @@
case 'c':
nocompose = 1;
break;
+ case 'C':
+ console = optarg;
+ break;
case 'd':
optd = 1;
break;
@@ -330,8 +338,26 @@
do_constant();
if(optm)
mktable();
+ else if (console)
+ {
+ char *buf = strdup(console); /* make writable */
+ char *e, *s = buf;
+ while (*s)
+ {
+ while ( *s == ' ' || *s == '\t' || *s == ',') s++;
+ e = s;
+ while (*e && *e != ' ' && *e != '\t' && *e != ',') e++;
+ char c = *e;
+ *e = '\0';
+ if (verbose) printf("%s\n", s);
+ loadkeys(s, &warned);
+ *e = c;
+ s = e;
+ }
+ free(buf);
+ }
else
- loadkeys();
+ loadkeys(NULL, &warned);
exit(0);
}
@@ -760,7 +786,7 @@
}
static int
-defkeys(int fd) {
+defkeys(int fd, char *cons, int *warned) {
struct kbentry ke;
int ct = 0;
int i,j,fail;
@@ -845,9 +871,21 @@
fprintf(stderr, _("%s: failed to restore keyboard mode\n"),
progname);
}
- fprintf(stderr, _("%s: warning: this map uses Unicode symbols\n"
- " (perhaps you want to do `kbd_mode -u'?)\n"),
- progname);
+
+ if (!warned++)
+ {
+ int kd_mode = -1;
+ if (ioctl(fd, KDGETMODE, &kd_mode) || (kd_mode != KD_GRAPHICS))
+ {
+ /*
+ * It is okay for the graphics console to have a non-unicode mode.
+ * only talk about other consoles
+ */
+ fprintf(stderr, _("%s: warning: this map uses Unicode symbols, %s mode=%d\n"
+ " (perhaps you want to do `kbd_mode -u'?)\n"),
+ progname, cons ? cons : "NULL", kd_mode);
+ }
+ }
}
return ct;
}
@@ -981,12 +1019,12 @@
}
static void
-loadkeys (void) {
+loadkeys (char *console, int *warned) {
int fd;
int keyct, funcct, diacct;
- fd = getfd(NULL);
- keyct = defkeys(fd);
+ fd = getfd(console);
+ keyct = defkeys(fd, console, &warned);
funcct = deffuncs(fd);
if (accent_table_size > 0 || nocompose)
diacct = defdiacs(fd);

View File

@ -0,0 +1,44 @@
--- kbd-1.12/src/kdfontop.c.orig 2007-08-21 19:28:47.000000000 +0200
+++ kbd-1.12/src/kdfontop.c 2007-08-21 19:32:50.000000000 +0200
@@ -268,26 +268,19 @@
return 0;
}
- /* Second attempt: PIO_FONTX */
- cfd.charcount = count;
- cfd.charheight = height;
- cfd.chardata = buf;
- i = ioctl(fd, PIO_FONTX, &cfd);
- if (i == 0)
- return 0;
- if (errno != ENOSYS && errno != EINVAL) {
- fprintf(stderr, "%s: putfont: %d,%dx%d:failed: %d\n", progname, count, width, height, i);
- perror("putfont: PIO_FONTX");
- return -1;
- }
-
- /* Third attempt: PIO_FONT */
- /* This will load precisely 256 chars, independent of count */
- i = ioctl(fd, PIO_FONT, buf);
- if (i) {
- fprintf(stderr, "%s: putfont: %d,%dx%d: failed: %d\n", progname, count, width, height, i);
- perror("putfont: PIO_FONT");
- return -1;
- }
- return 0;
+ // We no longer try PIO_FONT* calls.
+ // A former patch even added a possible 5 seconds delay loop here, in an attempt to
+ // gain victory over kdm. We no do this fight, as it can only result in races.
+ // https://bugzilla.novell.com/show_bug.cgi?id=302010
+ //
+ // Two effects:
+ // a) Without the delay loop, we are fast enough to run early.
+ // Moving setfont calls to an earlier point most likly
+ // avoids the race.
+ // b) Without the old compat calls, it should be easier to
+ // fix this in kernel side.
+ //
+ fprintf(stderr, "%s: putfont: %d,%dx%d: failed: %d\n", progname, count, width, height, i);
+ perror("putfont: KDFONTOP");
+ return -1;
}

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue Aug 21 19:53:59 CEST 2007 - jw@suse.de
- cleaned up setfont according to bugzilla #302010
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Aug 16 12:56:42 CEST 2007 - jw@suse.de Thu Aug 16 12:56:42 CEST 2007 - jw@suse.de

View File

@ -16,7 +16,7 @@ License: GPL v2 or later
Group: System/Console Group: System/Console
Autoreqprov: on Autoreqprov: on
Version: 1.12 Version: 1.12
Release: 129 Release: 132
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
@ -47,7 +47,7 @@ Patch14: kbd-%{version}-cz-us-qwertz.diff
Patch15: kbd-%{version}-nounicode-nontty.diff Patch15: kbd-%{version}-nounicode-nontty.diff
Patch16: kbd-%{version}-kbd_mode.diff Patch16: kbd-%{version}-kbd_mode.diff
Patch17: piofont_debug.diff Patch17: piofont_debug.diff
Patch18: kbd-%{version}-be-nice-to-kdm.diff Patch18: kbd-%{version}-loadkeys-C-opt.diff
Patch19: kbd-%{version}-happy-abuild.diff Patch19: kbd-%{version}-happy-abuild.diff
Patch20: kbd-%{version}-strip.diff Patch20: kbd-%{version}-strip.diff
Patch21: kbd-%{version}-setfont-fpclose.diff Patch21: kbd-%{version}-setfont-fpclose.diff
@ -55,6 +55,8 @@ Patch22: kbd-%{version}-showconsolefont-info.diff
Patch23: kbd-%{version}-docu-X11R6-xorg.diff Patch23: kbd-%{version}-docu-X11R6-xorg.diff
Patch24: kbd-%{version}-el-locale-update.diff Patch24: kbd-%{version}-el-locale-update.diff
Patch25: sv-latin1-keycode10.diff Patch25: sv-latin1-keycode10.diff
Patch26: kbd-%{version}-setfont-no-cruft.diff
Patch27: kbd-%{version}-be-nice-to-kdm.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
@ -106,6 +108,8 @@ Authors:
%patch23 -p1 %patch23 -p1
%patch24 %patch24
%patch25 -p1 %patch25 -p1
%patch26 -p1
# %patch27 -p1 # obsoleted. #302010
%build %build
for i in `find data/keymaps/mac -type f` ; do for i in `find data/keymaps/mac -type f` ; do
@ -318,6 +322,8 @@ rm -rf $RPM_BUILD_ROOT
#rm -rf $RPM_BUILD_DIR/kbd-%{version} #rm -rf $RPM_BUILD_DIR/kbd-%{version}
%changelog %changelog
* Tue Aug 21 2007 - jw@suse.de
- cleaned up setfont according to bugzilla #302010
* Thu Aug 16 2007 - jw@suse.de * Thu Aug 16 2007 - jw@suse.de
- fixed fix of bugzilla #300076 - fixed fix of bugzilla #300076
(fillup_and_insserv is too ugly) (fillup_and_insserv is too ugly)