diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-04-08 11:27:20 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-04-10 09:54:43 +0200 |
commit | cc6fba79e65c783daf0c5185b130fd497612bcf0 (patch) | |
tree | 004f831aa4996786af322f222e16425dc569c03f /defaultenv | |
parent | bae503688115a0f20c70a5cca9e79ddaac2b07ed (diff) | |
download | barebox-cc6fba79e65c783daf0c5185b130fd497612bcf0.tar.gz |
defaultenv/boot: add support for oftree boot option support
you can now specify in the same way as it's done for the kernel where is
stored the oftree.
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv')
-rw-r--r-- | defaultenv/bin/_boot_help | 3 | ||||
-rw-r--r-- | defaultenv/bin/boot | 17 | ||||
-rw-r--r-- | defaultenv/config | 2 |
3 files changed, 20 insertions, 2 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..5186aeecca 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 @@ -114,6 +116,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/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' |