[PATCH] defaultenv: boot/net: Boot initramfs from tftp if present
Markus Pargmann
mpa at pengutronix.de
Mon Nov 2 03:49:01 PST 2015
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 at 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
More information about the barebox
mailing list