From: Luis Chamberlain <mcgrof@kernel.org>
To: kdevops@lists.linux.dev
Cc: mcgrof@kernel.org
Subject: [PATCH 07/10] guestfs: move rhel activation to its own helper
Date: Tue, 7 May 2024 23:50:35 -0700 [thread overview]
Message-ID: <20240508065039.3408637-8-mcgrof@kernel.org> (raw)
In-Reply-To: <20240508065039.3408637-1-mcgrof@kernel.org>
The cmdfile stuff is an eye-sore, move users of that stuff
which depend on its own kconfig to its own function to make
the main part of the functionality easier to read.
No functional changes.
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
scripts/bringup_guestfs.sh | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/scripts/bringup_guestfs.sh b/scripts/bringup_guestfs.sh
index c410d0cf725d..2102fd81cf31 100755
--- a/scripts/bringup_guestfs.sh
+++ b/scripts/bringup_guestfs.sh
@@ -156,6 +156,23 @@ build_custom_image()
# just build $virt-builder, which is the pristine upstream image.
}
+handle_rhel_activation()
+{
+ if [ -n "$CONFIG_RHEL_ORG_ID" -a -n "$CONFIG_RHEL_ACTIVATION_KEY" ]; then
+ DO_UNREG=1
+ cat <<_EOT >>$cmdfile
+run-command subscription-manager register --org=${CONFIG_RHEL_ORG_ID} --activationkey=${CONFIG_RHEL_ACTIVATION_KEY}
+_EOT
+ fi
+}
+
+handle_rhel_unreg()
+{
+ cat <<_EOT >>$cmdfile
+sm-unregister
+_EOT
+}
+
copy_host_sources()
{
TARGET_DIR="$(dirname $CONFIG_GUESTFS_DISTRO_SOURCE_AND_DEST_FILE)"
@@ -183,12 +200,7 @@ if [ ! -f $BASE_IMAGE ]; then
DO_UNREG=0
if echo $OS_VERSION | grep -q '^rhel'; then
- if [ -n "$CONFIG_RHEL_ORG_ID" -a -n "$CONFIG_RHEL_ACTIVATION_KEY" ]; then
- DO_UNREG=1
- cat <<_EOT >>$cmdfile
-run-command subscription-manager register --org=${CONFIG_RHEL_ORG_ID} --activationkey=${CONFIG_RHEL_ACTIVATION_KEY}
-_EOT
- fi
+ handle_rhel_activation
fi
if [ -n "$CONFIG_KDEVOPS_CUSTOM_YUM_REPOFILE" ]; then
@@ -212,9 +224,7 @@ root-password password:kdevops
_EOT
if [ $DO_UNREG -ne 0 ]; then
- cat <<_EOT >>$cmdfile
-sm-unregister
-_EOT
+ handle_rhel_unreg
fi
# Ugh, debian has to be told to bring up the network and regenerate ssh keys
--
2.43.0
next prev parent reply other threads:[~2024-05-08 6:50 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 6:50 [PATCH 00/10] guestfs: custom image + mirroring sources.list heuristic Luis Chamberlain
2024-05-08 6:50 ` [PATCH 01/10] guestfs: move debian options before image names Luis Chamberlain
2024-05-08 6:50 ` [PATCH 02/10] guestfs: modify grub prompt before first bring up Luis Chamberlain
2024-05-08 6:50 ` [PATCH 03/10] guestfs: set default root password Luis Chamberlain
2024-05-08 6:50 ` [PATCH 04/10] guestfs: check for virt-builder failure Luis Chamberlain
2024-05-08 6:50 ` [PATCH 05/10] guestfs: add initial debian trixie support with custom URLs Luis Chamberlain
2024-05-08 17:30 ` Scott Mayhew
2024-05-11 23:46 ` Luis Chamberlain
2024-05-13 18:28 ` Richard W.M. Jones
2024-05-13 20:50 ` Luis Chamberlain
2024-05-13 20:55 ` Scott Mayhew
2024-05-14 12:04 ` Luis Chamberlain
2024-05-08 6:50 ` [PATCH 06/10] guestfs: add support to infer host distro mirrororing optimizations Luis Chamberlain
2024-05-08 6:50 ` Luis Chamberlain [this message]
2024-05-08 6:50 ` [PATCH 08/10] guestfs: move copying yum repo to its own routine Luis Chamberlain
2024-05-08 6:50 ` [PATCH 09/10] guestfs: move pre-install customizations " Luis Chamberlain
2024-05-08 6:50 ` [PATCH 10/10] guestfs: move debian pre-install hacks " Luis Chamberlain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240508065039.3408637-8-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=kdevops@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox