[pve-devel] [PATCH installer 1/2] fix #1603: create a new and unique machine-id

Stoiko Ivanov s.ivanov at proxmox.com
Tue Jul 9 15:29:52 CEST 2019


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 not shipping one in the
ISO and generating one after the installation the installer ensures the
uniqueness.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 proxinstall | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/proxinstall b/proxinstall
index 380abdf..19d0896 100755
--- a/proxinstall
+++ b/proxinstall
@@ -1509,6 +1509,9 @@ sub extract_data {
 	diversion_add($targetdir, "/sbin/start-stop-daemon", "/sbin/fake-start-stop-daemon");
 	diversion_add($targetdir, "/usr/sbin/update-grub", "/bin/true");
 	diversion_add($targetdir, "/usr/sbin/update-initramfs", "/bin/true");
+	syscmd("systemd-machine-id-setup --root=$targetdir") == 0 ||
+	    die "unable to create a new machine-id\n";
+
 
 	syscmd("touch  $targetdir/proxmox_install_mode");
 
-- 
2.20.1





More information about the pve-devel mailing list