mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: barebox@lists.infradead.org
Cc: Brian Lilly <brian@crystalfontz.com>
Subject: [PATCH 1/2] Add support for kernel and device tree images stored in a partition
Date: Mon,  2 Jul 2012 16:14:53 +0200	[thread overview]
Message-ID: <1341238494-30914-1-git-send-email-maxime.ripard@free-electrons.com> (raw)

It is a quite common setup to have a partition with all you need to boot
from the bootloader, ie the kernel image, the device tree blob, etc.

This patch introduces a new "file" location for these two images, which
uses in turn the *_part and the new *_part_type variable specifying the
fs type used by mount.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Brian Lilly <brian@crystalfontz.com>
---
 defaultenv/bin/boot |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/defaultenv/bin/boot b/defaultenv/bin/boot
index 61b893a..26360ed 100644
--- a/defaultenv/bin/boot
+++ b/defaultenv/bin/boot
@@ -114,6 +114,12 @@ elif [ x$kernel_loc = xnand ]; then
 	kdev="/dev/nand0.kernel.bb"
 elif [ x$kernel_loc = xdisk ]; then
 	kdev="/dev/$kernel_part"
+elif [ x$kernel_loc = xfile ]; then
+	if [ ! -d $kernel_part ]; then
+		mkdir $kernel_part
+		mount /dev/$kernel_part $kernel_part_type $kernel_part
+	fi
+	kdev="$kernel_part/$kernelimage"
 else
 	echo "error: set kernel_loc to one of 'tftp', 'nfs', 'nand', 'nor' or 'disk'"
 	exit 1
@@ -128,6 +134,12 @@ elif [ x$oftree_loc = xnand ]; then
 	odev="/dev/nand0.oftree.bb"
 elif [ x$oftree_loc = xdisk ]; then
 	odev="/dev/$oftree_part"
+elif [ x$oftree_loc = xfile ]; then
+	if [ ! -d $oftree_part ]; then
+		mkdir $oftree_loc
+		mount /dev/$oftree_part $oftree_part_type $oftree_part
+	fi
+	odev="$oftree_part/$oftreeimage"
 fi
 
 [ x$odev = x ] || bootm_opt="$bootm_opt -o $odev"
-- 
1.7.9.5


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

             reply	other threads:[~2012-07-02 14:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-02 14:14 Maxime Ripard [this message]
2012-07-02 14:14 ` [PATCH 2/2] Add support for the Crystalfontz CFA-10036 board Maxime Ripard
2012-07-03 18:12   ` Sascha Hauer
2012-07-04 12:28     ` Maxime Ripard
2012-07-02 17:30 ` [PATCH 1/2] Add support for kernel and device tree images stored in a partition Belisko Marek
2012-07-03  7:39 ` Sascha Hauer
2012-07-03 11:18   ` Maxime Ripard

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=1341238494-30914-1-git-send-email-maxime.ripard@free-electrons.com \
    --to=maxime.ripard@free-electrons.com \
    --cc=barebox@lists.infradead.org \
    --cc=brian@crystalfontz.com \
    /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