code: purgatorio

Download patch

ref: d7809194db6f52a6fc87a6d10bff7e78cc03c4d2
parent: b5bc6572b0a82c52ab04bcf25e1ed76700deb246
author: henesy <devnull@localhost>
date: Tue Nov 6 19:57:51 EST 2018

rework profile chain to be better

--- a/dis/makestubs
+++ b/dis/makestubs
@@ -3,7 +3,7 @@
 # Opt material courtesy of powerman
 user=`{cat /dev/user}
 home=/usr/$user
-dirs=($home/keyring /tmp /mnt/keys /mnt/registry /mnt/acme /n/remote /chan /keydb)
+dirs=($home/keyring $home/dis $home/module /tmp /mnt/keys /mnt/registry /mnt/acme /n/remote /chan /keydb)
 
 mkdir -p $home
 cp -r /usr/inferno/* $home/
@@ -11,4 +11,3 @@
 for i in $dirs {
 	mkdir -p $i
 }
-
--- a/lib/sh/profile
+++ b/lib/sh/profile
@@ -1,12 +1,20 @@
 # emu sh initialisation here
 load std
 
+user = `{cat /dev/user}
+home = /usr/^$user
+
+bind /locale/US_Central /locale/timezone
+
+# Set up environment
+bind -b '#s' /chan
+
 # Networking
 bind -b '#scs' /net
 mount {mntgen} /n
 
 # Run the user's profile
-if {test -r /usr/inferno/lib/profile} {
-	sh /usr/^`{cat /dev/user}^/lib/profile
-}
-
+cd
+and {ftest -d tmp}		{bind -c tmp /tmp}
+and {ftest -e namespace}	{nsbuild}
+and {ftest -e lib/profile}	{run lib/profile}
--- a/usr/inferno/lib/profile
+++ b/usr/inferno/lib/profile
@@ -2,11 +2,14 @@
 
 memfs
 
+# Set up environment
+bind -b $home/dis /dis
+bind -b $home/module /module
+
 # Networking
 ndb/cs
 ndb/dns
 
 # /opt package setup
-/opt/setup/cmd
-/opt/setup/man
-
+run /opt/setup/cmd
+run /opt/setup/man