summaryrefslogtreecommitdiffstats
path: root/fs/nfs.c
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2016-09-19 18:03:49 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-22 11:30:38 +0200
commitb6ca0241b0ba2f166f12b9d58c608fb777ec3bd5 (patch)
tree7ed7df1d6fedcf837ae549cb384f3d2ac0078cf6 /fs/nfs.c
parent841d83ff0a30dfdb58ae94f497097b52aecacf67 (diff)
downloadbarebox-b6ca0241b0ba2f166f12b9d58c608fb777ec3bd5.tar.gz
barebox-b6ca0241b0ba2f166f12b9d58c608fb777ec3bd5.tar.xz
fs: nfs: pick up network interface bootargs parameter
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> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/nfs.c')
-rw-r--r--fs/nfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs.c b/fs/nfs.c
index a0a9dfcf79..97f01cfb34 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);