6d69d7909d
In order to support {CentOS,RHEL}7 for building cloud images we need to handle the differences in grub packaging from Ubuntu. We also need to populate the defualt location for cloud images for CentOS builds. Change-Id: Ie0d82ff21a42b08c4cb94b7a5635f80bfabf684e
38 lines
834 B
Bash
Executable file
38 lines
834 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" = "ppc64le" ]]; then
|
|
basearch=ppc64le
|
|
arch=ppc64le
|
|
elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then
|
|
basearch=aarch64
|
|
arch=aarch64
|
|
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
|