provide /n and /mnt early in bootrc to allow consistent use in /lib/namespace

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.
This commit is contained in:
cinap_lenrek 2016-02-14 01:42:32 +01:00
parent 24150b1171
commit ecebba779f
6 changed files with 18 additions and 10 deletions

View 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

View file

@ -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

View file

@ -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

View file

@ -10,6 +10,7 @@ $objtype
bind
cat
cfs
chmod
cryptsetup
dd
disk

View file

@ -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

View file

@ -101,6 +101,7 @@ rootreset(void)
addrootdir("env");
addrootdir("fd");
addrootdir("mnt");
addrootdir("n");
addrootdir("net");
addrootdir("net.alt");
addrootdir("proc");