From 16026735e5b3f4f8f05dd3adc2c93d41f5d2f111 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Tue, 21 Nov 2023 16:58:30 -0500 Subject: [PATCH] this shouldn't have been in here, anyways --- .../elements/base/environment.d/10-base-defaults | 3 ++- .../elements/base/install.d/00-baseline-environment | 4 +++- diskimage_builder/elements/yum/bin/install-packages | 6 +----- .../elements/yum/post-install.d/99-reset-yum-conf | 1 - 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/diskimage_builder/elements/base/environment.d/10-base-defaults b/diskimage_builder/elements/base/environment.d/10-base-defaults index b555a262..ad12eb53 100644 --- a/diskimage_builder/elements/base/environment.d/10-base-defaults +++ b/diskimage_builder/elements/base/environment.d/10-base-defaults @@ -1 +1,2 @@ -export DIB_AVOID_PACKAGES_UPDATE=${DIB_AVOID_PACKAGES_UPDATE:-0} \ No newline at end of file +export DIB_AVOID_PACKAGES_UPDATE=${DIB_AVOID_PACKAGES_UPDATE:-0} +export DIB_AVOID_ISCSI=${DIB_AVOID_ISCSI:-0} diff --git a/diskimage_builder/elements/base/install.d/00-baseline-environment b/diskimage_builder/elements/base/install.d/00-baseline-environment index e84c84be..b6535c4a 100755 --- a/diskimage_builder/elements/base/install.d/00-baseline-environment +++ b/diskimage_builder/elements/base/install.d/00-baseline-environment @@ -7,4 +7,6 @@ fi set -eu set -o pipefail -install-packages -m base iscsi_package +if [ ${DIB_AVOID_ISCSI} -eq 0 ]]; then + install-packages -m base iscsi_package +fi diff --git a/diskimage_builder/elements/yum/bin/install-packages b/diskimage_builder/elements/yum/bin/install-packages index 5b523ef9..04564398 100755 --- a/diskimage_builder/elements/yum/bin/install-packages +++ b/diskimage_builder/elements/yum/bin/install-packages @@ -134,11 +134,7 @@ if [ -n "$WHITELIST" ]; then # # [1] https://bugzilla.redhat.com/show_bug.cgi?id=965567 set -o xtrace - if [[ -n ${DIB_YUM_DNF_CONTENTDIR:-''} ]]; then - sudo cp /etc/dnf/vars/contentdir /etc/dnf/vars/contentdir.bak - echo $DIB_YUM_DNF_CONTENTDIR | sudo tee /etc/dnf/vars/contentdir - sudo sed -i -e 's,^mirrorlist,#mirrorlist,' -e 's,^#baseurl,baseurl,' /etc/yum.repos.d/*.repo - fi + ${YUM} -v -y $ACTION $EXTRA_ARGS $PKGS if [ "$ACTION" == "install" ]; then diff --git a/diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf b/diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf index 582bc94e..df2022e7 100755 --- a/diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf +++ b/diskimage_builder/elements/yum/post-install.d/99-reset-yum-conf @@ -6,7 +6,6 @@ fi set -eu set -o pipefail - if [[ -n ${DIB_YUM_DNF_CONTENTDIR:-''} ]]; then sudo mv /etc/dnf/vars/contentdir.bak /etc/dnf/vars/contentdir sudo sed -i -e 's,^#mirrorlist,mirrorlist,' -e 's,^baseurl,#baseurl,' /etc/yum.repos.d/*.repo