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 7CC8315807B for ; Sun, 13 Oct 2024 20:33:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5263CE0866; Sun, 13 Oct 2024 20:33:54 +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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 36D34E0866 for ; Sun, 13 Oct 2024 20:33:54 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 54AB13430EE for ; Sun, 13 Oct 2024 20:33:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5E0531E15 for ; Sun, 13 Oct 2024 20:33:50 +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: <1728851446.f59604b8509bff8469bdbbc5389b3cb5b43e7fcd.dilfridge@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/support/diskimagefs-update.sh X-VCS-Directories: targets/support/ X-VCS-Committer: dilfridge X-VCS-Committer-Name: Andreas K. Hüttel X-VCS-Revision: f59604b8509bff8469bdbbc5389b3cb5b43e7fcd X-VCS-Branch: master Date: Sun, 13 Oct 2024 20:33:50 +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: 8940aa4d-269a-4b70-b381-b90546f92522 X-Archives-Hash: f1dff0939df3c9deb4b6431d5cb2785e commit: f59604b8509bff8469bdbbc5389b3cb5b43e7fcd Author: Andreas K. Hüttel gentoo org> AuthorDate: Sun Oct 13 14:42:29 2024 +0000 Commit: Andreas K. Hüttel gentoo org> CommitDate: Sun Oct 13 20:30:46 2024 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=f59604b8 Support scripts for diskimage configuration Signed-off-by: Andreas K. Hüttel gentoo.org> targets/support/diskimagefs-update.sh | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/targets/support/diskimagefs-update.sh b/targets/support/diskimagefs-update.sh new file mode 100755 index 00000000..45d870a5 --- /dev/null +++ b/targets/support/diskimagefs-update.sh @@ -0,0 +1,63 @@ +#!/bin/bash + +source /tmp/chroot-functions.sh + +if [[ $(readlink /etc/portage/make.profile) == *systemd* ]] ; then + +# We are using systemd. + +# Types of bootable disk images planned for (diskimage/type): +# cloud-init - an image that starts cloud-init for configuration and then can be +# used out of the box +# console - an image that has an empty root password and allows passwordless +# login on the console only +# ssh - an image that populates /root/.ssh/authorized_keys and starts dhcp +# as well as sshd; obviously not fit for public distribution +# generic - an image with no means of logging in... needs postprocessing +# no services are started + +echo "Generating /etc/locale.gen" +cat > /etc/locale.gen < /etc/locale.conf || die "Failed to set locale" +env-update || die "Failed to run env-update" + +echo "Setting keymap" +echo "KEYMAP=us" > /etc/vconsole.conf || die "Failed to set keymap" + +echo "Disk image type is ${clst_diskimage_type}" +case ${clst_diskimage_type} in + generic) + echo "Setting up generic image (warning, not very useful on its own)" + echo "Running systemd-firstboot" + systemd-firstboot --timezone=UTC || die "Failed running systemd-firstboot" + ;; + console) + echo "Setting up console log-in image. Please set the root password ASAP." + echo "Removing root password" + passwd -d root || die "Failed removing root password" + echo "Running systemd-firstboot" + systemd-firstboot --timezone=UTC || die "Failed running systemd-firstboot" + ;; + *) + die "As yet unsupported image type" + ;; +esac + +else + +# We are using OpenRC. + +die "OpenRC is as yet unsupported." + +fi + +# all done +# (we can't install the boot loader here because nothing is mounted)