From d2a11fd3ff5d558292f111b5c28439acdb92ceec Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 25 May 2024 01:47:23 +0900 Subject: [PATCH] machine-id-setup: update comment If an initrd has an empty or uninitialized /etc/machine-id file, then PID1 write a valid machine ID. So, the logic is important only on soft-reboot. Let's mention that explicitly. Follow-up for 16718dcf78a90faf8c5f53d7bf63e3575bc78be7. --- src/shared/machine-id-setup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shared/machine-id-setup.c b/src/shared/machine-id-setup.c index 66d2f300dff..1a637947564 100644 --- a/src/shared/machine-id-setup.c +++ b/src/shared/machine-id-setup.c @@ -55,8 +55,8 @@ static int acquire_machine_id(const char *root, sd_id128_t *ret) { assert(ret); /* First, try reading the machine ID from /run/machine-id, which may not be mounted on - * /etc/machine-id yet. This is important on switching root, Otherwise, machine ID may be changed - * after the transition. */ + * /etc/machine-id yet. This is important on switching root especially on soft-reboot, Otherwise, + * machine ID may be changed after the transition. */ if (isempty(root) && running_in_chroot() <= 0 && id128_read("/run/machine-id", ID128_FORMAT_PLAIN, ret) >= 0) { log_info("Reusing machine ID stored in /run/machine-id."); -- 2.47.3