mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
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.
This commit is contained in:
parent
8bf1d14112
commit
021b0ff405
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user