9front - general discussion about 9front
 help / color / mirror / Atom feed
* Add the ability to set kbmap=value via plan9.ini
@ 2020-09-29 22:26 Aaron Bieber
  2020-09-30  6:33 ` [9front] " cinap_lenrek
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Bieber @ 2020-09-29 22:26 UTC (permalink / raw)
  To: 9front

Hi,

This lets one specify they desired kbmap via plan9.ini. Makes typing
boot parameters much easier!

Cheers,
Aaron

diff -r 484d3f8e5978 sys/man/8/plan9.ini
--- a/sys/man/8/plan9.ini	Tue Sep 29 07:28:47 2020 -0700
+++ b/sys/man/8/plan9.ini	Tue Sep 29 18:17:18 2020 -0600
@@ -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
diff -r 484d3f8e5978 sys/src/9/boot/bootfs.proto
--- a/sys/src/9/boot/bootfs.proto	Tue Sep 29 07:28:47 2020 -0700
+++ b/sys/src/9/boot/bootfs.proto	Tue Sep 29 18:17:18 2020 -0600
@@ -58,6 +58,10 @@
 		nusbrc 555 sys sys ../boot/nusbrc
 		bootrc 555 sys sys ../boot/bootrc
 tmp
+sys
+	lib
+		kbmap
+			+
 lib
 	firmware
 		+
diff -r 484d3f8e5978 sys/src/9/boot/bootrc
--- a/sys/src/9/boot/bootrc	Tue Sep 29 07:28:47 2020 -0700
+++ b/sys/src/9/boot/bootrc	Tue Sep 29 18:17:18 2020 -0600
@@ -67,6 +67,12 @@
 fn main{
 	mp=()
 	while(~ $#mp 0){
+		if(! ~$#kbmap 0){
+			if(test -f /sys/lib/kbmap/$kbmap){
+				echo 'setting kbmap to' $kbmap
+				cat /sys/lib/kbmap/$kbmap >/dev/kbmap
+			}
+		}
 		if(~ $#nobootprompt 0){
 			echo
 			showlocaldevs



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] Add the ability to set kbmap=value via plan9.ini
  2020-09-29 22:26 Add the ability to set kbmap=value via plan9.ini Aaron Bieber
@ 2020-09-30  6:33 ` cinap_lenrek
  2020-09-30 13:03   ` Aaron Bieber
  0 siblings, 1 reply; 3+ messages in thread
From: cinap_lenrek @ 2020-09-30  6:33 UTC (permalink / raw)
  To: 9front

the idea is too bad, its just that this code as no place
in that while loop. just run it after starting kbdfs
(before main is called).

--
cinap


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] Add the ability to set kbmap=value via plan9.ini
  2020-09-30  6:33 ` [9front] " cinap_lenrek
@ 2020-09-30 13:03   ` Aaron Bieber
  0 siblings, 0 replies; 3+ messages in thread
From: Aaron Bieber @ 2020-09-30 13:03 UTC (permalink / raw)
  To: 9front


cinap_lenrek@felloff.net writes:

> the idea is too bad, its just that this code as no place
> in that while loop. just run it after starting kbdfs
> (before main is called).

Here is the diff with it moved to after kbdfs is started:

diff -r 484d3f8e5978 sys/man/8/plan9.ini
--- a/sys/man/8/plan9.ini	Tue Sep 29 07:28:47 2020 -0700
+++ b/sys/man/8/plan9.ini	Wed Sep 30 12:56:45 2020 -0600
@@ -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
diff -r 484d3f8e5978 sys/src/9/boot/bootfs.proto
--- a/sys/src/9/boot/bootfs.proto	Tue Sep 29 07:28:47 2020 -0700
+++ b/sys/src/9/boot/bootfs.proto	Wed Sep 30 12:56:45 2020 -0600
@@ -58,6 +58,10 @@
 		nusbrc 555 sys sys ../boot/nusbrc
 		bootrc 555 sys sys ../boot/bootrc
 tmp
+sys
+	lib
+		kbmap
+			+
 lib
 	firmware
 		+
diff -r 484d3f8e5978 sys/src/9/boot/bootrc
--- a/sys/src/9/boot/bootrc	Tue Sep 29 07:28:47 2020 -0700
+++ b/sys/src/9/boot/bootrc	Wed Sep 30 12:56:45 2020 -0600
@@ -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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-30 13:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 22:26 Add the ability to set kbmap=value via plan9.ini Aaron Bieber
2020-09-30  6:33 ` [9front] " cinap_lenrek
2020-09-30 13:03   ` Aaron Bieber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).