diff --git a/src/partition/repart.c b/src/partition/repart.c index 6cadc5f668..2cc4881ada 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 b1322a159b..2b57b93ca8 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