From d07d7ed15d54c37448d5be67c4e4707ba19edac0 Mon Sep 17 00:00:00 2001 From: Noam Angel Date: Tue, 1 Nov 2016 16:19:44 +0200 Subject: [PATCH] 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 --- elements/centos7/root.d/10-centos7-cloud-image | 4 ++-- elements/rhel7/root.d/10-rhel7-cloud-image | 4 ++-- elements/rpm-distro/pre-install.d/01-override-yum-arch | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/elements/centos7/root.d/10-centos7-cloud-image b/elements/centos7/root.d/10-centos7-cloud-image index cd79a418..7db1557d 100755 --- a/elements/centos7/root.d/10-centos7-cloud-image +++ b/elements/centos7/root.d/10-centos7-cloud-image @@ -9,10 +9,10 @@ set -o pipefail [ -n "$ARCH" ] [ -n "$TARGET_ROOT" ] -if [ 'amd64' = "$ARCH" ] ; then +if [[ "amd64 x86_64" =~ "$ARCH" ]]; then ARCH="x86_64" else - echo 'centos7 root element only support the amd64 $ARCH value.' + echo 'centos7 root element only support the x86_64 $ARCH value.' exit 1 fi diff --git a/elements/rhel7/root.d/10-rhel7-cloud-image b/elements/rhel7/root.d/10-rhel7-cloud-image index be38caa4..bc54b101 100755 --- a/elements/rhel7/root.d/10-rhel7-cloud-image +++ b/elements/rhel7/root.d/10-rhel7-cloud-image @@ -9,10 +9,10 @@ set -o pipefail [ -n "$ARCH" ] [ -n "$TARGET_ROOT" ] -if [ 'amd64' = "$ARCH" ] ; then +if [[ "amd64 x86_64" =~ "$ARCH" ]]; then ARCH="x86_64" else - echo 'rhel7 root element only support the amd64 $ARCH value.' + echo 'rhel7 root element only support the x86_64 $ARCH value.' exit 1 fi diff --git a/elements/rpm-distro/pre-install.d/01-override-yum-arch b/elements/rpm-distro/pre-install.d/01-override-yum-arch index ff84375c..138bf313 100755 --- a/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -9,7 +9,7 @@ set -o pipefail if [ "i386" = "$ARCH" ]; then basearch=i386 arch=i686 -elif [ "amd64" = "$ARCH" ]; then +elif [[ "amd64 x86_64" =~ "$ARCH" ]]; then basearch=x86_64 arch=x86_64 elif [[ "$ARCH" = "ppc64" ]]; then