boot: allow alternative proto files per kernel and kernel config for bootfs.paq

bootmkfile will now looks for the following proto files in order
and pick the first one it finds to build the bootfs.paq file:

1)	$CONF.boofs.proto		(config specific)
2)	bootfs.proto			(kernel specific)
3)	$BOOTDIR/bootfs.proto	(default generic)
This commit is contained in:
cinap_lenrek 2015-03-25 00:11:54 +01:00
parent 8ab9c6d388
commit 0bc9ad781f
2 changed files with 12 additions and 3 deletions

View file

@ -13,7 +13,12 @@ $BOOTFILES: $BOOTDIR/boot.h
boot: $BOOTFILES
$LD -o $target $BOOTFILES
BOOTFSPROTO=$BOOTDIR/bootfs.proto
# look for proto file in order:
# 1) $CONF.bootfs.proto (config specific)
# 2) bootfs.proto (kernel specific)
# 3) $BOOTDIR/bootfs.proto (default generic)
#
BOOTFSPROTO=`{for(i in $CONF.bootfs.proto bootfs.proto $BOOTDIR/bootfs.proto) test -r $i && echo $i && exit}
bootfs.paq: $BOOTFSPROTO `{disk/mkfs -aos / $BOOTFSPROTO >[2]/dev/null}
mkdir -p bootfs

View file

@ -180,8 +180,12 @@ if(~ $#usbwait 1)
if(~ $#usbwait 0)
sleep 2
. /rc/lib/net.rc
. /rc/lib/local.rc
# load boot methods
fn showlocaldevs {}
fn configlocal {}
for(i in /rc/lib/*.rc){
. $i
}
# add partitions and binds
configlocal