diskimage-builder/elements/rpm-distro/pre-install.d/01-override-yum-arch
Noam Angel d07d7ed15d simplify ARCH param for rhel/centos param can be x86_64 and amd64
for fedora/rhel/centos the main supported ARCH is x86_64. This patch allow
to call diskimage-builder with the above distro's with param ARCH=x86_64,
And also retain same behaiver when call with ARCH=amd64 as it translate
anyway to x86_64. Doing so wil simplify user expirience.

Change-Id: I229e0912434109b1b48a030bd35ad8dc1096a629
2016-11-15 10:18:14 +11:00

36 lines
756 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/basearch
else
echo $basearch > /etc/yum/vars/basearch
echo $arch > /etc/yum/vars/arch
fi