boot(8): strip bootfs

This commit is contained in:
cinap_lenrek 2011-06-04 07:18:11 +00:00
parent 792b186b3a
commit f55d5517ed
3 changed files with 8 additions and 18 deletions

View file

@ -55,12 +55,12 @@ boot(int argc, char *argv[])
setenv("bootdisk", bootdisk, 0);
/* setup the boot namespace */
run("/boot/paqfs", "-m" "/root", "/boot/bootfs.paq", nil);
bind("/boot", "/bin", MAFTER);
run("/bin/paqfs", "-q", "-c", "8", "-m" "/root", "/boot/bootfs.paq", nil);
bind("/root", "/", MAFTER);
snprint(buf, sizeof(buf), "/%s/bin", cputype);
bind(buf, "/bin", MAFTER);
bind("/rc/bin", "/bin", MAFTER);
bind("/boot", "/bin", MAFTER);
switch(pid = rfork(RFFDG|RFREND|RFPROC)){
case -1:

View file

@ -4,13 +4,9 @@ mntgen -s slash /mnt
bind /root /mnt/broot
unmount /root
ramfs
bind -q '#p' /proc
for(i in S f k æ t){
for(i in S f k æ t)
bind -a '#'^$i /dev >/dev/null >[2=1]
}
for(i in init user nvram rootdir bootargs nobootprompt sysname \
debugfactotum fs fsaddr auth authaddr){
@ -64,9 +60,10 @@ fn main{
if not bootargs=$nobootprompt
mn=`{echo $bootargs | awk -F! '{print $1}'}
ma=`{echo $bootargs | sed 's/[^!]*!?//'}
for(i in `{seq 1 $#mt}){
if(~ $mt($i) m$"mn)
mp=$$mt($i)
switch(m$"mn){
case $mt
mp=m$mn
mp=$$mp
}
}
@ -105,7 +102,6 @@ fn main{
# remove part of our temporary root
/mnt/broot/$cputype/bin/unmount /$cputype/bin /bin
/mnt/broot/$cputype/bin/unmount /rc/bin /bin
/mnt/broot/$cputype/bin/unmount /tmp
/mnt/broot/$cputype/bin/unmount /
# create the name space, mount the root fs
@ -139,14 +135,13 @@ if(test -e '#u' && test -x /bin/usb/usbd){
}
# bind in an ip interface
for(i in I l`{seq 0 3})
for(i in I l^(0 1 2 3))
bind -qa '#'$i /net
configlocal # add partitions and binds
while(){
@{main}
sleep 1
# cleanup so it can be restarted
nobootprompt=()

View file

@ -16,21 +16,16 @@ $cputype
echo
cwfs64x
grep
gunzip
hoc
ip
ipconfig
ls
mkdir
mntgen
mount
ramfs
rc
read
rm
sed
seq
sleep
srv
test
unmount