Re: [PATCH 2/2] fs: nfs: pick up network interface bootargs parameter

2016-09-19 Thread Uwe Kleine-König
On Mon, Sep 19, 2016 at 06:03:49PM +0200, Enrico Jorns wrote:
> This adds the linux.bootarg device parameter from the network device of
s/bootarg/bootargs/

> the current nfs connection and adds it to the nfs bootargs line.

s/and adds it//

> This allows booting from nfs without manually setting a ip=dhcp or
> ip= option.

Otherwise: \o/
(i.e.: Acked-by: Uwe Kleine-König  for
both patches)

Best regards
Uwe

-- 
Pengutronix e.K.   | Uwe Kleine-König|
Industrial Linux Solutions | http://www.pengutronix.de/  |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 2/2] fs: nfs: pick up network interface bootargs parameter

2016-09-19 Thread Enrico Jorns
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= option.

Signed-off-by: Enrico Jorns 
---
 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