From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1AFC22338 for ; Wed, 8 May 2024 06:50:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715151042; cv=none; b=bOhKoV+LVQb3Ztd/8LLn98aPybNAbpzatHrLUhb15Micsrai7k6BDDU1A3Ea3fW2EJJZr5T+SOzM6HAmONs2QHe1/JAXtqxum9qhf5Av/4L2+O1wxvy0vThHkiFL2EIyxV0hZR9j+QQKEVaMdK8e/bbzX8rOOYkfG5i6n25Lv1c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715151042; c=relaxed/simple; bh=PjN7S7dUtkS696mccU4WeNMZEit62qHLzGqgeER0VkI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FVMNmI2tkInYjJW04mk14nt1TQA73c8hm6cb3VIARutuzubwEVzsinKtJ4P+CVd+vYOcGKeNaXQlw8Xam8lP2VPTSxBJQ1JxKLujZ3F/rNtBgdGnzxUZ446kwYsFBU0gmJq+3M3djrDJ/MlQYUrOdc39nPbevMfxQAq+Xbnacec= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=cRNEMqEV; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="cRNEMqEV" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=VfHpbLtsnLTY82wWdX9m9UqD1GVnWMvlyVixuzlRiqU=; b=cRNEMqEVHRy1wlCg9lHMoXDXQ6 1j5zQqkfdRcWXEI8haicaG0+YieIELD6dQ8z5HWlP9avSr0ir0LcFFWvzPNYPA3u+NhwQ3jIPOR/t zgq5tf3dX5cjuUGgH6kPu/5M7tdYQfs/pBj+L8PkC/9Qs15GCr4/DMv8aMEqBMW7bPR+8yzQBKEYp sZ5zNBe9O6Vi/gqX8W0kFBvVoqdUpGiIAwW+QFyhTQB0ljKmOMObxq36hDNsHHIIP/VPgTNQF8egw 8+s0WGt9cH0LUbRVVxyLuvoMfO/PSHXfktZ8LqTMmjIX4NS6LpjUCsTdCP5/uGyKQfR5BKRfjRIK1 EtOPdYfw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4b8S-0000000EIkg-1q3n; Wed, 08 May 2024 06:50:40 +0000 From: Luis Chamberlain To: kdevops@lists.linux.dev Cc: mcgrof@kernel.org Subject: [PATCH 09/10] guestfs: move pre-install customizations to its own routine Date: Tue, 7 May 2024 23:50:37 -0700 Message-ID: <20240508065039.3408637-10-mcgrof@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240508065039.3408637-1-mcgrof@kernel.org> References: <20240508065039.3408637-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain As with prior commits, move pre-install customizations to its own routine. Signed-off-by: Luis Chamberlain --- scripts/bringup_guestfs.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh index 8210b3cf1b19..6f96b5c2029a 100755 --- a/scripts/bringup_guestfs.sh +++ b/scripts/bringup_guestfs.sh @@ -189,6 +189,18 @@ copy-in $CONFIG_GUESTFS_DISTRO_SOURCE_AND_DEST_FILE:$TARGET_DIR _EOT } +pre_install_customizations() +{ + cat <<_EOT >>$cmdfile +install sudo,qemu-guest-agent,python3,bash +run-command useradd -m kdevops -s /bin/bash +append-line /etc/sudoers.d/kdevops:kdevops ALL=(ALL) NOPASSWD: ALL +edit /etc/default/grub:s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"/ +run-command /usr/sbin/update-grub2 +root-password password:kdevops +_EOT +} + mkdir -p $STORAGEDIR mkdir -p $BASE_IMAGE_DIR @@ -218,15 +230,7 @@ if [ ! -f $BASE_IMAGE ]; then copy_host_sources fi -# basic pre-install customization - cat <<_EOT >>$cmdfile -install sudo,qemu-guest-agent,python3,bash -run-command useradd -m kdevops -s /bin/bash -append-line /etc/sudoers.d/kdevops:kdevops ALL=(ALL) NOPASSWD: ALL -edit /etc/default/grub:s/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS0"/ -run-command /usr/sbin/update-grub2 -root-password password:kdevops -_EOT + pre_install_customizations if [ $DO_UNREG -ne 0 ]; then handle_rhel_unreg -- 2.43.0