From 9fe925eaa51f7b75fcc36c6a1072af67fccde719 Mon Sep 17 00:00:00 2001 From: Jacob Moody Date: Sat, 28 May 2022 02:31:26 +0000 Subject: [PATCH] kernel: add /rc to devroot This makes it much easier to run a rc program without needing to bind in all of '#s/boot'. --- lib/namespace | 1 + sys/man/3/root | 1 + sys/src/9/boot/boot.c | 1 + sys/src/9/port/devroot.c | 1 + 4 files changed, 4 insertions(+) diff --git a/lib/namespace b/lib/namespace index 105e34be8..a02d45402 100644 --- a/lib/namespace +++ b/lib/namespace @@ -22,6 +22,7 @@ mount -a /srv/mntexport /mnt/exportfs # standard bin bind /$cputype/bin /bin +bind $rootdir'/rc' /rc bind -a /rc/bin /bin # internal networks diff --git a/sys/man/3/root b/sys/man/3/root index 431ace960..4da16216f 100644 --- a/sys/man/3/root +++ b/sys/man/3/root @@ -10,6 +10,7 @@ root \- the root file system .B /net .B /net.alt .B /proc +.B /rc .B /root .B /srv .fi diff --git a/sys/src/9/boot/boot.c b/sys/src/9/boot/boot.c index 51daee7a0..1aaae6542 100644 --- a/sys/src/9/boot/boot.c +++ b/sys/src/9/boot/boot.c @@ -25,6 +25,7 @@ main(int, char *argv[]) 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); diff --git a/sys/src/9/port/devroot.c b/sys/src/9/port/devroot.c index d125cd368..2ddd7f5f8 100644 --- a/sys/src/9/port/devroot.c +++ b/sys/src/9/port/devroot.c @@ -105,6 +105,7 @@ rootreset(void) addrootdir("net"); addrootdir("net.alt"); addrootdir("proc"); + addrootdir("rc"); addrootdir("root"); addrootdir("srv"); addrootdir("shr");