summaryrefslogtreecommitdiffstats
path: root/defaultenv
diff options
context:
space:
mode:
Diffstat (limited to 'defaultenv')
-rw-r--r--defaultenv/bin/_boot_help3
-rw-r--r--defaultenv/bin/boot20
-rw-r--r--defaultenv/bin/init18
-rw-r--r--defaultenv/config2
4 files changed, 34 insertions, 9 deletions
diff --git a/defaultenv/bin/_boot_help b/defaultenv/bin/_boot_help
index 7c964441b8..a07e4e0135 100644
--- a/defaultenv/bin/_boot_help
+++ b/defaultenv/bin/_boot_help
@@ -1,9 +1,10 @@
#!/bin/sh
-echo "boot: boot [-m <mode>] [-k <kernel_option>] [-r <rootfs_option>] [-i <ip_mode>]"
+echo "boot: boot [-m <mode>] [-k <kernel_option>] [-r <rootfs_option>] [-i <ip_mode>] [-o <oftree_option]"
echo ""
echo "options"
echo " - kernel nand, nor, nfs, tftp, disk"
+echo " - oftree nand, nor, nfs, tftp, disk or empty"
echo " - rootfs nand, nor, net, disk"
echo " - ip dhcp, dhcp-barebox none, empty"
echo ""
diff --git a/defaultenv/bin/boot b/defaultenv/bin/boot
index ba04373049..b54ea6b71c 100644
--- a/defaultenv/bin/boot
+++ b/defaultenv/bin/boot
@@ -6,12 +6,14 @@ if [ x$kernel_loc = xnet ]; then
kernel_loc=tftp
fi
-while getopt "hk:r:i:m:" Option
+while getopt "hk:r:i:m:o:" Option
do
if [ ${Option} = k ]; then
kernel_loc=${OPTARG}
elif [ ${Option} = r ]; then
rootfs_loc=${OPTARG}
+elif [ ${Option} = o ]; then
+ oftree_loc=${OPTARG}
elif [ ${Option} = i ]; then
ip=${OPTARG}
elif [ ${Option} = m ]; then
@@ -48,6 +50,9 @@ if [ x$ip = xdhcp -o x$ip = "xdhcp-barebox" ]; then
if [ x$bootfile != x ]; then
kernelimage=$bootfile
fi
+ if [ x$dhcp_oftree_file != x ]; then
+ oftreeimage=$dhcp_oftree_file
+ fi
fi
fi
@@ -114,6 +119,19 @@ else
exit 1
fi
+if [ x$oftree_loc = xnfs -o x$oftree_loc = xtftp ]; then
+ odev=/oftree
+ $oftree_loc $oftreeimage $odev || exit 1
+elif [ x$oftree_loc = xnor ]; then
+ odev="/dev/nor0.oftree"
+elif [ x$oftree_loc = xnand ]; then
+ odev="/dev/nand0.oftree.bb"
+elif [ x$oftree_loc = xdisk ]; then
+ odev="/dev/$oftree_part"
+fi
+
+[ x$odev = x ] || bootm_opt="$bootm_opt -o $odev"
+
echo "booting kernel from $kdev"
bootm $bootm_opt $kdev
diff --git a/defaultenv/bin/init b/defaultenv/bin/init
index b371c423a9..7452bb6a7a 100644
--- a/defaultenv/bin/init
+++ b/defaultenv/bin/init
@@ -24,11 +24,15 @@ if [ -f /env/bin/init_board ]; then
. /env/bin/init_board
fi
-echo
-echo -n "Hit any key to stop autoboot: "
-timeout -a $autoboot_timeout
-if [ $? != 0 ]; then
- exit
+if [ -f /env/bin/boot_board ]; then
+ . /env/bin/boot_board
+else
+ echo
+ echo -n "Hit any key to stop autoboot: "
+ timeout -a $autoboot_timeout
+ if [ $? != 0 ]; then
+ exit
+ fi
+
+ boot
fi
-
-boot
diff --git a/defaultenv/config b/defaultenv/config
index 63fc059639..39a9c99868 100644
--- a/defaultenv/config
+++ b/defaultenv/config
@@ -21,6 +21,8 @@ dhcp_vendor_id=barebox
kernel_loc=tftp
# can be either 'net', 'nand', 'nor', 'disk' or 'initrd'
rootfs_loc=net
+# can be either 'tftp', 'nfs', 'nand', 'nor', 'disk' or none
+oftree_loc=tftp
# for flash based rootfs: 'jffs2' or 'ubifs'
# in case of disk any regular filesystem like 'ext2', 'ext3', 'reiserfs'