From: Yu Watanabe Date: Fri, 24 May 2024 16:47:23 +0000 (+0900) Subject: machine-id-setup: update comment X-Git-Tag: v256-rc4~128^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F33011%2Fhead;p=thirdparty%2Fsystemd.git 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. --- 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.");