From: Łukasz Stelmach Date: Tue, 23 Jan 2024 14:03:21 +0000 (+0100) Subject: Ignore network devices used by NBD X-Git-Tag: accepted/tizen/unified/20240411.142644~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a229082fa750b28e7fdabd662bf33fb609fbcfd4;p=platform%2Fupstream%2Fconnman.git Ignore network devices used by NBD 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. Change-Id: Ic30ca3110553c0646c3edb2d87a1ea8e8917b370 Signed-off-by: Łukasz Stelmach Forwarded: https://lore.kernel.org/connman/20240308143630.2195695-1-l.stelmach@samsung.com/ --- diff --git a/src/inet.c b/src/inet.c index 81668f8..b1c55b8 100644 --- a/src/inet.c +++ b/src/inet.c @@ -3509,6 +3509,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) @@ -3518,6 +3522,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)