FreeBSD bhyve keyboard layout patch
リビジョン | e5fa1dd331f6b810e2c74a75fea1ab80381d50f3 (tree) |
---|---|
日時 | 2021-05-03 22:45:35 |
作者 | ![]() |
コミッター | Koine Yuusuke(koinec) |
* Update for FreeBSD 13.0-RELEASE.(Along with this, the patch filename was changed)
* 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,7 +1,7 @@ | ||
1 | 1 | diff -uprN bhyve_orig/Makefile bhyve/Makefile |
2 | ---- bhyve_orig/Makefile 2020-12-24 09:12:34.000000000 +0900 | |
3 | -+++ bhyve/Makefile 2020-12-30 21:29:03.796383000 +0900 | |
4 | -@@ -124,4 +124,6 @@ CFLAGS+=-DGDB_LOG | |
2 | +--- bhyve_orig/Makefile 2021-04-09 09:24:13.000000000 +0900 | |
3 | ++++ bhyve/Makefile 2021-05-03 13:23:03.033648000 +0900 | |
4 | +@@ -131,4 +131,6 @@ CFLAGS+=-DGDB_LOG | |
5 | 5 | |
6 | 6 | WARNS?= 2 |
7 | 7 |
@@ -9,34 +9,35 @@ diff -uprN bhyve_orig/Makefile bhyve/Makefile | ||
9 | 9 | + |
10 | 10 | .include <bsd.prog.mk> |
11 | 11 | diff -uprN bhyve_orig/bhyve.8 bhyve/bhyve.8 |
12 | ---- bhyve_orig/bhyve.8 2020-12-24 09:12:34.000000000 +0900 | |
13 | -+++ bhyve/bhyve.8 2020-12-30 21:24:17.882128000 +0900 | |
14 | -@@ -47,6 +47,7 @@ | |
12 | +--- bhyve_orig/bhyve.8 2021-04-09 09:24:13.000000000 +0900 | |
13 | ++++ bhyve/bhyve.8 2021-05-03 13:30:52.846171000 +0900 | |
14 | +@@ -46,6 +46,7 @@ | |
15 | + .Oc | |
15 | 16 | .Sm on |
16 | 17 | .Op Fl G Ar port |
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 | -@@ -166,6 +167,13 @@ Print help message and exit. | |
22 | +@@ -149,6 +150,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 | ---- bhyve_orig/bhyverun.c 2020-12-24 09:12:34.000000000 +0900 | |
38 | -+++ bhyve/bhyverun.c 2020-12-30 21:26:48.192087000 +0900 | |
39 | -@@ -189,6 +189,8 @@ const char *vmname; | |
38 | +--- bhyve_orig/bhyverun.c 2021-04-09 09:24:13.000000000 +0900 | |
39 | ++++ bhyve/bhyverun.c 2021-05-03 13:29:03.821960000 +0900 | |
40 | +@@ -188,6 +188,8 @@ const char *vmname; | |
40 | 41 | int guest_ncpus; |
41 | 42 | uint16_t cores, maxcpus, sockets, threads; |
42 | 43 |
@@ -45,51 +46,51 @@ diff -uprN bhyve_orig/bhyverun.c bhyve/bhyverun.c | ||
45 | 46 | char *guest_uuid_str; |
46 | 47 | |
47 | 48 | int raw_stdio = 0; |
48 | -@@ -239,7 +241,7 @@ usage(int code) | |
49 | +@@ -238,7 +240,7 @@ usage(int code) | |
49 | 50 | fprintf(stderr, |
50 | - "Usage: %s [-abehuwxACDHPSWY]\n" | |
51 | + "Usage: %s [-aehuwxACDHPSWY]\n" | |
51 | 52 | " %*s [-c [[cpus=]numcpus][,sockets=n][,cores=n][,threads=n]]\n" |
52 | -- " %*s [-g <gdb port>] [-l <lpc>]\n" | |
53 | -+ " %*s [-g <gdb port>] [-k layout] [-l <lpc>]\n" | |
53 | +- " %*s [-l <lpc>]\n" | |
54 | ++ " %*s [-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" |
57 | -@@ -250,6 +252,7 @@ usage(int code) | |
58 | - " -g: gdb port\n" | |
58 | +@@ -248,6 +250,7 @@ usage(int code) | |
59 | + " -e: exit on unhandled I/O access\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 | #ifdef BHYVE_SNAPSHOT |
65 | -@@ -1109,11 +1112,12 @@ main(int argc, char *argv[]) | |
66 | +@@ -1105,11 +1108,12 @@ main(int argc, char *argv[]) | |
66 | 67 | mptgen = 1; |
67 | 68 | rtc_localtime = 1; |
68 | 69 | memflags = 0; |
69 | 70 | + kbdlayout_name = NULL; |
70 | 71 | |
71 | 72 | #ifdef BHYVE_SNAPSHOT |
72 | -- optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:r:"; | |
73 | -+ optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:k:U:r:"; | |
73 | +- optstr = "aehuwxACDHIPSWYp:G:c:s:m:l:U:r:"; | |
74 | ++ optstr = "aehuwxACDHIPSWYp:G:c:s:m:l:K:U:r:"; | |
74 | 75 | #else |
75 | -- optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:U:"; | |
76 | -+ optstr = "abehuwxACDHIPSWYp:g:G:c:s:m:l:k:U:"; | |
76 | +- optstr = "aehuwxACDHIPSWYp:G:c:s:m:l:U:"; | |
77 | ++ optstr = "aehuwxACDHIPSWYp:G:c:s:m:l:K:U:"; | |
77 | 78 | #endif |
78 | 79 | while ((c = getopt(argc, argv, optstr)) != -1) { |
79 | 80 | switch (c) { |
80 | -@@ -1155,6 +1159,9 @@ main(int argc, char *argv[]) | |
81 | +@@ -1143,6 +1147,9 @@ main(int argc, char *argv[]) | |
81 | 82 | optarg++; |
82 | 83 | } |
83 | 84 | gdb_port = atoi(optarg); |
84 | 85 | + break; |
85 | -+ case 'k': | |
86 | ++ case 'K': | |
86 | 87 | + kbdlayout_name = optarg; |
87 | 88 | break; |
88 | 89 | case 'l': |
89 | 90 | if (strncmp(optarg, "help", strlen(optarg)) == 0) { |
90 | 91 | diff -uprN bhyve_orig/bhyverun.h bhyve/bhyverun.h |
91 | ---- bhyve_orig/bhyverun.h 2020-12-24 09:12:34.000000000 +0900 | |
92 | -+++ bhyve/bhyverun.h 2020-12-30 21:24:17.885813000 +0900 | |
92 | +--- bhyve_orig/bhyverun.h 2021-04-09 09:24:13.000000000 +0900 | |
93 | ++++ bhyve/bhyverun.h 2021-05-03 13:23:03.037115000 +0900 | |
93 | 94 | @@ -39,6 +39,7 @@ extern int guest_ncpus; |
94 | 95 | extern uint16_t cores, sockets, threads; |
95 | 96 | extern char *guest_uuid_str; |
@@ -99,8 +100,8 @@ diff -uprN bhyve_orig/bhyverun.h bhyve/bhyverun.h | ||
99 | 100 | void *paddr_guest2host(struct vmctx *ctx, uintptr_t addr, size_t len); |
100 | 101 | #ifdef BHYVE_SNAPSHOT |
101 | 102 | diff -uprN bhyve_orig/ps2kbd.c bhyve/ps2kbd.c |
102 | ---- bhyve_orig/ps2kbd.c 2020-12-24 09:12:34.000000000 +0900 | |
103 | -+++ bhyve/ps2kbd.c 2020-12-30 21:24:17.887408000 +0900 | |
103 | +--- bhyve_orig/ps2kbd.c 2021-04-09 09:24:13.000000000 +0900 | |
104 | ++++ bhyve/ps2kbd.c 2021-05-03 13:23:03.037837000 +0900 | |
104 | 105 | @@ -31,6 +31,7 @@ |
105 | 106 | __FBSDID("$FreeBSD$"); |
106 | 107 |