mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] defaultenv: boot/net: Boot initramfs from tftp if present
@ 2015-11-02 11:49 Markus Pargmann
  0 siblings, 0 replies; only message in thread
From: Markus Pargmann @ 2015-11-02 11:49 UTC (permalink / raw)
  To: barebox

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

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
---
 defaultenv/defaultenv-2-base/boot/net | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index ced2fadba212..fb8531ae1fbe 100644
--- a/defaultenv/defaultenv-2-base/boot/net
+++ b/defaultenv/defaultenv-2-base/boot/net
@@ -11,4 +11,11 @@ fi
 
 nfsroot="/home/${global.user}/nfsroot/${global.hostname}"
 bootargs-ip
-global.linux.bootargs.dyn.root="root=/dev/nfs nfsroot=$nfsroot,v3,tcp"
+
+initrd="${path}/${global.user}-initrd-${global.hostname}"
+if [ -f "${initrd}" ]; then
+	global.bootm.initrd="$initrd"
+	global.linux.bootargs.dyn.root="rdinit=/sbin/init"
+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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-02 11:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-02 11:49 [PATCH] defaultenv: boot/net: Boot initramfs from tftp if present Markus Pargmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox