dissect-image: support "uninitialized" machine-id

If the first boot was aborted, /etc/machine-id might read as
"uninitialized" in some cases.  Add a separate case for this
instead of printing a confusing error message.
This commit is contained in:
Harald Seiler 2020-09-06 21:23:36 +02:00
parent 448b782cb2
commit ab763cb2be
1 changed files with 2 additions and 0 deletions

View File

@ -2148,6 +2148,8 @@ int dissected_image_acquire_metadata(DissectedImage *m) {
log_debug_errno(r, "Image contains invalid /etc/machine-id: %s", line);
} else if (r == 0)
log_debug("/etc/machine-id file is empty.");
else if (streq(line, "uninitialized"))
log_debug("/etc/machine-id file is uninitialized (likely aborted first boot).");
else
log_debug("/etc/machine-id has unexpected length %i.", r);