diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-10 09:14:30 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-10 09:14:30 +0000 |
commit | 2febff5948ebb7bf7092911b8fe5dc54cb36cc8b (patch) | |
tree | f8e7131ea0de5d1cda6e6b6f2318e7bc9d73e95e | |
parent | 6063ab829f10853df8f38ea75de826501e30907a (diff) | |
download | plan9front-2febff5948ebb7bf7092911b8fe5dc54cb36cc8b.tar.xz |
boot and namespace cleanup
-rwxr-xr-x | lib/namespace | 5 | ||||
-rwxr-xr-x | rc/bin/cpurc | 2 | ||||
-rwxr-xr-x | rc/bin/cpurc.local | 7 | ||||
-rwxr-xr-x | rc/bin/termrc | 11 | ||||
-rwxr-xr-x | rc/bin/usbstart | 12 | ||||
-rw-r--r-- | sys/src/9/boot/bootrc | 51 | ||||
-rw-r--r-- | sys/src/cmd/aux/kbdfs.c | 5 |
7 files changed, 33 insertions, 60 deletions
diff --git a/lib/namespace b/lib/namespace index 81105f7e6..adc8a29c3 100755 --- a/lib/namespace +++ b/lib/namespace @@ -10,11 +10,12 @@ bind -c #e /env bind #p /proc bind -c #s /srv bind -a #¤ /dev -bind -a #S /dev + +# userspace devices +mount -qb /srv/cons /dev # mount points mount -a /srv/slashn /n -mount -b /srv/cons /dev # authentication mount -a /srv/factotum /mnt diff --git a/rc/bin/cpurc b/rc/bin/cpurc index b69c42b76..0436b0530 100755 --- a/rc/bin/cpurc +++ b/rc/bin/cpurc @@ -71,7 +71,7 @@ if(test -e /cfg/$sysname/cpustart) # mode of /proc/*/ctl is inherited across rfork, and sets modes on # other /proc files, such as note, so let listen be killed. -dontkill '^(ipconfig|factotum|mntgen|venti|fossil|cs|dns|reboot)$' +dontkill '^(ipconfig|factotum|mntgen|venti|kfs|cwfs.*|cs|dns|reboot)$' # echo `{date} $sysname >>/sys/log/boot exit '' diff --git a/rc/bin/cpurc.local b/rc/bin/cpurc.local index 1a5a45d3e..318406bf9 100755 --- a/rc/bin/cpurc.local +++ b/rc/bin/cpurc.local @@ -5,10 +5,11 @@ # return addresses, even local ones site=EXAMPLE # replace FILESERVER with the name of your file server -# here we start with kfs, your local disk file system -fileserver=kfs +# here we start with cwfs, your local disk file system +fileserver=cwfs # replace FACEDOM with the local domain to be used in the faces database facedom=FACEDOM -for(i in m i P S t) +for(i in m i P S t u) bind -a '#'^$i /dev >/dev/null >[2=1] +mount -qa /srv/usb /dev diff --git a/rc/bin/termrc b/rc/bin/termrc index 4a652504a..f33df232f 100755 --- a/rc/bin/termrc +++ b/rc/bin/termrc @@ -5,11 +5,13 @@ NDBFILE=/lib/ndb/local mntgen -s slashn && chmod 666 /srv/slashn -# bind all likely devices (#S was bound in boot) -for(i in f t m v L P u U '$' Σ κ) - /bin/bind -a '#'^$i /dev >/dev/null >[2=1] +# bind all likely devices +for(i in S f k t m i v L P u U '$' Σ κ) + bind -a '#'^$i /dev >/dev/null >[2=1] rm -f /env/i +mount -qa /srv/usb /dev + # set up any partitions diskparts @@ -110,8 +112,7 @@ if(! ~ $"vgasize '' text none){ } rm -f '/env/fn#ask' -usbstart if (test -f /dev/apm) aux/apm -dontkill '^(ipconfig|factotum|mntgen|fossil|kfs|cwfs|cs|dns|listen|reboot)$' +dontkill '^(ipconfig|factotum|mntgen|fossil|kfs|cwfs.*|cs|dns|listen|reboot)$' diff --git a/rc/bin/usbstart b/rc/bin/usbstart deleted file mode 100755 index a021e8901..000000000 --- a/rc/bin/usbstart +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/rc -# usbstart - start appropriate usb flavour -if(test -r '#u'/usb) { - if(! test -r /dev/usb) - bind -a '#u' /dev - # /boot/boot may have started usbd, which starts all usb drivers - if(test -f /srv/usb) - mount -a /srv/usb /dev - if not - usb/usbd -} -exit '' diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc index 8a05621c5..3d95f4d74 100644 --- a/sys/src/9/boot/bootrc +++ b/sys/src/9/boot/bootrc @@ -2,39 +2,19 @@ bind -q '#p' /proc -if(test -e '#b' && ! test -e /dev/kbd){ - bind -a '#b' /dev - aux/kbdfs -s cons - exec /rc/bin/bootrc </dev/cons >/dev/cons >[2]/dev/cons +for(i in S f k æ t){ + bind -a '#'^$i /dev >/dev/null >[2=1] } -bind -qa '#S' /dev -bind -qa '#f' /dev -bind -qa '#k' /dev -bind -qa '#æ' /dev - -fn set { - a=$$1 - $1=() - rm -f '#e'/$1 '#ec'/$1 /env/$1 +for(i in init user nvram rootdir bootargs nobootprompt sysname \ + debugfactotum fs fsaddr auth authaddr){ + a=$$i + $i=() + rm -f '#e'/$i '#ec'/$i /env/$i if(! ~ $#a 0) - $1=$a + $i=$a } -# convert plan9.ini variables -set init -set user -set nvram -set rootdir -set bootargs -set nobootprompt -set sysname -set debugfactotum -set fs -set fsaddr -set auth -set authaddr - fn fatal { echo $* exit $"* @@ -138,15 +118,14 @@ fn main{ exec $init } -if(test -e '#u'){ - bind -a '#u' /dev - usb/usbd +if(test -e '#b' && test -x /bin/aux/kbdfs){ + bind -a '#b' /dev + aux/kbdfs -s cons } -if(! ~ $#kbmap 0){ - bind -a '#κ' /dev - if(test -r $"kbmap) - cat $"kbmap >/dev/kbmap +if(test -e '#u' && test -x /bin/usb/usbd){ + bind -a '#u' /dev + usb/usbd } # bind in an ip interface @@ -163,4 +142,4 @@ while(){ nobootprompt=() user=() rm -f /srv/boot /srv/slashn /srv/cs /srv/dns -} +} </dev/cons >/dev/cons >[2]/dev/cons diff --git a/sys/src/cmd/aux/kbdfs.c b/sys/src/cmd/aux/kbdfs.c index f143278f0..32a1b4344 100644 --- a/sys/src/cmd/aux/kbdfs.c +++ b/sys/src/cmd/aux/kbdfs.c @@ -1085,7 +1085,10 @@ elevate(void) } /* get higher than normal priority */ - fprint(fd, "pri 16"); + fprint(fd, "pri 16\n"); + + /* always present in physical memory */ + fprint(fd, "noswap\n"); /* dont let anybody kill us */ if(d = dirfstat(fd)){ |