shithub: riscv

Download patch

ref: 4bc5793a2c0a02ad85b853904603c896c3c77fb5
parent: f9a61a0813fa1eb4ca026373f9b421cc3aeae040
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat Oct 14 13:12:05 EDT 2023

cpurc, termrc, bootrc: organize default device binds

reorganise device binds for bootrc, cpurc and termrc.

make parallel port, audio, i2c and pci available in
cpurc/termrc console namespace.

remove redundant binds (which are handled by other
scripts).

detailed list:

¤ ¶:
cap and swap need to be bound only in bootrc.
for cpurc/termrc, it is bound from /lib/namespace.

P:
devarch, always good to have.

S f æ:
sd, floppy, aoe are always good to have in the console
namespace. regardless if its a cpu or terminal.
also bound in bootrc for obvious reasons.

note that #k is bound by diskparts script.

t:
uart; we always need it.

b m:
keyboard and mouse only needed in bootrc
for kbdfs and nusb/kb hid devices.

for cpurc/termrc, keyboard is provided by /srv/cons,
and mouse is bound by screenrc.

u:
usb stack, never needs to be bound manually as this
is handled by nusbrc.

v i:
vga and devdraw not needed to be bound here,
handled by screenrc.

L A J $:
parallel port, audio, i2c and pci are good to have in
cpurc/termrc console namespace for trouble shooting
and custom per site / machine rc scripts.

--- a/rc/bin/cpurc
+++ b/rc/bin/cpurc
@@ -5,8 +5,8 @@
 NPROC=`{wc -l </dev/sysstat}
 
 # bind all likely devices
-for(i in u t S P '$')
-	bind -a '#'^$i /dev >/dev/null >[2=1]
+for(i in P S f æ t L A J '$')
+	bind -qa '#'^$i /dev
 rm -f /env/i
 
 mount -qb /srv/cons /dev
--- a/rc/bin/termrc
+++ b/rc/bin/termrc
@@ -6,8 +6,8 @@
 NPROC=`{wc -l </dev/sysstat}
 
 # bind all likely devices
-for(i in u v t m i f S P L A '$')
-	bind -a '#'^$i /dev >/dev/null >[2=1]
+for(i in P S f æ t L A J '$')
+	bind -qa '#'^$i /dev
 rm -f /env/i
 
 mount -qb /srv/cons /dev
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -8,6 +8,7 @@
 bind /root /mnt/broot
 unmount /root
 
+# bind in devices
 for(i in ¤ ¶ P S f æ t b m)
 	bind -qa '#'^$i /dev