ref: c52a4ed4ccdd9789b188042788c75c8795f9789b
parent: 9a8ff381fa378b03b88d6e63fd61f6aae4215029
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Sat Jun 4 03:18:11 EDT 2011
boot(8): strip bootfs
--- a/sys/src/9/boot/boot.c
+++ b/sys/src/9/boot/boot.c
@@ -55,12 +55,12 @@
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:
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -4,13 +4,9 @@
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 @@
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 @@
# 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,7 +135,7 @@
}
# 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
@@ -146,7 +142,6 @@
while(){ @{main}- sleep 1
# cleanup so it can be restarted
nobootprompt=()
--- a/sys/src/9/port/bootfs.proto
+++ b/sys/src/9/port/bootfs.proto
@@ -16,8 +16,6 @@
echo
cwfs64x
grep
- gunzip
- hoc
ip
ipconfig
ls
@@ -24,13 +22,10 @@
mkdir
mntgen
mount
- ramfs
rc
read
rm
sed
- seq
- sleep
srv
test
unmount
--
⑨