diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc index ccf4e809b..5fe86ee87 100644 --- a/sys/src/9/boot/bootrc +++ b/sys/src/9/boot/bootrc @@ -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/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 >[2]/dev/cons diff --git a/sys/src/9/port/bootfs.proto b/sys/src/9/port/bootfs.proto index 9b195a2e6..274103264 100644 --- a/sys/src/9/port/bootfs.proto +++ b/sys/src/9/port/bootfs.proto @@ -6,6 +6,7 @@ $cputype kbdfs bind cat + cfs cryptsetup dd disk @@ -22,6 +23,7 @@ $cputype mkdir mntgen mount + mv rc rm sed diff --git a/sys/src/9/port/portmkfile b/sys/src/9/port/portmkfile index 450fc82b6..2f5ab1d54 100644 --- a/sys/src/9/port/portmkfile +++ b/sys/src/9/port/portmkfile @@ -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