File 0003-nfsroot-generator-do-not-fail-if-nfsroot-is-not-conf.patch of Package nfs-utils
From 3bdc30be14e8495d2cf2a236812dba22fed9af14 Mon Sep 17 00:00:00 2001
From: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
Date: Mon, 9 Jun 2025 15:21:20 +0200
Subject: [PATCH 3/3] 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.
Signed-off-by: Antonio Alvarez Feijoo <antonio.feijoo@suse.com>
---
systemd/nfsroot-generator.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/systemd/nfsroot-generator.c b/systemd/nfsroot-generator.c
index 52bd0752..f3cb60c3 100644
--- a/systemd/nfsroot-generator.c
+++ b/systemd/nfsroot-generator.c
@@ -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;
}
--
2.43.0