FreeBSD bhyve keyboard layout patch
リビジョン | 64183a6152c17fb4bcafcaef1acb6be81400e886 (tree) |
---|---|
日時 | 2021-05-03 23:00:42 |
作者 | ![]() |
コミッター | Koine Yuusuke(koinec) |
* Change keyboard layout specification option to "-K" (uppercase K). (Because "-k" is used for other purposes in FreeBSD current's bhyve)
* Fix the following issues on the FreeBSD review site. (Corrected the violation of man's notation rule by incorporating the content of the proposal on the review side.) (https://reviews.freebsd.org/D29473)
@@ -1,6 +1,6 @@ | ||
1 | 1 | diff -uprN bhyve_orig/Makefile bhyve/Makefile |
2 | 2 | --- bhyve_orig/Makefile 2020-10-23 09:02:29.000000000 +0900 |
3 | -+++ bhyve/Makefile 2020-12-30 15:37:58.795173000 +0900 | |
3 | ++++ bhyve/Makefile 2021-05-03 22:14:14.502876000 +0900 | |
4 | 4 | @@ -95,4 +95,6 @@ CFLAGS+=-DGDB_LOG |
5 | 5 | |
6 | 6 | WARNS?= 2 |
@@ -10,32 +10,33 @@ diff -uprN bhyve_orig/Makefile bhyve/Makefile | ||
10 | 10 | .include <bsd.prog.mk> |
11 | 11 | diff -uprN bhyve_orig/bhyve.8 bhyve/bhyve.8 |
12 | 12 | --- bhyve_orig/bhyve.8 2020-10-23 09:02:29.000000000 +0900 |
13 | -+++ bhyve/bhyve.8 2020-12-30 15:37:58.795903000 +0900 | |
13 | ++++ bhyve/bhyve.8 2021-05-03 22:14:50.353899000 +0900 | |
14 | 14 | @@ -47,6 +47,7 @@ |
15 | 15 | .Sm on |
16 | 16 | .Op Fl G Ar port |
17 | 17 | .Op Fl g Ar gdbport |
18 | -+.Op Fl k Ar layout | |
18 | ++.Op Fl K Ar layout | |
19 | 19 | .Oo Fl l |
20 | 20 | .Sm off |
21 | 21 | .Cm help | Ar lpcdev Op Cm \&, Ar conf |
22 | -@@ -163,6 +164,13 @@ Print help message and exit. | |
22 | +@@ -163,6 +164,14 @@ Print help message and exit. | |
23 | 23 | .It Fl H |
24 | 24 | Yield the virtual CPU thread when a HLT instruction is detected. |
25 | 25 | If this option is not specified, virtual CPUs will use 100% of a host CPU. |
26 | -+.It Fl k Ar layout | |
26 | ++.It Fl K Ar layout | |
27 | 27 | +Specify the keyboard layout. |
28 | 28 | +The value that can be specified sets the file name in |
29 | 29 | +.Ar /usr/share/bhyve/kbdlayout . |
30 | -+This specification only works when loaded with UEFI mode.(Not working via console or SSH) | |
31 | -+If you are using a VNC client that supports QEMU Extended Key Event Message (e.g. TigerVNC), don't need to specify this option. | |
32 | -+If you are using a VNC client that doesn't support it(e.g. tightVNC), and you don't specify this option, the US keyboard layout(default) is specified. | |
30 | ++This specification only works when loaded with UEFI mode for VNC. | |
31 | ++(Not working via serial console or SSH) | |
32 | ++When using a VNC client that supports QEMU Extended Key Event Message (e.g. TigerVNC), this option isn't needed. | |
33 | ++When using a VNC client that doesn't support QEMU Extended Key Event Message (e.g. tightVNC), the default layout defaults to the US keyboard unless specified otherwise. | |
33 | 34 | .It Fl l Op Ar help|lpcdev Ns Op , Ns Ar conf |
34 | 35 | Allow devices behind the LPC PCI-ISA bridge to be configured. |
35 | 36 | The only supported devices are the TTY-class devices |
36 | 37 | diff -uprN bhyve_orig/bhyverun.c bhyve/bhyverun.c |
37 | 38 | --- bhyve_orig/bhyverun.c 2020-10-23 09:02:29.000000000 +0900 |
38 | -+++ bhyve/bhyverun.c 2020-12-30 15:37:58.796864000 +0900 | |
39 | ++++ bhyve/bhyverun.c 2021-05-03 22:14:14.504885000 +0900 | |
39 | 40 | @@ -165,6 +165,8 @@ char *vmname; |
40 | 41 | int guest_ncpus; |
41 | 42 | uint16_t cores, maxcpus, sockets, threads; |
@@ -50,7 +51,7 @@ diff -uprN bhyve_orig/bhyverun.c bhyve/bhyverun.c | ||
50 | 51 | "Usage: %s [-abehuwxACDHPSWY]\n" |
51 | 52 | " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" |
52 | 53 | - " %*s [-g <gdb port>] [-l <lpc>]\n" |
53 | -+ " %*s [-g <gdb port>] [-k layout] [-l <lpc>]\n" | |
54 | ++ " %*s [-g <gdb port>] [-K layout] [-l <lpc>]\n" | |
54 | 55 | " %*s [-m mem] [-p vcpu:hostcpu] [-s <pci>] [-U uuid] <vm>\n" |
55 | 56 | " -a: local apic is in xAPIC mode (deprecated)\n" |
56 | 57 | " -A: create ACPI tables\n" |
@@ -58,7 +59,7 @@ diff -uprN bhyve_orig/bhyverun.c bhyve/bhyverun.c | ||
58 | 59 | " -g: gdb port\n" |
59 | 60 | " -h: help\n" |
60 | 61 | " -H: vmexit from the guest on hlt\n" |
61 | -+ " -k: PS2 keyboard layout\n" | |
62 | ++ " -K: PS2 keyboard layout\n" | |
62 | 63 | " -l: LPC device configuration\n" |
63 | 64 | " -m: memory size in MB\n" |
64 | 65 | " -p: pin 'vcpu' to 'hostcpu'\n" |
@@ -69,7 +70,7 @@ diff -uprN bhyve_orig/bhyverun.c bhyve/bhyverun.c | ||
69 | 70 | + kbdlayout_name = NULL; |
70 | 71 | |
71 | 72 | - optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:"; |
72 | -+ optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:k:U:"; | |
73 | ++ optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:K:U:"; | |
73 | 74 | while ((c = getopt(argc, argv, optstr)) != -1) { |
74 | 75 | switch (c) { |
75 | 76 | case 'a': |
@@ -78,14 +79,14 @@ diff -uprN bhyve_orig/bhyverun.c bhyve/bhyverun.c | ||
78 | 79 | } |
79 | 80 | gdb_port = atoi(optarg); |
80 | 81 | + break; |
81 | -+ case 'k': | |
82 | ++ case 'K': | |
82 | 83 | + kbdlayout_name = optarg; |
83 | 84 | break; |
84 | 85 | case 'l': |
85 | 86 | if (strncmp(optarg, "help", strlen(optarg)) == 0) { |
86 | 87 | diff -uprN bhyve_orig/bhyverun.h bhyve/bhyverun.h |
87 | 88 | --- bhyve_orig/bhyverun.h 2020-10-23 09:02:29.000000000 +0900 |
88 | -+++ bhyve/bhyverun.h 2020-12-30 15:37:58.797234000 +0900 | |
89 | ++++ bhyve/bhyverun.h 2021-05-03 22:14:14.505299000 +0900 | |
89 | 90 | @@ -39,6 +39,7 @@ extern int guest_ncpus; |
90 | 91 | extern uint16_t cores, sockets, threads; |
91 | 92 | extern char *guest_uuid_str; |
@@ -96,7 +97,7 @@ diff -uprN bhyve_orig/bhyverun.h bhyve/bhyverun.h | ||
96 | 97 | |
97 | 98 | diff -uprN bhyve_orig/ps2kbd.c bhyve/ps2kbd.c |
98 | 99 | --- bhyve_orig/ps2kbd.c 2020-10-23 09:02:29.000000000 +0900 |
99 | -+++ bhyve/ps2kbd.c 2020-12-30 15:37:58.797949000 +0900 | |
100 | ++++ bhyve/ps2kbd.c 2021-05-03 22:14:14.506115000 +0900 | |
100 | 101 | @@ -31,15 +31,20 @@ |
101 | 102 | __FBSDID("$FreeBSD: releng/12.2/usr.sbin/bhyve/ps2kbd.c 358184 2020-02-20 21:48:36Z vmaffione $"); |
102 | 103 |