[PATCH] Ignore network devices used by NBD

Łukasz Stelmach <[email protected]>
Newsgroups dev.linux.lists.connman
Organization Samsung R&D Institute Poland
Message-ID <[email protected]>
Add support for ignoring devices used by NBD to mount root the same way
ConnMan ignores devices used for NFS roots. nbdroot= nbddev= parameters
are used by Debian and Tizen initramfs scripts to configure NBD for
mounting as root device.

Signed-off-by: Łukasz Stelmach <[email protected]>
---
 src/inet.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/inet.c b/src/inet.c
index 8a1e3423..5032cf25 100644
--- a/src/inet.c
+++ b/src/inet.c
@@ -5086,6 +5086,10 @@ static int get_nfs_server_ip(const char *cmdline_file, const char *pnp_file,
 	for (pp = args; *pp; pp++) {
 		if (!strcmp(*pp, "root=/dev/nfs"))
 			break;
+		if (!strncmp(*pp, "root=/dev/nbd", strlen("root=/dev/nbd")))
+			break;
+		if (!strncmp(*pp, "nbddev=", strlen("nbddev=")))
+			break;
 	}
 	/* no rootnfs found */
 	if (!*pp)
@@ -5095,6 +5099,8 @@ static int get_nfs_server_ip(const char *cmdline_file, const char *pnp_file,
 	for (pp = args; *pp; pp++) {
 		if (!strncmp(*pp, "nfsroot=", strlen("nfsroot=")))
 			break;
+		if (!strncmp(*pp, "nbdroot=", strlen("nbdroot=")))
+			break;
 	}
 	/* no nfsroot argument found */
 	if (!*pp)
-- 
2.39.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.