HomeFreeBSD

rc.d: Generate machine-id from hostid_save

Description

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)

Details

Provenance
tijlAuthored on Feb 15 2023, 8:09 PM
Reviewer
delphij
Differential Revision
D38811: Fix format of /etc/machine-id and generate from rc.d/hostid_save
Parents
rGa379d5c5efb2: hostid: Generate random UUID by default
Branches
Unknown
Tags
Unknown