From f55d5517ed35c21b26c3e5eb0211f9a02f341ee1 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 4 Jun 2011 07:18:11 +0000 Subject: [PATCH] boot(8): strip bootfs --- sys/src/9/boot/boot.c | 4 ++-- sys/src/9/boot/bootrc | 17 ++++++----------- sys/src/9/port/bootfs.proto | 5 ----- 3 files changed, 8 insertions(+), 18 deletions(-) diff --git a/sys/src/9/boot/boot.c b/sys/src/9/boot/boot.c index 420831b4a..496dbd665 100644 --- a/sys/src/9/boot/boot.c +++ b/sys/src/9/boot/boot.c @@ -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: diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc index 697eb961e..f8f238df8 100644 --- a/sys/src/9/boot/bootrc +++ b/sys/src/9/boot/bootrc @@ -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=() diff --git a/sys/src/9/port/bootfs.proto b/sys/src/9/port/bootfs.proto index 635e4c420..696e85498 100644 --- a/sys/src/9/port/bootfs.proto +++ b/sys/src/9/port/bootfs.proto @@ -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