1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-26 17:49:52 +03:00

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 16718dcf78.
This commit is contained in:
Yu Watanabe
2024-05-25 01:47:23 +09:00
parent 4c42df8166
commit d2a11fd3ff

View File

@ -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.");