mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 14:48:57 +00:00
Enable kbdcontrol(1) to use maps from vt(4) keymaps dir /usr/share/vt/keymaps
if vt(4) is present. MFC after: 7 days Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
d2511654f8
commit
2f11ee6205
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=266839
@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <fcntl.h>
|
||||
#include <sys/kbio.h>
|
||||
#include <sys/consio.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include "path.h"
|
||||
#include "lex.h"
|
||||
|
||||
@ -141,6 +142,17 @@ static void set_keyrates(char *opt);
|
||||
static void show_kbd_info(void);
|
||||
static void usage(void) __dead2;
|
||||
|
||||
/* Detect presence of vt(4). */
|
||||
static int
|
||||
is_vt4(void)
|
||||
{
|
||||
|
||||
if (sysctlbyname("kern.vt.deadtimer", NULL, NULL, NULL, 0) == 0)
|
||||
return (1);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static char *
|
||||
nextarg(int ac, char **av, int *indp, int oc)
|
||||
{
|
||||
@ -785,10 +797,13 @@ load_keymap(char *opt, int dumponly)
|
||||
FILE *fd;
|
||||
int i, j;
|
||||
char *name, *cp;
|
||||
char blank[] = "", keymap_path[] = KEYMAP_PATH, dotkbd[] = ".kbd";
|
||||
char blank[] = "", keymap_path[] = KEYMAP_PATH;
|
||||
char vt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = ".kbd";
|
||||
char *prefix[] = {blank, blank, keymap_path, NULL};
|
||||
char *postfix[] = {blank, dotkbd, NULL};
|
||||
|
||||
if (is_vt4())
|
||||
prefix[2] = vt_keymap_path;
|
||||
cp = getenv("KEYMAP_PATH");
|
||||
if (cp != NULL)
|
||||
asprintf(&(prefix[0]), "%s/", cp);
|
||||
|
@ -1,4 +1,8 @@
|
||||
/* $FreeBSD$ */
|
||||
|
||||
#define KEYMAP_PATH "/usr/share/syscons/keymaps/"
|
||||
#define FONT_PATH "/usr/share/syscons/fonts/"
|
||||
#define SCRNMAP_PATH "/usr/share/syscons/scrnmaps/"
|
||||
|
||||
#define VT_KEYMAP_PATH "/usr/share/vt/keymaps/"
|
||||
#define VT_FONT_PATH "/usr/share/vt/fonts/"
|
||||
|
Loading…
Reference in New Issue
Block a user