]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dissect-image: support "uninitialized" machine-id
authorHarald Seiler <hws@denx.de>
Sun, 6 Sep 2020 19:23:36 +0000 (21:23 +0200)
committerHarald Seiler <hws@denx.de>
Mon, 19 Oct 2020 14:28:22 +0000 (16:28 +0200)
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.

src/shared/dissect-image.c

index 91120d72194f490dcc6c51542937e8e0d9d643ef..cbd335721993e5fdc0680834fe2b9f45ec7abd7a 100644 (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);