systemd-machine-id-setup
(1)Initialize the machine ID in /etc/machine-id
Options
7--rootpathTakes a directory path as argument. All paths operated on will be prefixed with the given alternate root path, including the path for /etc/machine-id itself. Added in version 212.
--imagepathTakes a path to a device node or regular file as argument. This is similar to --root= as described above, but operates on a disk image instead of a directory tree. Added in version 249.
--image-policypolicyTakes an image policy string as argument, as per systemd.image-policy(7). The policy is enforced when operating on the disk image specified via --image=, see above. If not specified, defaults to the "*" policy, i.e. all recognized file systems in the image are used.
--commitCommit a transient machine ID to disk. This command may be used to convert a transient machine ID into a persistent one. A transient machine ID file is one that was bind mounted from a memory file system (usually "tmpfs") to /etc/machine-id during the early phase of the boot process. This may happen because /etc/ is initially read-only and was missing a valid machine ID file at that point. This command will execute no operation if /etc/machine-id is not mounted from a memory file system, or if /etc/ is read-only. The command will write the current transient machine ID to disk and unmount the /
--printPrint the machine ID generated or committed after the operation is complete. Added in version 231.
-h--helpPrint a short help text and exit.
--versionPrint a short version string and exit.
DESCRIPTION
systemd-machine-id-setup may be used by system installer tools to initialize the machine ID stored in /etc/machine-id at install time, with a provisioned or randomly generated ID. See machine-id(5) for more information about this file.
If the tool is invoked without the --commit switch, /etc/machine-id is initialized with a valid, new machine ID if it is missing or empty. The new machine ID will be acquired in the following fashion:
The --commit switch may be used to commit a transient machined ID to disk, making it persistent. For details, see below.
Use systemd-firstboot(1) to initialize the machine ID on mounted (but not booted) system images.