]> git.lizzy.rs Git - plan9front.git/commitdiff
provide /n and /mnt early in bootrc to allow consistent use in /lib/namespace
authorcinap_lenrek <cinap_lenrek@felloff.net>
Sun, 14 Feb 2016 00:42:32 +0000 (01:42 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Sun, 14 Feb 2016 00:42:32 +0000 (01:42 +0100)
theres a bootstrap problem:

when /bin/init is run, it processes /lib/namespace where we might want to
mount or bind resources to /n or /mnt. but mntgen was run later in
cpurc/termrc so these mounts would be ignored.

we already have mntgen in bootfs, so we can provide these mountpoints early.

i keep the termrc/cpurc mntgens where they are, but ignore the error
prints. this way old kernels will continue to work.

lib/namespace
rc/bin/cpurc
rc/bin/termrc
sys/src/9/boot/bootfs.proto
sys/src/9/boot/bootrc
sys/src/9/port/devroot.c

index 31e74bcfe8deafb69ca2e53df5941ea24bfdadb6..f98f62a2aa20026733208d706533ae8dea1b7b53 100644 (file)
@@ -31,8 +31,8 @@ mount -a /srv/cs /net
 mount -a /srv/dns /net
 mount -a /srv/net /net
 
-mount -qC /srv/boot /n/other other
-bind -qc /n/other/usr/$user/tmp /usr/$user/tmp
+mount -C /srv/boot /n/other other
+bind -c /n/other/usr/$user/tmp /usr/$user/tmp
 
 bind -c /usr/$user/tmp /tmp
 cd /usr/$user
index d20cf07e181b47508ed982eca25d199ee18d79bc..38d6745fbe99e3a28bca58eed3b0d70d62f5da5c 100755 (executable)
@@ -8,10 +8,11 @@ for(i in m i P S t u '$')
 
 mount -qb /srv/cons /dev
 
-# mount points
-mntgen -s slashn && chmod 666 /srv/slashn
+# mount points (if not done by bootrc already)
+>[2]/dev/null {
+mntgen -s slashn /n && chmod 666 /srv/slashn
 mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
-mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport
+mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport}
 
 # move factotum from /mnt to /mnt/factotum
 mount /srv/factotum /mnt/temp
index cd40ec7a6794b415fa4ebb1e6ae5f02974e77c32..74b3566dd73f1c14c77f14525518d9dee73636ab 100755 (executable)
@@ -9,10 +9,11 @@ rm -f /env/i
 
 mount -qb /srv/cons /dev
 
-# mount points 
-mntgen -s slashn && chmod 666 /srv/slashn
+# mount points (if not done by bootrc already)
+>[2]/dev/null {
+mntgen -s slashn /n && chmod 666 /srv/slashn
 mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
-mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport
+mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport}
 
 # move factotum from /mnt to /mnt/factotum
 mount /srv/factotum /mnt/temp
index 02ca929793f3fe7eaa79248cb65a8c9655b8ce87..6b1366b37d40f62ec0697e30ce86426faea32a7a 100644 (file)
@@ -10,6 +10,7 @@ $objtype
                bind
                cat
                cfs
+               chmod
                cryptsetup
                dd
                disk
index 09cbd4b7949b2d15d74ceea8fb943800a959f2c3..b8c96cc171c9227c8943270e75395b67f2af3013 100755 (executable)
@@ -1,6 +1,10 @@
 #!/bin/rc
 
-mntgen -s slash /mnt
+# mount points
+mntgen -s slashn /n && chmod 666 /srv/slashn
+mntgen -s slashmnt /mnt && chmod 666 /srv/slashmnt
+mntgen -s mntexport /mnt/exportfs && chmod 666 /srv/mntexport
+
 bind /root /mnt/broot
 unmount /root
 
@@ -229,5 +233,5 @@ while(){
 
        # cleanup so it can be restarted
        nobootprompt=()
-       rm -f /srv/^(cfs boot slashn cs dns)
+       rm -f /srv/^(cfs boot cs dns)
 } </dev/cons
index 33843250570810818ed37037138aa6700036c417..d125cd368b7d3e200af19bcde9b9b3ad64d26805 100644 (file)
@@ -101,6 +101,7 @@ rootreset(void)
        addrootdir("env");
        addrootdir("fd");
        addrootdir("mnt");
+       addrootdir("n");
        addrootdir("net");
        addrootdir("net.alt");
        addrootdir("proc");