[PATCH] defaultenv: boot/net: Boot initramfs from tftp if present

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux