see machine-id(5). The machine-id serves as a partial replacement to the hostid
(gethostid(3)) used by systemd and should be unique.

By generating a new one with `systemd-id128 new` (see machine-id(5),
sd-id128(3)) after the installation the newly installed system gets a unique
one.

Signed-off-by: Stoiko Ivanov <s.iva...@proxmox.com>
---
 proxinstall | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/proxinstall b/proxinstall
index 380abdf..97af4b9 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1510,6 +1510,10 @@ sub extract_data {
        diversion_add($targetdir, "/usr/sbin/update-grub", "/bin/true");
        diversion_add($targetdir, "/usr/sbin/update-initramfs", "/bin/true");
 
+       my $machine_id = run_command("systemd-id128 new");
+       die "unable to create a new machine-id\n" if ! $machine_id;
+       write_config($machine_id, "$targetdir/etc/machine-id");
+
        syscmd("touch  $targetdir/proxmox_install_mode");
 
        my $grub_install_devices_txt = '';
-- 
2.20.1


_______________________________________________
pve-devel mailing list
pve-devel@pve.proxmox.com
https://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to