commit:     369cc4120b16d3cc43065d573a25719d05c38637
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 12 21:39:17 2024 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Oct 12 21:39:17 2024 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=369cc412

Need to set machine-id late else it gets wiped again

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 targets/support/create-qcow2.sh           | 3 +++
 targets/support/diskimage-installation.sh | 3 ---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/targets/support/create-qcow2.sh b/targets/support/create-qcow2.sh
index 82892c07..d650ea91 100755
--- a/targets/support/create-qcow2.sh
+++ b/targets/support/create-qcow2.sh
@@ -140,6 +140,9 @@ mount ${mypartefi} "${mymountpoint}/boot" || qcow2die 
"Could not mount boot part
 echo "Copying files into the mounted directories from ${clst_stage_path}"
 cp -a "${clst_stage_path}"/* "${mymountpoint}/" || qcow2die "Could not copy 
content into mounted image"
 
+echo "Setting machine-id to uninitialized"
+echo "uninitialized" > "${mymountpoint}/etc/machine-id" || qcow2die "Could not 
set machine-id to uninitialized"
+
 # now we can chroot in and install grub
 exec_in_qcow2 "${clst_shdir}/support/qcow2-grub-install.sh"
 

diff --git a/targets/support/diskimage-installation.sh 
b/targets/support/diskimage-installation.sh
index 7237694f..a7c042ef 100755
--- a/targets/support/diskimage-installation.sh
+++ b/targets/support/diskimage-installation.sh
@@ -19,9 +19,6 @@ if [[ $(readlink /etc/portage/make.profile) == *systemd* ]] ; 
then
 echo "Running systemctl preset-all"
 systemctl preset-all || die "Running systemctl preset-all failed"
 
-echo "Setting machine-id uninitialized"
-echo "uninitialized" > /etc/machine-id || die "Failed setting machine-id 
uninitialized"
-
 # Provide configuration for systemd-firstboot
 # We need enough information so all questions are skipped
 mkdir -p /etc/systemd/system/systemd-firstboot.service.d || die "mkdir failed"

Reply via email to