]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rc.d: Generate machine-id from hostid_save
authorTijl Coosemans <tijl@FreeBSD.org>
Wed, 15 Feb 2023 20:09:51 +0000 (21:09 +0100)
committerTijl Coosemans <tijl@FreeBSD.org>
Sun, 12 Mar 2023 21:46:07 +0000 (22:46 +0100)
commit71d88613d12984f6a9058f4ef7044e00853727ed
treecb54e6e9a38c9307d4bb97e99cde4bf3dc619254
parenta379d5c5efb2b606f2a12b94c0bfd450173b7c38
rc.d: Generate machine-id from hostid_save

rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid.
Store the same UUID, without hyphens, in /etc/machine-id.  The hyphens
are removed with a shell function because hostid_save runs before file
systems are mounted so other tools may not be available yet.

This eliminates some duplication between hostid and machine-id and for
virtual machines machine-id now contains the UUID configured in the
hypervisor like it does on Linux.

Reviewed by: delphij
Discussed with: bapt
Approved by: re (cperciva)
Differential Revision: https://reviews.freebsd.org/D38811

(cherry picked from commit ecad3f5c4d922f93ceba455f8bff1c54e1ed4174)
(cherry picked from commit d6852eed98ed32ad51120a22aa1ebdf0601917b3)
ObsoleteFiles.inc
etc/Makefile
libexec/rc/rc.conf
libexec/rc/rc.d/Makefile
libexec/rc/rc.d/hostid_save
libexec/rc/rc.d/machine_id [deleted file]
sys/sys/param.h