Steve Baker cb216b6cd8 Add DIB_IPA_HARDWARE_RDO to define repo behaviour
Currently the latest RDO repo is installed on centos9
for the python-hardware package. This would not be appropriate in the
following cases:
* When repos are copied in from the host via DIB_YUM_REPO_CONF
* When another element is responsible for setting up repos

This change adds environment variable DIB_IPA_HARDWARE_RDO, which will
only be set to `1` on centos9, when DIB_YUM_REPO_CONF isn't set, and
when the user hasn't explicitly set DIB_IPA_HARDWARE_RDO.

This retains the current default behaviour of just working, while
giving flexibility for repos to be set up another way.

Change-Id: I1cc0b9833baf642866e9762c6bae44360bffe20d
2023-03-16 14:42:20 +13:00

15 lines
418 B
Bash
Executable File

if [[ "${DISTRO_NAME}${DIB_RELEASE}" =~ "centos9" ]]; then
if [ -n "${DIB_YUM_REPO_CONF:-}" ] ; then
# Always disable if DIB_YUM_REPO_CONF is defined
export DIB_IPA_HARDWARE_RDO=0
else
# Default to enabled, but overridable by the host
export DIB_IPA_HARDWARE_RDO=${DIB_IPA_HARDWARE_RDO:-1}
fi
else
# Always disable if not centos-9
export DIB_IPA_HARDWARE_RDO=0
fi