From ddb2811255752fa4fbfbe6fe9c8706a96c5bced0 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 25 Sep 2019 03:40:54 +0000 Subject: [PATCH] Add environment switch for centos8 to use dnf Set YUM to dnf for Centos 8; this matches similar done in fedora-minimal. Change-Id: I2b2c41a73e468fe9045ee5b7b812da66f20d8584 --- .../centos-minimal/environment.d/10-centos-distro-name.bash | 3 --- .../elements/centos-minimal/environment.d/11-yum-dnf.bash | 5 +++++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 diskimage_builder/elements/centos-minimal/environment.d/11-yum-dnf.bash diff --git a/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash b/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash index 501df444..39449b15 100644 --- a/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash +++ b/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash @@ -4,6 +4,3 @@ export DIB_RELEASE=${DIB_RELEASE:-7} # by default, enable DHCP configuration of eth0 & eth1 in network # scripts. See yum-minimal for full details export DIB_YUM_MINIMAL_CREATE_INTERFACES=${DIB_YUM_MINIMAL_CREATE_INTERFACES:-1} - -# Useful for elements that work with fedora (dnf) & centos -export YUM=${YUM:-yum} diff --git a/diskimage_builder/elements/centos-minimal/environment.d/11-yum-dnf.bash b/diskimage_builder/elements/centos-minimal/environment.d/11-yum-dnf.bash new file mode 100644 index 00000000..cd637f65 --- /dev/null +++ b/diskimage_builder/elements/centos-minimal/environment.d/11-yum-dnf.bash @@ -0,0 +1,5 @@ +if [ $DIB_RELEASE -ge 8 ]; then + export YUM=dnf +else + export YUM=yum +fi