Skip to contentSkip to conversation

nfsroot-generator: do not fail if nfsroot is not configured

PATCH In review Antonio Alvarez Feijoo 2 participants 2 messages Jun 9, 2025 – Jun 24, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsroot-generator: do not fail if nfsroot is not configured

If the user configures an alternative way to boot the system, the nfsroot-generator should not fail. In other words, the presence of the nfsroot-generator in the initrd does not imply that nfsroot must be mandatory.

---
 systemd/nfsroot-generator.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
systemd/nfsroot-generator.c +2 -2
index 52bd0752..f3cb60c3 100644
@@ -78,10 +78,10 @@ static int get_nfsroot_info_from_cmdline(struct nfsroot_info *info)
 		/* Mount type: "nfs" or "nfs4" */
 		colon = strchr(root, ':');
 		if (colon == NULL)
-			return EINVAL;
+			return 0;
 		if (strncmp(root, "nfs:", strlen("nfs:")) &&
 			strncmp(root, "nfs4:", strlen("nfs4:")))
-			return EINVAL;
+			return 0;
 
 		nfsroot = colon + 1;
 	}
Signature · 1 line
2.43.0
#1 lore raw
Quoted 6 lines · Antonio Alvarez Feijoo

If the user configures an alternative way to boot the system, the nfsroot-generator should not fail. In other words, the presence of the nfsroot-generator in the initrd does not imply that nfsroot must be mandatory.

Committed...

steved.

Quoted 21 lines
---
  systemd/nfsroot-generator.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
systemd/nfsroot-generator.c +2 -2
index 52bd0752..f3cb60c3 100644
@@ -78,10 +78,10 @@ static int get_nfsroot_info_from_cmdline(struct nfsroot_info *info)
  		/* Mount type: "nfs" or "nfs4" */
  		colon = strchr(root, ':');
  		if (colon == NULL)
-			return EINVAL;
+			return 0;
  		if (strncmp(root, "nfs:", strlen("nfs:")) &&
  			strncmp(root, "nfs4:", strlen("nfs4:")))
-			return EINVAL;
+			return 0;
 
  		nfsroot = colon + 1;
  	}