[rhel7/master] Add ppc64le arch (#1136490)

Brian C. Lane bcl at redhat.com
Tue Sep 2 19:39:46 UTC 2014


basearch is ppc64le so we needs to check for that in addition to ppc64.

Resolves:rhbz#1136490
---
 lorax.spec                 | 2 +-
 share/live/ppc.tmpl        | 4 ++--
 share/ppc.tmpl             | 4 ++--
 share/runtime-install.tmpl | 2 +-
 src/pylorax/__init__.py    | 6 +++---
 src/pylorax/treebuilder.py | 3 ++-
 6 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/lorax.spec b/lorax.spec
index 2d22205..6ff8f4e 100644
--- a/lorax.spec
+++ b/lorax.spec
@@ -52,7 +52,7 @@ Requires:       redhat-upgrade-dracut-plymouth
 Requires:       syslinux >= 4.02-5
 %endif
 
-%ifarch ppc ppc64
+%ifarch ppc ppc64 ppc64le
 Requires:       kernel-bootwrapper
 Requires:       grub2
 Requires:       grub2-tools
diff --git a/share/live/ppc.tmpl b/share/live/ppc.tmpl
index 790817a..80c0383 100644
--- a/share/live/ppc.tmpl
+++ b/share/live/ppc.tmpl
@@ -51,12 +51,12 @@ install ${configdir}/mapping ${BOOTDIR}
 install ${configdir}/magic ${BOOTDIR}
 
 ## NOTE: PPC is kind of funky. There's three possible "arch" setups here:
-## ppc, ppc64, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
+## ppc, ppc64, ppc64le and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
 
 ## Install kernel and bootloader config (in separate places for each arch)
 %for kernel in kernels:
     <%
-      bits = 64 if kernel.arch == "ppc64" else 32
+      bits = 64 if kernel.arch in ("ppc64", "ppc64le") else 32
       ## separate dirs/images for each arch
       KERNELDIR=BOOTDIR+"/ppc%s" % bits
       NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
diff --git a/share/ppc.tmpl b/share/ppc.tmpl
index 025f1df..23f4b08 100644
--- a/share/ppc.tmpl
+++ b/share/ppc.tmpl
@@ -54,12 +54,12 @@ install ${configdir}/mapping ${BOOTDIR}
 install ${configdir}/magic ${BOOTDIR}
 
 ## NOTE: PPC is kind of funky. There's three possible "arch" setups here:
-## ppc, ppc64, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
+## ppc, ppc64, ppc64le, and 'hybrid' (ppc userspace, both ppc & ppc64 kernels).
 
 ## Install kernel and bootloader config (in separate places for each arch)
 %for kernel in kernels:
     <%
-      bits = 64 if kernel.arch == "ppc64" else 32
+      bits = 64 if kernel.arch in ("ppc64", "ppc64le") else 32
       ## separate dirs/images for each arch
       KERNELDIR=BOOTDIR+"/ppc%s" % bits
       NETIMG=NETBOOTDIR+"/ppc%s.img" % bits
diff --git a/share/runtime-install.tmpl b/share/runtime-install.tmpl
index 86667ab..0050124 100644
--- a/share/runtime-install.tmpl
+++ b/share/runtime-install.tmpl
@@ -32,7 +32,7 @@ installpkg kernel
     installpkg grub2 grub2-tools biosdevname memtest86+ syslinux
     installpkg efibootmgr grub2-efi shim shim-unsigned
 %endif
-%if basearch in ("ppc", "ppc64"):
+%if basearch in ("ppc", "ppc64", "ppc64le"):
     installpkg grub2 grub2-tools fbset hfsutils kernel-bootwrapper ppc64-utils
 %endif
 %if basearch == "s390x":
diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py
index 0c3f263..ea51718 100644
--- a/src/pylorax/__init__.py
+++ b/src/pylorax/__init__.py
@@ -54,9 +54,9 @@ REMOVE_PPC64_DRIVERS = "floppy scsi_debug nouveau radeon cirrus mgag200"
 REMOVE_PPC64_MODULES = "drm plymouth"
 
 class ArchData(DataHolder):
-    lib64_arches = ("x86_64", "ppc64", "s390x", "ia64", "aarch64")
+    lib64_arches = ("x86_64", "ppc64", "ppc64le", "s390x", "ia64", "aarch64")
     bcj_arch = dict(i386="x86", x86_64="x86",
-                    ppc="powerpc", ppc64="powerpc",
+                    ppc="powerpc", ppc64="powerpc", ppc64le="powerpc",
                     arm="arm", armhfp="arm")
 
     def __init__(self, buildarch):
@@ -299,7 +299,7 @@ class Lorax(BaseLoraxClass):
         dracut_args = ["--xz", "--install", "/.buildstamp"]
 
         # ppc64 cannot boot an initrd > 32MiB so remove some drivers
-        if self.arch.basearch == "ppc64":
+        if self.arch.basearch in ("ppc64", "ppc64le"):
             dracut_args.extend(["--omit-drivers", REMOVE_PPC64_DRIVERS])
             dracut_args.extend(["--omit", REMOVE_PPC64_MODULES])
 
diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index 0ae1bc3..7924803 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -35,6 +35,7 @@ templatemap = {
     'x86_64':  'x86.tmpl',
     'ppc':     'ppc.tmpl',
     'ppc64':   'ppc.tmpl',
+    'ppc64le': 'ppc.tmpl',
     's390':    's390.tmpl',
     's390x':   's390.tmpl',
     'aarch64': 'aarch64.tmpl',
@@ -216,7 +217,7 @@ class TreeBuilder(object):
             runcmd(cmd, root=self.vars.inroot)
 
             # ppc64 cannot boot images > 32MiB, check size and warn
-            if self.vars.arch.basearch == "ppc64" and os.path.exists(outfile):
+            if self.vars.arch.basearch in ("ppc64", "ppc64le") and os.path.exists(outfile):
                 st = os.stat(outfile)
                 if st.st_size > 32 * 1024 * 1024:
                     logging.warning("ppc64 initrd %s is > 32MiB", outfile)
-- 
1.9.3



More information about the anaconda-patches mailing list