diff options
author | sjg <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
commit | d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2 (patch) | |
tree | b04f4bd7cd887f50e7d98af35f46b9834ff86c80 /usr.sbin/kbdcontrol | |
parent | 3c8e37b1d04827f33c0c9a7594bd1b1ef7cdb3d3 (diff) | |
parent | 4fbde208c6460d576f64d6dc3cdc6cab085a4283 (diff) | |
download | FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.zip FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.tar.gz |
Merge head from 7/28
Diffstat (limited to 'usr.sbin/kbdcontrol')
-rw-r--r-- | usr.sbin/kbdcontrol/kbdcontrol.1 | 2 | ||||
-rw-r--r-- | usr.sbin/kbdcontrol/kbdcontrol.c | 20 | ||||
-rw-r--r-- | usr.sbin/kbdcontrol/path.h | 4 |
3 files changed, 23 insertions, 3 deletions
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1 index 76cc5bb..3ffa270 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.1 +++ b/usr.sbin/kbdcontrol/kbdcontrol.1 @@ -271,6 +271,6 @@ kbdcontrol -k /dev/kbdmux0 < /dev/console .Xr kbdmap 5 , .Xr rc.conf 5 .Sh AUTHORS -.An S\(/oren Schmidt Aq sos@FreeBSD.org +.An S\(/oren Schmidt Aq Mt sos@FreeBSD.org .Sh BUGS Report when found. diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c index 8c9bb81..241e10d 100644 --- a/usr.sbin/kbdcontrol/kbdcontrol.c +++ b/usr.sbin/kbdcontrol/kbdcontrol.c @@ -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,18 @@ 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) +{ + char vty_name[4] = ""; + size_t len = sizeof(vty_name); + + if (sysctlbyname("kern.vty", vty_name, &len, NULL, 0) != 0) + return (0); + return (strcmp(vty_name, "vt") == 0); +} + static char * nextarg(int ac, char **av, int *indp, int oc) { @@ -785,10 +798,13 @@ load_keymap(char *opt, int dumponly) FILE *fd; int i, j; char *name, *cp; - char blank[] = "", keymap_path[] = KEYMAP_PATH, dotkbd[] = ".kbd"; - char *prefix[] = {blank, blank, keymap_path, NULL}; + char blank[] = "", keymap_path[] = KEYMAP_PATH; + char vt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = ".kbd"; + char *prefix[] = {blank, 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); diff --git a/usr.sbin/kbdcontrol/path.h b/usr.sbin/kbdcontrol/path.h index 709acbc..e1fa341 100644 --- a/usr.sbin/kbdcontrol/path.h +++ b/usr.sbin/kbdcontrol/path.h @@ -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/" |