]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/boot/bootrc
serial console stuff
[plan9front.git] / sys / src / 9 / boot / bootrc
index 9d102c5664e834a37d79de21092dda3bc68f4131..ef699ab9dfb2e64486a787182d689f8bc0e85798 100644 (file)
@@ -5,15 +5,19 @@ bind /root /mnt/broot
 unmount /root
 
 bind -q '#p' /proc
-for(i in S f k æ t m)
-       bind -a '#'^$i /dev >/dev/null >[2=1]
+for(i in S f k æ t m)
+       bind -qa '#'^$i /dev
 
-# make variables settable by copying them from #ec
+# bind in an ip interface
+for(i in I l^(0 1 2 3))
+       bind -qa '#'$i /net
+
+# reparse #ec variables, move to #e
 for(i in init service sysname user nvram rootdir cfs bootdisk bootargs \
-       nobootprompt debugfactotum fs fsaddr auth authaddr){
-       a=$$i
+       nobootprompt debugfactotum fs fsaddr auth authaddr console){
+       a=`{echo $$i}
        $i=()
-       rm -f '#e'/$i '#ec'/$i /env/$i
+       rm -f '#e'/$i '#ec'/$i
        if(! ~ $#a 0)
                $i=$a
 }
@@ -56,7 +60,7 @@ fn main{
                if(~ $#nobootprompt 0){
                        echo
                        showlocaldevs
-                       ask bootargs ' is (tcp, local!device)' $bootargs
+                       ask bootargs ' is (tcp, local!device)' $"bootargs
                }
                if not bootargs=$nobootprompt
                nobootprompt=()
@@ -144,19 +148,17 @@ fn main{
        exec $init
 }
 
-if(test -e '#b' && test -x /bin/aux/kbdfs){
-       bind -a '#b' /dev
+# keyboard and serial console
+if(test -x /bin/aux/kbdfs){
        a=$console(1)
        if(! ~ $#a 0)
                a=/dev/eia^$a
        aux/kbdfs -s cons $a
 }
 
+# usb devices
 nusbrc
 
-# bind in an ip interface
-for(i in I l^(0 1 2 3))
-       bind -qa '#'$i /net
 # add partitions and binds
 configlocal
 
@@ -202,5 +204,5 @@ while(){
        # cleanup so it can be restarted
        nobootprompt=()
        user=()
-       rm -f /srv/cfs /srv/boot /srv/slashn /srv/cs /srv/dns
+       rm -f /srv/^(cfs boot slashn cs dns)
 } </dev/cons >/dev/cons >[2]/dev/cons