summaryrefslogtreecommitdiff
path: root/sys/src/9/boot
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-03-25 00:11:54 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2015-03-25 00:11:54 +0100
commit0bc9ad781fdc9e4cfcd5fed1560775e241a366fc (patch)
tree01da495abd255c75f0915df9f1f130c1037114f8 /sys/src/9/boot
parent8ab9c6d38864362d3683883f22d7539de742cf56 (diff)
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)
Diffstat (limited to 'sys/src/9/boot')
-rw-r--r--sys/src/9/boot/bootmkfile7
-rwxr-xr-xsys/src/9/boot/bootrc8
2 files changed, 12 insertions, 3 deletions
diff --git a/sys/src/9/boot/bootmkfile b/sys/src/9/boot/bootmkfile
index bf3494c79..af41e3829 100644
--- a/sys/src/9/boot/bootmkfile
+++ b/sys/src/9/boot/bootmkfile
@@ -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
diff --git a/sys/src/9/boot/bootrc b/sys/src/9/boot/bootrc
index ed949ec91..3c229ba90 100755
--- a/sys/src/9/boot/bootrc
+++ b/sys/src/9/boot/bootrc
@@ -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