From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DFB48158046 for ; Sun, 13 Oct 2024 12:43:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 234FDE088F; Sun, 13 Oct 2024 12:43:46 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 07EBEE088F for ; Sun, 13 Oct 2024 12:43:46 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 10A8734320F for ; Sun, 13 Oct 2024 12:43:45 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6B563AE7 for ; Sun, 13 Oct 2024 12:43:43 +0000 (UTC) From: "Andreas K. Hüttel" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andreas K. Hüttel" Message-ID: <1728823394.3c2d2560342a8bc8b6aecb00d7940fbc6dc03e12.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:dilfridge/qcow2 commit in: targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/support/create-qcow2.sh targets/support/diskimage-installation.sh X-VCS-Directories: targets/support/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: 3c2d2560342a8bc8b6aecb00d7940fbc6dc03e12 X-VCS-Branch: dilfridge/qcow2 Date: Sun, 13 Oct 2024 12:43:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ecb27505-0d85-43c0-8b10-ddfaaf7c24c2 X-Archives-Hash: 6d464d3ecc725fdf25b4644a14038345 commit: 3c2d2560342a8bc8b6aecb00d7940fbc6dc03e12 Author: Andreas K. Hüttel gentoo org> AuthorDate: Sun Oct 13 12:43:14 2024 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Sun Oct 13 12:43:14 2024 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=3c2d2560 New attempt at systemd-firstboot Signed-off-by: Andreas K. Hüttel gentoo.org> targets/support/create-qcow2.sh | 8 ++++++-- targets/support/diskimage-installation.sh | 20 ++++++-------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/targets/support/create-qcow2.sh b/targets/support/create-qcow2.sh index f7c1a08a..0073a25c 100755 --- a/targets/support/create-qcow2.sh +++ b/targets/support/create-qcow2.sh @@ -140,8 +140,12 @@ 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" +echo "Setting machine-id to empty" +# We are already running systemd-firstboot in a previous step, so we don't want to run it again. +# The documented behaviour for an empty machine-id is that systemd generates a new one and commits +# it on first boot, but otherwise treats the system as already initialized. +rm -f "${mymountpoint}/etc/machine-id" +touch "${mymountpoint}/etc/machine-id" || qcow2die "Could not set machine-id to empty" # 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 5d9ff2e1..c7ee4f0b 100755 --- a/targets/support/diskimage-installation.sh +++ b/targets/support/diskimage-installation.sh @@ -19,31 +19,23 @@ if [[ $(readlink /etc/portage/make.profile) == *systemd* ]] ; then echo "Generating /etc/locale.gen" cat > /etc/locale.gen < "${mysfconfigfile}" + echo "Setting up console log-in image. Please set the root password ASAP." + echo "Running systemd-firstboot" + systemd-firstboot --locale=en_US.UTF-8 --keymap=us --timezone=UTC --delete-root-password || die "Failed running systemd-firstboot" ;; *) die "As yet unsupported image type"