boot(8): add cfs support

cinap_lenrek 2011-06-15 14:50:29 +02:00
parent 21ede7960f
commit cde40efb0c
3 changed files with 19 additions and 3 deletions

View File

@ -8,7 +8,7 @@ bind -q '#p' /proc
for(i in S f k æ t)
bind -a '#'^$i /dev >/dev/null >[2=1]
for(i in init sysname user nvram rootdir bootdisk bootargs \
for(i in init sysname user nvram rootdir cfs bootdisk bootargs \
nobootprompt debugfactotum \
fs fsaddr auth authaddr){
a=$$i
@ -93,6 +93,20 @@ fn main{
# connect method
$mp(2) $ma
# insert cfs in the pipeline
if(test -x /bin/cfs){
if(~ $#bootdisk 1 && ~ $#cfs 0)
cfs=$bootdisk/cache
if(~ $#cfs 1 && ! ~ $cfs off && test -f $cfs){
x=(/bin/cfs -s -f $cfs)
if(~ -f $ff)
x=($x -r)
{$x </srv/boot &} | echo 0 >/srv/cfs
rm /srv/boot
mv /srv/cfs /srv/boot
}
}
# mount and change root in new enviroment and namespace
rfork ne
@ -182,5 +196,5 @@ while(){
# cleanup so it can be restarted
nobootprompt=()
user=()
rm -f /srv/boot /srv/slashn /srv/cs /srv/dns
rm -f /srv/cfs /srv/boot /srv/slashn /srv/cs /srv/dns
} </dev/cons >/dev/cons >[2]/dev/cons

View File

@ -6,6 +6,7 @@ $cputype
kbdfs
bind
cat
cfs
cryptsetup
dd
disk
@ -22,6 +23,7 @@ $cputype
mkdir
mntgen
mount
mv
rc
rm
sed

View File

@ -98,7 +98,7 @@ bootfs.paq: ../port/bootfs.proto
disk/mkfs -s / -d bootfs ../port/bootfs.proto
@{
cd bootfs/$objtype/bin
strip * */* >[2]/dev/null || status=''
strip * */* */*/* >[2]/dev/null || status=''
}
mkpaqfs -o $target bootfs
rm -rf bootfs