Compare commits

...

No commits in common. "c8" and "c9s" have entirely different histories.
c8 ... c9s

23 changed files with 413 additions and 224 deletions

15
.gitignore vendored
View File

@ -1,3 +1,12 @@
SOURCES/kbd-2.0.4.tar.xz
SOURCES/kbd-latarcyrheb-32.tar.bz2
SOURCES/kbd-latsun-fonts.tar.bz2
kbd-latsun-fonts.tar.bz2
sun12x22-fixed.psfu
kbd-sun12x22-fixed.tar.bz2
ro.map
ro.tar.bz2
kbd-latarcyrheb-16-fixed.tar.bz2
ro_maps.tar.bz2
terminus.tar.bz2
/fr-dvorak.tar.bz2
/kbd-latarcyrheb-32.tar.bz2
/kbdinfo.1
/kbd-2.4.0.tar.xz

View File

@ -1,3 +1,4 @@
cf5d45c62d6af70b8b1f210d89193b52f5efb05d SOURCES/kbd-2.0.4.tar.xz
17db7aaba451796278758e7c6e443b4659af17b9 SOURCES/kbd-latarcyrheb-32.tar.bz2
a5f6d9dff7a8a484cd5014ec7ffdf1eaed27084a SOURCES/kbd-latsun-fonts.tar.bz2
a5f6d9dff7a8a484cd5014ec7ffdf1eaed27084a kbd-latsun-fonts.tar.bz2
17db7aaba451796278758e7c6e443b4659af17b9 kbd-latarcyrheb-32.tar.bz2
8bc79b539e7970560ff69e6c2014b3228fc16e2b kbdinfo.1
724c030926d125b5e430274e92c4236d8534d410 kbd-2.4.0.tar.xz

View File

@ -1,24 +0,0 @@
diff -up kbd-2.0.4/src/loadkeys.c.orig kbd-2.0.4/src/loadkeys.c
--- kbd-2.0.4/src/loadkeys.c.orig 2017-01-11 11:14:48.308093019 +0100
+++ kbd-2.0.4/src/loadkeys.c 2017-01-11 11:15:18.018106020 +0100
@@ -27,7 +27,7 @@
#include "keymap.h"
static const char *progname = NULL;
-static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", KERNDIR "/", 0 };
+static const char *const dirpath1[] = { "", DATADIR "/" KEYMAPDIR "/**", DATADIR "/" XKBKEYMAPDIR "/", DATADIR "/" LEGACYKEYMAPDIR "/**", KERNDIR "/", 0 };
static const char *const suffixes[] = { "", ".kmap", ".map", 0 };
static void __attribute__((noreturn))
diff -up kbd-2.0.4/src/paths.h.orig kbd-2.0.4/src/paths.h
--- kbd-2.0.4/src/paths.h.orig 2017-01-11 11:15:40.404115812 +0100
+++ kbd-2.0.4/src/paths.h 2017-01-11 11:15:59.730124274 +0100
@@ -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"

View File

@ -1,35 +0,0 @@
diff -up kbd-2.0.4/src/kdmapop.c.orig kbd-2.0.4/src/kdmapop.c
--- kbd-2.0.4/src/kdmapop.c.orig 2018-11-05 10:06:05.208744333 +0100
+++ kbd-2.0.4/src/kdmapop.c 2018-11-05 10:14:16.149215908 +0100
@@ -154,6 +154,7 @@ int getunimap(int fd, struct unimapdesc
}
if (ioctl(fd, GIO_UNIMAP, &ud)) {
perror("GIO_UNIMAP");
+ free(ud.entries);
return -1;
}
if (ct != ud.entry_ct)
diff -up kbd-2.0.4/src/libkeymap/common.c.orig kbd-2.0.4/src/libkeymap/common.c
--- kbd-2.0.4/src/libkeymap/common.c.orig 2016-12-19 16:01:51.000000000 +0100
+++ kbd-2.0.4/src/libkeymap/common.c 2018-11-05 10:05:50.207730393 +0100
@@ -246,5 +246,8 @@ int lk_free(struct lk_ctx *ctx)
ctx->key_line = NULL;
}
+ free(ctx);
+ ctx = NULL;
+
return 0;
}
diff -up kbd-2.0.4/src/setfont.c.orig kbd-2.0.4/src/setfont.c
--- kbd-2.0.4/src/setfont.c.orig 2018-11-05 10:28:01.994027734 +0100
+++ kbd-2.0.4/src/setfont.c 2018-11-05 10:35:54.933477039 +0100
@@ -327,6 +327,8 @@ do_loadfont(int fd, char *inbuf, int wid
if (putfont(fd, buf, fontsize, width, hwunit))
exit(EX_OSERR);
+
+ free(buf);
}
static void

View File

@ -1,15 +0,0 @@
diff -up kbd-2.0.4/src/vlock/auth.c.orig kbd-2.0.4/src/vlock/auth.c
--- kbd-2.0.4/src/vlock/auth.c.orig 2016-12-19 16:01:51.000000000 +0100
+++ kbd-2.0.4/src/vlock/auth.c 2023-03-20 09:34:06.010036016 +0100
@@ -140,9 +140,9 @@ int get_password(pam_handle_t *pamh, con
fflush(stdout);
/*
* EOF encountered on read?
- * If not on VT, check stdin.
+ * Check stdin.
*/
- if (is_vt || isatty(STDIN_FILENO)) {
+ if (isatty(STDIN_FILENO)) {
/* Ignore error. */
sleep(SHORT_DELAY);
break;

View File

@ -1,33 +0,0 @@
.TH KBDINFO 1 "June 2011"
.SH NAME
kbdinfo \- obtain information about the status of a console
.SH SYNOPSIS
\fBkbdinfo\fR [\-C \fIDEVICE\fR] getmode [text|graphics]
.LP
\fBkbdinfo\fR [\-C \fIDEVICE\fR] gkbmode [raw|xlate|mediumraw|unicode]
.LP
\fBkbdinfo\fR [\-C \fIDEVICE\fR] gkbmeta [metabit|escprefix]
.LP
\fBkbdinfo\fR [\-C \fIDEVICE\fR] gkbled [scrolllock|numlock|capslock]
.SH DESCRIPTION
.B kbdinfo
is an interface to KDGETMODE, GKBMODE, GKBMETA and GKBLED ioctls. Its
primary use case is to query the status of the given
.I CONSOLE
(or the currently active one, if no \-C option is present) from a shell
script.
.LP
If the final value argument is not specified,
.B kbdinfo
will print the result of the desired ioctl to the standard output.
Otherwise, the given value is compared to the actual result, and the
utility will exit with a status code of 0 for a match, 1 otherwise. No
text is printed for this style of invocation.
.SH "SEE ALSO"
.BR kbd_mode (1)
.SH AUTHOR
kbdinfo is Copyright \(co 2011 Alexey Gladkov
<gladkov.alexey@gmail.com>.
.LP
This manual page was written by Michael Schutte <michi@debian.org> for
the Debian GNU/Linux system (but may be used by others).

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
--- !Policy
product_versions:
- rhel-9
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}

View File

@ -1,6 +1,6 @@
diff -up kbd-2.0.4/docs/man/man1/showkey.1.orig kbd-2.0.4/docs/man/man1/showkey.1
--- kbd-2.0.4/docs/man/man1/showkey.1.orig 2016-10-31 16:56:02.000000000 +0100
+++ kbd-2.0.4/docs/man/man1/showkey.1 2017-01-11 10:45:03.763312393 +0100
diff -up kbd-2.3.0/docs/man/man1/showkey.1.orig kbd-2.3.0/docs/man/man1/showkey.1
--- kbd-2.3.0/docs/man/man1/showkey.1.orig 2020-07-08 19:25:47.000000000 +0200
+++ kbd-2.3.0/docs/man/man1/showkey.1 2020-07-16 08:56:15.970254183 +0200
@@ -84,6 +84,19 @@ corresponds to what the keyboard hardwar
to know the scan codes sent by various keys it is better to boot a
2.4 kernel. Since 2.6.9 there also is the boot option atkbd.softraw=0
@ -21,13 +21,13 @@ diff -up kbd-2.0.4/docs/man/man1/showkey.1.orig kbd-2.0.4/docs/man/man1/showkey.
.SH "SEE ALSO"
.BR loadkeys (1),
.BR dumpkeys (1),
diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setkeycodes.8
--- kbd-2.0.4/docs/man/man8/setkeycodes.8.orig 2016-10-31 16:56:02.000000000 +0100
+++ kbd-2.0.4/docs/man/man8/setkeycodes.8 2017-01-11 10:45:03.763312393 +0100
@@ -38,6 +38,10 @@ to showkey(1), the command
.RE
will assign the keycode 112 to it, and then loadkeys(1) can be used
to define the function of this key.
diff -up kbd-2.3.0/docs/man/man8/setkeycodes.8.orig kbd-2.3.0/docs/man/man8/setkeycodes.8
--- kbd-2.3.0/docs/man/man8/setkeycodes.8.orig 2020-07-08 19:35:35.000000000 +0200
+++ kbd-2.3.0/docs/man/man8/setkeycodes.8 2020-07-16 08:57:52.293900997 +0200
@@ -42,6 +42,10 @@ the command
will assign the keycode 112 to it, and then
.BR loadkeys (1)
can be used to define the function of this key.
+
+USB keyboards have standardized keycodes and
+.B setkeycodes
@ -35,7 +35,7 @@ diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setk
.LP
Some older kernels might hardwire a low scancode range to the
equivalent keycodes; setkeycodes will fail when you try to remap
@@ -56,6 +60,14 @@ None.
@@ -60,6 +64,14 @@ None.
.SH BUGS
The keycodes of X have nothing to do with those of Linux.
Unusual keys can be made visible under Linux, but not under X.
@ -48,5 +48,5 @@ diff -up kbd-2.0.4/docs/man/man8/setkeycodes.8.orig kbd-2.0.4/docs/man/man8/setk
+cannot change the mapping of other devices than the "first" one.
+
.SH "SEE ALSO"
.I "dumpkeys (1), loadkeys (1), showkey (1), getkeycodes (8)"
.BR dumpkeys (1),
.BR loadkeys (1),

View File

@ -1,7 +1,7 @@
diff -up kbd-2.0.4/docs/man/man8/kbdrate.8.orig kbd-2.0.4/docs/man/man8/kbdrate.8
--- kbd-2.0.4/docs/man/man8/kbdrate.8.orig 2017-01-11 11:04:50.114831348 +0100
+++ kbd-2.0.4/docs/man/man8/kbdrate.8 2017-01-11 11:05:35.619851252 +0100
@@ -22,7 +22,7 @@ Using
diff -up kbd-2.1.0/docs/man/man8/kbdrate.8.orig kbd-2.1.0/docs/man/man8/kbdrate.8
--- kbd-2.1.0/docs/man/man8/kbdrate.8.orig 2019-06-21 10:08:17.000000000 +0200
+++ kbd-2.1.0/docs/man/man8/kbdrate.8 2019-07-17 10:36:19.876499648 +0200
@@ -19,7 +19,7 @@ Using
without any options will reset the repeat rate to 10.9 characters per second (cps)
and the delay to 250 milliseconds (ms) for Intel- and M68K-based systems.
These are the IBM defaults. On SPARC-based systems it will reset the repeat rate
@ -10,10 +10,10 @@ diff -up kbd-2.0.4/docs/man/man8/kbdrate.8.orig kbd-2.0.4/docs/man/man8/kbdrate.
.SH OPTIONS
.TP
diff -up kbd-2.0.4/src/kbdrate.c.orig kbd-2.0.4/src/kbdrate.c
--- kbd-2.0.4/src/kbdrate.c.orig 2017-01-11 11:05:10.226840148 +0100
+++ kbd-2.0.4/src/kbdrate.c 2017-01-11 11:05:56.832860537 +0100
@@ -111,9 +111,12 @@ static int valid_delays[] = { 250, 500,
diff -up kbd-2.1.0/src/kbdrate.c.orig kbd-2.1.0/src/kbdrate.c
--- kbd-2.1.0/src/kbdrate.c.orig 2019-07-02 17:44:57.000000000 +0200
+++ kbd-2.1.0/src/kbdrate.c 2019-07-17 11:07:04.732486323 +0200
@@ -114,9 +114,12 @@ static int print_only = 0;
static int
KDKBDREP_ioctl_ok(double rate, int delay, int silent)
{
@ -26,8 +26,8 @@ diff -up kbd-2.0.4/src/kbdrate.c.orig kbd-2.0.4/src/kbdrate.c
* Since 2.4.9 also on i386.
*/
struct my_kbd_repeat kbdrep_s;
@@ -176,6 +179,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
rate, kbdrep_s.delay);
@@ -181,6 +184,9 @@ KDKBDREP_ioctl_ok(double rate, int delay
}
return 1; /* success! */
+#else /* no KDKBDREP or __sparc__ */
@ -35,31 +35,28 @@ diff -up kbd-2.0.4/src/kbdrate.c.orig kbd-2.0.4/src/kbdrate.c
+#endif /* KDKBDREP */
}
#ifndef KIOCSRATE
@@ -226,7 +232,7 @@ sigalrmhandler(int sig __attribute__((un
int main(int argc, char **argv)
{
#ifdef __sparc__
- double rate = 5.0; /* Default rate */
+ double rate = 20.0; /* Default rate */
int delay = 200; /* Default delay */
#else
double rate = 10.9; /* Default rate */
@@ -275,8 +281,9 @@ int main(int argc, char **argv)
if (KIOCSRATE_ioctl_ok(rate, delay, silent)) /* sparc? */
return 0;
#ifdef KIOCSRATE
@@ -251,6 +257,9 @@ ioport_set(double rate, int delay, int s
/* https://wiki.osdev.org/PS/2_Keyboard */
- /* The ioport way */
+ /* The ioport way - will crash on sparc */
+
+#ifndef __sparc__
for (i = 0; i < RATE_COUNT; i++)
for (i = 0; i < (int) RATE_COUNT; i++)
if (rate * 10 >= valid_rates[i]) {
value &= 0x60;
@@ -333,5 +340,6 @@ int main(int argc, char **argv)
@@ -304,11 +313,12 @@ ioport_set(double rate, int delay, int s
valid_rates[value & 0x1f] / 10.0,
valid_delays[(value & 0x60) >> 5]);
+#endif
return EXIT_SUCCESS;
return 1;
}
#ifdef __sparc__
-double rate = 5.0; /* Default rate */
+double rate = 20.0; /* Default rate */
int delay = 200; /* Default delay */
#else
double rate = 10.9; /* Default rate */

View File

@ -0,0 +1,24 @@
diff -up kbd-2.3.0/src/loadkeys.c.orig kbd-2.3.0/src/loadkeys.c
--- kbd-2.3.0/src/loadkeys.c.orig 2020-06-02 12:16:45.000000000 +0200
+++ kbd-2.3.0/src/loadkeys.c 2020-07-16 09:02:50.398864688 +0200
@@ -28,6 +28,8 @@
static const char *const dirpath1[] = {
"",
DATADIR "/" KEYMAPDIR "/**",
+ DATADIR "/" XKBKEYMAPDIR "/",
+ DATADIR "/" LEGACYKEYMAPDIR "/**",
KERNDIR "/",
NULL
};
diff -up kbd-2.3.0/src/paths.h.orig kbd-2.3.0/src/paths.h
--- kbd-2.3.0/src/paths.h.orig 2020-07-16 09:02:59.243010909 +0200
+++ kbd-2.3.0/src/paths.h 2020-07-16 09:03:23.446410942 +0200
@@ -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"

View File

@ -0,0 +1,61 @@
--- a/src/vlock/auth.c
+++ b/src/vlock/auth.c
@@ -4,7 +4,7 @@
PAM authentication routine for vlock, the VT locking program for linux.
Copyright (C) 1994-1998 Michael K. Johnson <johnsonm@redhat.com>
- Copyright (C) 2002, 2005 Dmitry V. Levin <ldv@altlinux.org>
+ Copyright (C) 2002, 2005, 2013 Dmitry V. Levin <ldv@altlinux.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -36,6 +36,25 @@
/* Unrecognized PAM error timeout. */
#define ERROR_TIMEOUT 10
+static int
+do_account_password_management (pam_handle_t *pamh)
+{
+ int rc;
+
+ /* Whether the authenticated user is allowed to log in? */
+ rc = pam_acct_mgmt (pamh, 0);
+
+ /* Do we need to prompt the user for a new password? */
+ if (rc == PAM_NEW_AUTHTOK_REQD)
+ rc = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
+
+ /* Extend the lifetime of the existing credentials. */
+ if (rc == PAM_SUCCESS)
+ rc = pam_setcred (pamh, PAM_REFRESH_CRED);
+
+ return rc;
+}
+
int
get_password (pam_handle_t * pamh, const char *username, const char *tty)
{
@@ -84,6 +103,23 @@ get_password (pam_handle_t * pamh, const char *username, const char *tty)
switch (rc)
{
case PAM_SUCCESS:
+ rc = do_account_password_management (pamh);
+
+ if (rc != PAM_SUCCESS)
+ {
+ /*
+ * The user was authenticated but
+ * either account or password management
+ * returned an error.
+ */
+ printf ("%s.\n\n\n",
+ pam_strerror (pamh, rc));
+ fflush (stdout);
+ pam_end (pamh, rc);
+ pamh = 0;
+ break;
+ }
+
pam_end (pamh, rc);
/* Log the fact of console unlocking. */
syslog (LOG_NOTICE,

View File

@ -0,0 +1,11 @@
diff -up kbd-2.3.0/src/libkfont/kdmapop.c.orig kbd-2.3.0/src/libkfont/kdmapop.c
--- kbd-2.3.0/src/libkfont/kdmapop.c.orig 2020-04-27 17:53:01.000000000 +0200
+++ kbd-2.3.0/src/libkfont/kdmapop.c 2020-07-16 09:06:45.246742724 +0200
@@ -166,6 +166,7 @@ kfont_get_unicodemap(struct kfont_contex
if (ioctl(fd, GIO_UNIMAP, &ud)) {
KFONT_ERR(ctx, "ioctl(GIO_UNIMAP): %m");
+ free(ud.entries);
return -1;
}
if (ct != ud.entry_ct)

View File

@ -0,0 +1,93 @@
diff -up kbd-2.4.0/src/libkbdfile/kbdfile.c.orig kbd-2.4.0/src/libkbdfile/kbdfile.c
--- kbd-2.4.0/src/libkbdfile/kbdfile.c.orig 2020-11-11 13:44:48.000000000 +0100
+++ kbd-2.4.0/src/libkbdfile/kbdfile.c 2021-04-27 09:58:08.405671071 +0200
@@ -39,8 +39,10 @@ kbdfile_new(struct kbdfile_ctx *ctx)
if (!fp->ctx) {
fp->ctx = kbdfile_context_new();
- if (!fp->ctx)
+ if (!fp->ctx) {
+ free(fp);
return NULL;
+ }
fp->flags |= KBDFILE_CTX_INITIALIZED;
}
@@ -69,7 +71,7 @@ kbdfile_get_pathname(struct kbdfile *fp)
int
kbdfile_set_pathname(struct kbdfile *fp, const char *pathname)
{
- strncpy(fp->pathname, pathname, sizeof(fp->pathname));
+ strncpy(fp->pathname, pathname, sizeof(fp->pathname) - 1);
return 0;
}
@@ -385,7 +387,7 @@ kbdfile_find(const char *fnam, const cha
fp->flags &= ~KBDFILE_PIPE;
/* Try explicitly given name first */
- strncpy(fp->pathname, fnam, sizeof(fp->pathname));
+ strncpy(fp->pathname, fnam, sizeof(fp->pathname) - 1);
if (!maybe_pipe_open(fp))
return 0;
diff -up kbd-2.4.0/src/libkeymap/common.c.orig kbd-2.4.0/src/libkeymap/common.c
--- kbd-2.4.0/src/libkeymap/common.c.orig 2019-06-24 13:55:23.000000000 +0200
+++ kbd-2.4.0/src/libkeymap/common.c 2021-04-27 09:58:08.405671071 +0200
@@ -139,6 +139,7 @@ init_array(struct lk_ctx *ctx, struct lk
rc = lk_array_init(ptr, size, 0);
if (rc < 0) {
ERR(ctx, _("unable to initialize array: %s"), strerror(rc));
+ free(ptr);
return -1;
}
diff -up kbd-2.4.0/src/libkfont/psffontop.c.orig kbd-2.4.0/src/libkfont/psffontop.c
--- kbd-2.4.0/src/libkfont/psffontop.c.orig 2020-04-27 17:53:01.000000000 +0200
+++ kbd-2.4.0/src/libkfont/psffontop.c 2021-04-27 09:59:14.170153676 +0200
@@ -235,6 +235,7 @@ kfont_read_psffont(struct kfont_context
if (psfhdr->mode > PSF1_MAXMODE) {
KFONT_ERR(ctx, _("Unsupported psf file mode (%d)"), psfhdr->mode);
+ free(psfhdr);
return -EX_DATAERR;
}
fontlen = ((psfhdr->mode & PSF1_MODE512) ? 512 : 256);
@@ -251,6 +252,7 @@ kfont_read_psffont(struct kfont_context
if (psfhdr.version > PSF2_MAXVERSION) {
KFONT_ERR(ctx, _("Unsupported psf version (%d)"), psfhdr.version);
+ free(inputbuf);
return -EX_DATAERR;
}
fontlen = assemble_uint32((unsigned char *)&psfhdr.length);
@@ -260,16 +262,20 @@ kfont_read_psffont(struct kfont_context
ftoffset = assemble_uint32((unsigned char *)&psfhdr.headersize);
fontwidth = assemble_uint32((unsigned char *)&psfhdr.width);
utf8 = 1;
- } else
+ } else {
+ free(inputbuf);
return -EX_DATAERR; /* not psf */
+ }
/* tests required - we divide by these */
if (fontlen == 0) {
KFONT_ERR(ctx, _("zero input font length?"));
+ free(inputbuf);
return -EX_DATAERR;
}
if (charsize == 0) {
KFONT_ERR(ctx, _("zero input character size?"));
+ free(inputbuf);
return -EX_DATAERR;
}
@@ -277,6 +283,7 @@ kfont_read_psffont(struct kfont_context
if (i > inputlth || (!hastable && i != inputlth)) {
KFONT_ERR(ctx, _("Input file: bad input length (%d)"), inputlth);
+ free(inputbuf);
return -EX_DATAERR;
}

View File

@ -0,0 +1,14 @@
diff -up kbd-2.4.0/src/setfont.c.orig kbd-2.4.0/src/setfont.c
--- kbd-2.4.0/src/setfont.c.orig 2020-06-02 11:30:41.000000000 +0200
+++ kbd-2.4.0/src/setfont.c 2021-05-17 12:06:44.360616147 +0200
@@ -189,8 +189,8 @@ int main(int argc, char *argv[])
if (restore)
kfont_restore_font(kfont, fd);
- if (ifilct)
- kfont_load_fonts(kfont, fd, ifiles, ifilct, iunit, hwunit, no_m, no_u);
+ if (ifilct && (ret = kfont_load_fonts(kfont, fd, ifiles, ifilct, iunit, hwunit, no_m, no_u)) < 0)
+ return -ret;
if (ufil && (ret = kfont_load_unicodemap(kfont, fd, ufil)) < 0)
return -ret;

View File

@ -1,11 +1,15 @@
Name: kbd
Version: 2.0.4
Release: 11%{?dist}
Summary: Tools for configuring the console (keyboard, virtual terminals, etc.)
# {_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.
%global kbd_datadir %{_exec_prefix}/lib/kbd
Group: System Environment/Base
Name: kbd
Version: 2.4.0
Release: 9%{?dist}
Summary: Tools for configuring the console (keyboard, virtual terminals, etc.)
License: GPLv2+
URL: http://www.kbd-project.org/
Source0: ftp://ftp.altlinux.org/pub/people/legion/kbd/kbd-%{version}.tar.xz
Source1: kbd-latsun-fonts.tar.bz2
Source2: kbd-latarcyrheb-32.tar.bz2
@ -28,16 +32,20 @@ Patch5: kbd-1.15.5-loadkeys-search-path.patch
# Patch6: don't hardcode font used in unicode_start, take it from vconsole.conf,
# bz 1101007
Patch6: kbd-2.0.2-unicode-start-font.patch
# Patch7: fixes issues found by static analysis, bz 1602566
# Patch7: fixes issues found by static analysis
Patch7: kbd-2.0.4-covscan-fixes.patch
# Patch8: fixes vlock when console or terminal is closed abruptly, bz 2178798
Patch8: kbd-2.0.4-vlock-stdin-closed-inf-loop.patch
# Patch8: fixes another batch of issues found by static analysis
Patch8: kbd-2.4.0-covscan-fixes.patch
# Patch9: fixes setfont exit code, bz 1947953
Patch9: kbd-2.4.0-setfont-exit-code.patch
BuildRequires: bison, flex, gettext, pam-devel, check-devel
BuildRequires: gcc, bison, flex, gettext, pam-devel, check-devel, automake
BuildRequires: console-setup, xkeyboard-config
BuildRequires: make
Requires: %{name}-misc = %{version}-%{release}
# Temporarily require -legacy
Requires: %{name}-legacy = %{version}-%{release}
# Be sure that system is after UsrMove
Conflicts: filesystem < 3
Provides: vlock = %{version}
Conflicts: vlock <= 1.3
Obsoletes: vlock
@ -75,7 +83,10 @@ cp -fp %{SOURCE6} .
%patch5 -p1 -b .loadkeys-search-path
%patch6 -p1 -b .unicode-start-font
%patch7 -p1 -b .covscan-fixes
%patch8 -p1 -b .vlock-stdin-closed-inf-loop
%patch8 -p1 -b .covscan-fixes-pt2
%patch9 -p1 -b .setfont-exit-code
aclocal
autoconf
# 7-bit maps are obsolete; so are non-euro maps
pushd data/keymaps/i386
@ -88,7 +99,6 @@ cp azerty/fr-latin9.map azerty/fr.map
cp azerty/fr-latin9.map azerty/fr-latin0.map # legacy alias
# Rename conflicting keymaps
mv dvorak/no.map dvorak/no-dvorak.map
mv fgGIod/trf.map fgGIod/trf-fgGIod.map
mv olpc/es.map olpc/es-olpc.map
mv olpc/pt.map olpc/pt-olpc.map
@ -105,79 +115,62 @@ iconv -f iso-8859-1 -t utf-8 < "ChangeLog" > "ChangeLog_"
mv "ChangeLog_" "ChangeLog"
%build
%configure --prefix=%{_prefix} --datadir=/lib/kbd --mandir=%{_mandir} --localedir=%{_datadir}/locale --enable-nls
make %{?_smp_mflags}
%configure --prefix=%{_prefix} --datadir=%{kbd_datadir} --mandir=%{_mandir} --localedir=%{_datadir}/locale --enable-nls
%make_build
%install
make install DESTDIR=$RPM_BUILD_ROOT
%make_install
# ro_win.map.gz is useless
rm -f $RPM_BUILD_ROOT/lib/kbd/keymaps/i386/qwerty/ro_win.map.gz
rm -f $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ro_win.map.gz
# Create additional name for Serbian latin keyboard
ln -s sr-cy.map.gz $RPM_BUILD_ROOT/lib/kbd/keymaps/i386/qwerty/sr-latin.map.gz
ln -s sr-cy.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/sr-latin.map.gz
# The rhpl keyboard layout table is indexed by kbd layout names, so we need a
# Korean keyboard
ln -s us.map.gz $RPM_BUILD_ROOT/lib/kbd/keymaps/i386/qwerty/ko.map.gz
# Move binaries which we use before /usr is mounted from %{_bindir} to /bin.
mkdir -p $RPM_BUILD_ROOT/bin
for binary in setfont dumpkeys kbd_mode unicode_start unicode_stop loadkeys ; do
mv $RPM_BUILD_ROOT%{_bindir}/$binary $RPM_BUILD_ROOT/bin/
done
ln -s us.map.gz $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/i386/qwerty/ko.map.gz
# Some microoptimization
sed -i -e 's,\<kbd_mode\>,/bin/kbd_mode,g;s,\<setfont\>,/bin/setfont,g' \
$RPM_BUILD_ROOT/bin/unicode_start
# Link open to openvt
ln -s openvt $RPM_BUILD_ROOT%{_bindir}/open
ln -s openvt.1.gz $RPM_BUILD_ROOT%{_mandir}/man1/open.1.gz
sed -i -e 's,\<kbd_mode\>,%{_bindir}/kbd_mode,g;s,\<setfont\>,%{_bindir}/setfont,g' \
$RPM_BUILD_ROOT%{_bindir}/unicode_start
# install kbdinfo manpage
gzip -c %SOURCE5 > $RPM_BUILD_ROOT/%{_mandir}/man1/kbdinfo.1.gz
# Move locale files to correct place
cp -r $RPM_BUILD_ROOT/lib/kbd/locale/ $RPM_BUILD_ROOT%{_datadir}/locale
rm -rf $RPM_BUILD_ROOT/lib/kbd/locale
# Install PAM configuration for vlock
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/pam.d/vlock
# Move original keymaps to legacy directory
mkdir -p $RPM_BUILD_ROOT/lib/kbd/keymaps/legacy
mv $RPM_BUILD_ROOT/lib/kbd/keymaps/{amiga,atari,i386,include,mac,ppc,sun} $RPM_BUILD_ROOT/lib/kbd/keymaps/legacy
mkdir -p $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy
mv $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/{amiga,atari,i386,include,mac,ppc,sun} $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/legacy
# Convert X keyboard layouts to console keymaps
mkdir -p $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb
mkdir -p $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb
perl xml2lst.pl < /usr/share/X11/xkb/rules/base.xml > layouts-variants.lst
while read line; do
XKBLAYOUT=`echo "$line" | cut -d " " -f 1`
echo "$XKBLAYOUT" >> layouts-list.lst
XKBVARIANT=`echo "$line" | cut -d " " -f 2`
ckbcomp "$XKBLAYOUT" "$XKBVARIANT" | gzip > $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz
ckbcomp -rules base "$XKBLAYOUT" "$XKBVARIANT" | gzip > $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/"$XKBLAYOUT"-"$XKBVARIANT".map.gz
done < layouts-variants.lst
# Convert X keyboard layouts (plain, no variant)
cat layouts-list.lst | sort -u >> layouts-list-uniq.lst
while read line; do
ckbcomp "$line" | gzip > $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/"$line".map.gz
ckbcomp -rules base "$line" | gzip > $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/"$line".map.gz
done < layouts-list-uniq.lst
# wipe converted layouts which cannot input ASCII (#1031848)
zgrep -L "U+0041" $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/* | xargs rm -f
zgrep -L "U+0041" $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/* | xargs rm -f
# Rename the converted default fi (kotoistus) layout (#1117891)
gunzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi.map.gz
mv $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi.map $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi-kotoistus.map
gzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/fi-kotoistus.map
# Fix converted cz layout - add compose rules
gunzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/cz.map.gz
patch $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/cz.map < %{SOURCE6}
gzip $RPM_BUILD_ROOT/lib/kbd/keymaps/xkb/cz.map
# Fix converted cz layout - add compose rules, if exists
if [ -f "$RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map.gz" ]; then
gunzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map.gz
patch $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map < %{SOURCE6}
gzip $RPM_BUILD_ROOT%{kbd_datadir}/keymaps/xkb/cz.map
fi
%find_lang %{name}
@ -187,41 +180,123 @@ make check
%endif
%files -f %{name}.lang
%doc ChangeLog AUTHORS README COPYING docs/doc/kbd.FAQ*.html docs/doc/font-formats/*.html docs/doc/utf/utf* docs/doc/dvorak/*
/bin/*
%license COPYING
%doc ChangeLog AUTHORS README docs/doc/kbd.FAQ*.html docs/doc/font-formats/*.html docs/doc/utf/utf* docs/doc/dvorak/*
%{_bindir}/*
%{_mandir}/*/*
%config(noreplace) %{_sysconfdir}/pam.d/vlock
# library used only for tests
%exclude %{_libdir}/libtswrap*
%exclude %{_prefix}/lib/debug/%{_libdir}/libtswrap*
%files misc
/lib/kbd
%exclude /lib/kbd/keymaps/legacy
%{kbd_datadir}
%exclude %{kbd_datadir}/keymaps/legacy
%files legacy
/lib/kbd/keymaps/legacy
%{kbd_datadir}/keymaps/legacy
%changelog
* Tue Apr 18 2023 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-11
- Fix vlock when console or terminal is closed abruptly
Resolves: #2178798
* Mon Apr 17 2023 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-9
- Require kbd-legacy in main kbd package again
Resolves: #2139165
* Wed Jun 17 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-10
- Add %%check, rebuild
* Tue Jan 18 2022 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-8
- Use default Finnish xkb-converted layout
Resolves: #2031127
* Tue Jun 16 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-9
- Rebuild
Resolves: #1844967
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.0-7
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Mon Dec 10 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-8
- Fix issues found by static analysis
Resoloves: #1602566
* Mon May 17 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-6
- Fix setfont exit code
Resolves: #1947953
* Tue Jul 31 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-7
- Drop initscripts Require
Resolves: #1610277
* Wed May 05 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-5
- Fix issues detected by static analysis
Resolves: #1938749
* Tue Jul 24 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-6
- Rebuilt (reuploaded upstream tarball, the checksum differed)
* Thu Apr 22 2021 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-4
- Fix layout->keymap conversion broken by change in xkeyboard-config
(patch by Peter Hutterer)
Resolves: #1950406
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 2.4.0-3
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Dec 16 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.4.0-1
- Update to kbd-2.4.0
Resolves: #1908123
* Thu Oct 29 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-4
- Don't require kbd-legacy in main kbd package anymore
Resolves: #1891811
* Wed Sep 23 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-3
- Exclude test library instead of removing it to fix --nocheck builds
Resolves: #1881515
* Fri Aug 28 2020 Adam Williamson <awilliam@redhat.com> - 2.3.0-2
- Rebuild with grep #1872913 fix to correctly drop non-ASCII layouts
Resolves: #1872922
* Wed Jul 29 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.3.0-1
- Make changes in converted layouts conditionally
- Use make macros, patch by Tom Stellard <tstellar@redhat.com>
(https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro)
- Update to kbd-2.3.0
Resolves: #1855867
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Mar 17 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.0-3
- Use upstream test suite in %%check
* Thu Mar 05 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.0-2
- Don't move binaries to /bin, shouldn't be needed after UsrMove
- Move kbd data (console fonts, keymaps, ...) to /usr
Resolves: #1809257
* Mon Feb 10 2020 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.2.0-1
- Update to kbd-2.2.0
Resolves: #1742036
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Nov 28 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-12
- Apply only tty non-breaking fixes from -10
* Tue Nov 13 2018 Adam Williamson <awilliam@redhat.com> - 2.0.4-11
- Drop fixes from -10 for now as they are breaking ttys (#1649531)
* Mon Nov 12 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-10
- Fix issues detected by static analysis
* Mon Aug 13 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-9
- Remove the link from open to openvt
(related discussion and rationale in Debian bug tracker, bug #732796)
* Mon Jul 30 2018 Peter Robinson <pbrobinson@fedoraproject.org> 2.0.4-8
- Drop initscripts Require, use %%license
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Feb 21 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 2.0.4-6
- Add BuildRequires gcc
- Escape macro in comment, remove Group tag
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

4
sources Normal file
View File

@ -0,0 +1,4 @@
SHA512 (kbd-latsun-fonts.tar.bz2) = b98da5df85017ef1bd297eb2255046d54dd805c84356db7533f24e49fb78c8e3999901a45a49cdf6a74c0002bba2e0aa8327469d78dd38b6e747103972c30584
SHA512 (kbd-latarcyrheb-32.tar.bz2) = 1870a708e16cf16f8343f02f7e97940e8404655078f92709a0b8a334be772faa99b4dbaca37e8d8c5b16d0d4d811fe6b102e4f76ae821148eb33075613dc95b8
SHA512 (kbdinfo.1) = 8696d55f6c15f0ee2c2936eca6180b18100a87b11f0efe809a9531bb1228c67cd096cbc8fa25d9ee496daab28892ee5f320cc4bc9c9d816ff666bb4f80271c99
SHA512 (kbd-2.4.0.tar.xz) = c3823e40878ed4cb5b90edf753dba37a7fc3189b7b08a2e59a7830cac23a7a7daf31dedef1fcc130698c7508bc2a037c8ab54e749d0cdbf51756e346f2ed5abb