From 15ccf776be48949f0b1d255074a52f44de8fb833 Mon Sep 17 00:00:00 2001 From: yogananth subramanian Date: Thu, 22 Jan 2015 12:04:27 +0530 Subject: [PATCH] Add support for using local PowerPC VM image Patch adds support for PowerPC Big-endian and Little-endian local fedora VM images and using VM images with two partitions, PReP boot and root partition. Since PowerPC requires PReP boot partition to be present. Change-Id: Iba03226e187609df898732c13b1aa5f895b156e3 Closes-Bug: 1413487 --- elements/redhat-common/bin/extract-image | 2 +- elements/rpm-distro/pre-install.d/01-override-yum-arch | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/elements/redhat-common/bin/extract-image b/elements/redhat-common/bin/extract-image index a79c04614..64b4d7d6f 100755 --- a/elements/redhat-common/bin/extract-image +++ b/elements/redhat-common/bin/extract-image @@ -50,7 +50,7 @@ function extract_image() { qemu-img convert -f qcow2 -O raw $CACHED_IMAGE $WORKING/$RAW_FILE - ROOT_PARTITON=p1 + ROOT_PARTITON=p$(sudo kpartx -l $WORKING/$RAW_FILE | awk "/loop[0-9]+p/"|wc -l) # kpartx fails if no /dev/loop* exists, "losetup -f" prints first unused # loop device and creates it if it doesn't exist 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 ca528547d..07ce3b19f 100755 --- a/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -9,6 +9,12 @@ if [ "i386" = "$ARCH" ]; then elif [ "amd64" = "$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'"