boot and namespace cleanup

This commit is contained in:
cinap_lenrek 2011-05-10 09:14:30 +00:00
parent 6063ab829f
commit 2febff5948
7 changed files with 33 additions and 60 deletions

View file

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

View file

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

View file

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

View file

@ -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)$'

View file

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

View file

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

View file

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