shithub: riscv

Download patch

ref: fa1d6ffd83a6f9de19632c43c46412c8a41b4cc5
parent: c63cd980a4f9d00360d63f61880e12c677bf4b70
author: kvik <[email protected]>
date: Thu Oct 1 13:47:52 EDT 2020

bootrc: allow kbmap to be set via plan9.ini (thanks Aaron Bieber)

--- a/sys/man/8/plan9.ini
+++ b/sys/man/8/plan9.ini
@@ -571,10 +571,22 @@
 The line
 .B serial=type=com
 can be used to specify settings for a PCMCIA modem.
+.SS \fLkbmap=\fIvalue\fP
+This specifies the keyboard map to use.
+.I Value
+can be a map file found in
+.B /sys/lib/kbmap
+on the ramdisk.
+.PP
+For example:
+.TP
+.B kbmap=colemak
 .SS \fLmouseport=\fIvalue\fP
 This specifies where the mouse is attached.
 .I Value
-can be
+can be a map file found in
+.B /sys/lib/kbmap
+on the ramdisk.
 .TP
 .B ps2
 the PS2 mouse/keyboard port.  The BIOS setup procedure
--- a/sys/src/9/boot/bootfs.proto
+++ b/sys/src/9/boot/bootfs.proto
@@ -58,6 +58,10 @@
 		nusbrc 555 sys sys ../boot/nusbrc
 		bootrc 555 sys sys ../boot/bootrc
 tmp
+sys
+	lib
+		kbmap
+			+
 lib
 	firmware
 		+
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -170,6 +170,13 @@
 	if(! ~ $#a 0)
 		a=/dev/eia^$a
 	aux/kbdfs -q -s cons $a
+
+	if(! ~$#kbmap 0){
+		if(test -f /sys/lib/kbmap/$kbmap){
+			echo 'setting kbmap to' $kbmap
+			cat /sys/lib/kbmap/$kbmap >/dev/kbmap
+		}
+	}
 }
 
 # usb devices