From: Daan De Meyer Date: Fri, 22 Sep 2023 11:47:14 +0000 (+0200) Subject: repart: Don't fail on boot if we can't find the root block device X-Git-Tag: v255-rc1~456 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=021b0ff4050dd3bbb55ebc8f4a8a97cc5c03e258;p=thirdparty%2Fsystemd.git repart: Don't fail on boot if we can't find the root block device When booting from virtiofs, we won't be able to find a root block device. Let's gracefully handle this similar to how we don't fail if we can't find a GPT partition table. --- diff --git a/src/partition/repart.c b/src/partition/repart.c index 6cadc5f6683..2cc4881ada2 100644 --- a/src/partition/repart.c +++ b/src/partition/repart.c @@ -7344,6 +7344,9 @@ static int run(int argc, char *argv[]) { return r; r = find_root(context); + if (r == -ENODEV) + return 76; /* Special return value which means "Root block device not found, so not doing + * anything". This isn't really an error when called at boot. */ if (r < 0) return r; diff --git a/units/systemd-repart.service.in b/units/systemd-repart.service.in index b1322a159be..2b57b93ca87 100644 --- a/units/systemd-repart.service.in +++ b/units/systemd-repart.service.in @@ -31,5 +31,7 @@ Type=oneshot RemainAfterExit=yes ExecStart={{BINDIR}}/systemd-repart --dry-run=no +# The tool returns 76 if it can't find the root block device +SuccessExitStatus=76 # The tool returns 77 if there's no existing GPT partition table SuccessExitStatus=77