summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2015-11-11 11:13:42 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-12-01 09:27:08 +0100
commit2803b258e6679e9d0079ec0699375c8998dc5d1a (patch)
tree01a80030a8383ffd889d2f80c34fcd3954c7c52b
parenteda34533313f0c3978ed4a65c15424d46826c5d9 (diff)
downloadbarebox-2803b258e6679e9d0079ec0699375c8998dc5d1a.tar.gz
defaultenv: boot/net: Boot initramfs from tftp if present
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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--defaultenv/defaultenv-2-base/boot/net8
1 files changed, 7 insertions, 1 deletions
diff --git a/defaultenv/defaultenv-2-base/boot/net b/defaultenv/defaultenv-2-base/boot/net
index ced2fad..af09641 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