diskimage-builder/elements/rpm-distro/pre-install.d/01-override-yum-arch
d.marlin 8d7362aa9b Change path for dnf arch override so basearch is not overwritten.
After writing the basearch value to /etc/dnf/vars/basearch the
arch value was overwriting the same file.  This appears to be
incorrect, so changing it to write /etc/dnf/vars/arch, which
matches the subsequent 'yum' code paths.

Change-Id: I5da54f03224c11f9e286f16b68533936c4174c2a
2016-11-17 03:36:54 -05:00

36 lines
752 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
if [ "i386" = "$ARCH" ]; then
basearch=i386
arch=i686
elif [[ "amd64 x86_64" =~ "$ARCH" ]]; then
basearch=x86_64
arch=x86_64
elif [[ "$ARCH" = "ppc64" ]]; then
basearch=ppc64
arch=ppc64
elif [[ "$ARCH" = "ppc64el" ]]; then
basearch=ppc64el
arch=ppc64el
else
echo "********************"
echo "Unknown arch '$ARCH'"
echo "********************"
exit 1
fi
if [[ $DISTRO_NAME == "fedora" && $DIB_RELEASE -ge 22 ]]; then
mkdir -p /etc/dnf/vars
echo $basearch > /etc/dnf/vars/basearch
echo $arch > /etc/dnf/vars/arch
else
echo $basearch > /etc/yum/vars/basearch
echo $arch > /etc/yum/vars/arch
fi