summaryrefslogtreecommitdiffstats
path: root/src/machine-id-setup
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine-id-setup')
-rw-r--r--src/machine-id-setup/machine-id-setup-main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/machine-id-setup/machine-id-setup-main.c b/src/machine-id-setup/machine-id-setup-main.c
index 2d29890864..5620bf9baf 100644
--- a/src/machine-id-setup/machine-id-setup-main.c
+++ b/src/machine-id-setup/machine-id-setup-main.c
@@ -158,11 +158,14 @@ static int run(int argc, char *argv[]) {
}
if (arg_commit) {
+ const char *etc_machine_id;
+
r = machine_id_commit(arg_root);
if (r < 0)
return r;
- r = id128_read(arg_root, "/etc/machine-id", ID128_FORMAT_PLAIN, &id);
+ etc_machine_id = prefix_roota(arg_root, "/etc/machine-id");
+ r = id128_read(etc_machine_id, ID128_FORMAT_PLAIN, &id);
if (r < 0)
return log_error_errno(r, "Failed to read machine ID back: %m");
} else {