shithub: riscv

Download patch

ref: 774529e440cfe570fbaf29e6e5c5c73345aa04a1
parent: 53fbb0515159465421053c3165b1aa9da196aa4d
author: Jacob Moody <moody@posixcafe.org>
date: Fri May 27 22:31:26 EDT 2022

kernel: add /rc to devroot

This makes it much easier to run a rc
program without needing to bind in all of '#s/boot'.

--- a/lib/namespace
+++ b/lib/namespace
@@ -22,6 +22,7 @@
 
 # standard bin
 bind /$cputype/bin /bin
+bind $rootdir'/rc' /rc
 bind -a /rc/bin /bin
 
 # internal networks
--- a/sys/man/3/root
+++ b/sys/man/3/root
@@ -10,6 +10,7 @@
 .B /net
 .B /net.alt
 .B /proc
+.B /rc
 .B /root
 .B /srv
 .fi
--- a/sys/src/9/boot/boot.c
+++ b/sys/src/9/boot/boot.c
@@ -25,6 +25,7 @@
 	buf[1+read(open("/env/cputype", OREAD|OCEXEC), buf+1, sizeof buf - 6)] = '\0';
 	strcat(buf, bin);
 	bind(buf, bin, MAFTER);
+	bind("/root/rc", "/rc", MREPL);
 	bind("/rc/bin", bin, MAFTER);
 
 	exec("/bin/bootrc", argv);
--- a/sys/src/9/port/devroot.c
+++ b/sys/src/9/port/devroot.c
@@ -105,6 +105,7 @@
 	addrootdir("net");
 	addrootdir("net.alt");
 	addrootdir("proc");
+	addrootdir("rc");
 	addrootdir("root");
 	addrootdir("srv");
 	addrootdir("shr");