mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/3] defaultenv/boot: add support for oftree boot option support
Date: Sun,  8 Apr 2012 11:27:20 +0200	[thread overview]
Message-ID: <1333877242-582-1-git-send-email-plagnioj@jcrosoft.com> (raw)

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>
---
 defaultenv/bin/_boot_help |    3 ++-
 defaultenv/bin/boot       |   17 ++++++++++++++++-
 defaultenv/config         |    2 ++
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/defaultenv/bin/_boot_help b/defaultenv/bin/_boot_help
index 7c96444..a07e4e0 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 ba04373..5186aee 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 63fc059..39a9c99 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'
-- 
1.7.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2012-04-08  9:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-08  9:27 Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-04-08  9:27 ` [PATCH 2/3] net: dhcp: add private extention 224 to pass the oftree file via dhcp Jean-Christophe PLAGNIOL-VILLARD
2012-04-08  9:27 ` [PATCH 3/3] defaultenv: add support of oftree file pass via dhcp (option 224) Jean-Christophe PLAGNIOL-VILLARD
2012-04-10  7:55 ` [PATCH 1/3] defaultenv/boot: add support for oftree boot option support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1333877242-582-1-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox