mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-31 17:17:43 +03:00
Generate stable machine-id and DHCP client ID on POWER KVM.
This commit is contained in:
parent
6b4f7fb08c
commit
8fa0de653b
@ -99,8 +99,8 @@
|
||||
be used. If this file is empty or missing, <filename>systemd</filename> will attempt
|
||||
to use the D-Bus machine ID from <filename>/var/lib/dbus/machine-id</filename>, the
|
||||
value of the kernel command line option <varname>container_uuid</varname>, the KVM DMI
|
||||
<filename>product_uuid</filename> (on KVM systems), and finally a randomly generated
|
||||
UUID.</para>
|
||||
<filename>product_uuid</filename> or the devicetree <filename>vm,uuid</filename>
|
||||
(on KVM systems), and finally a randomly generated UUID.</para>
|
||||
|
||||
<para>After the machine ID is established,
|
||||
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
||||
|
@ -68,6 +68,11 @@ static int generate_machine_id(const char *root, sd_id128_t *ret) {
|
||||
log_info("Initializing machine ID from KVM UUID.");
|
||||
return 0;
|
||||
}
|
||||
/* on POWER, it's exported here instead */
|
||||
if (id128_read("/sys/firmware/devicetree/base/vm,uuid", ID128_UUID, ret) >= 0) {
|
||||
log_info("Initializing machine ID from KVM UUID.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,8 @@ static int context_read_data(Context *c) {
|
||||
return r;
|
||||
|
||||
r = id128_read("/sys/class/dmi/id/product_uuid", ID128_UUID, &c->uuid);
|
||||
if (r == -ENOENT)
|
||||
r = id128_read("/sys/firmware/devicetree/base/vm,uuid", ID128_UUID, &c->uuid);
|
||||
if (r < 0)
|
||||
log_full_errno(r == -ENOENT ? LOG_DEBUG : LOG_WARNING, r,
|
||||
"Failed to read product UUID, ignoring: %m");
|
||||
|
Loading…
Reference in New Issue
Block a user