From: Enrico Jorns <ejo@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Michael Olbrich <m.olbrich@pengutronix.de>,
Gavin Schenk <g.schenk@eckelmann.de>,
Enrico Jorns <ejo@pengutronix.de>,
u.kleine-koenig@pengutronix.de
Subject: [PATCH 2/2] fs: nfs: pick up network interface bootargs parameter
Date: Mon, 19 Sep 2016 18:03:49 +0200 [thread overview]
Message-ID: <1474301029-22877-3-git-send-email-ejo@pengutronix.de> (raw)
In-Reply-To: <1474301029-22877-1-git-send-email-ejo@pengutronix.de>
This adds the linux.bootarg device parameter from the network device of
the current nfs connection and adds it to the nfs bootargs line.
This allows booting from nfs without manually setting a ip=dhcp or
ip=<ipaddr> option.
Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
fs/nfs.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/nfs.c b/fs/nfs.c
index a0a9dfc..97f01cf 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -1314,6 +1314,7 @@ static char *rootnfsopts;
static void nfs_set_rootarg(struct nfs_priv *npriv, struct fs_device_d *fsdev)
{
char *str, *tmp;
+ const char *bootargs;
str = basprintf("root=/dev/nfs nfsroot=%pI4:%s%s%s", &npriv->server, npriv->path,
rootnfsopts[0] ? "," : "", rootnfsopts);
@@ -1331,6 +1332,13 @@ static void nfs_set_rootarg(struct nfs_priv *npriv, struct fs_device_d *fsdev)
str = tmp;
}
+ bootargs = dev_get_param(&npriv->con->edev->dev, "linux.bootargs");
+ if (bootargs) {
+ tmp = basprintf("%s %s", str, bootargs);
+ free(str);
+ str = tmp;
+ }
+
fsdev_set_linux_rootarg(fsdev, str);
free(str);
--
2.8.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2016-09-19 16:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-19 16:03 [PATCH 0/2] Auto-append ip= option for NFS boot with appendrot Enrico Jorns
2016-09-19 16:03 ` [PATCH 1/2] net: add linux.bootarg parameter from ifup call Enrico Jorns
2016-09-21 8:33 ` Sascha Hauer
2016-09-19 16:03 ` Enrico Jorns [this message]
2016-09-19 16:19 ` [PATCH 2/2] fs: nfs: pick up network interface bootargs parameter Uwe Kleine-König
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=1474301029-22877-3-git-send-email-ejo@pengutronix.de \
--to=ejo@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=g.schenk@eckelmann.de \
--cc=m.olbrich@pengutronix.de \
--cc=u.kleine-koenig@pengutronix.de \
/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