mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH v2] defaultenv: boot/net: Boot initramfs from tftp if present
Date: Wed, 11 Nov 2015 11:13:42 +0100	[thread overview]
Message-ID: <1447236822-13102-1-git-send-email-mpa@pengutronix.de> (raw)

Use an 'initramfs' file if it exists instead of nfsroot. This offers the
possibility to quickly boot complete filesystems as initramfs without
the need to flash an SD-card or similar. If the initramfs does not
exist, it uses the default nfsroot mechanism.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---

Changes in v2:
- Changed variable name to 'initramfs' to make clear that this is intended to
  be used for initramfs. initrd is possible but requires additional linux
  bootargs
- Removed the hardcoded 'rdinit' bootarg

 defaultenv/defaultenv-2-base/boot/net | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index ced2fadba212..af096410b7b2 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -11,4 +11,10 @@ fi
 
 nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
 bootargs-ip
-global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
+
+initramfs="${path}/${global.user}-initramfs-${global.hostname}"
+if [ -f "${initramfs}" ]; then
+	global.bootm.initrd="$initramfs"
+else
+	global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
+fi
-- 
2.6.1


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

             reply	other threads:[~2015-11-11 10:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-11 10:13 Markus Pargmann [this message]
2015-12-01  8:27 ` 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=1447236822-13102-1-git-send-email-mpa@pengutronix.de \
    --to=mpa@pengutronix.de \
    --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