|
Michal Toman |
c99fcf2 |
From d796769e317081f41f4185360969f40e5117e207 Mon Sep 17 00:00:00 2001
|
|
Michal Toman |
c99fcf2 |
From: Michal Toman <michal.toman@gmail.com>
|
|
Michal Toman |
c99fcf2 |
Date: Tue, 3 Mar 2015 09:30:43 +0100
|
|
Michal Toman |
c99fcf2 |
Subject: [PATCH 2/2] add support for ppc64le and aarch64
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
Signed-off-by: Michal Toman <michal.toman@gmail.com>
|
|
Michal Toman |
c99fcf2 |
---
|
|
Michal Toman |
c99fcf2 |
src/lib/retrace.py | 19 ++++++++++++++++---
|
|
Michal Toman |
c99fcf2 |
1 file changed, 16 insertions(+), 3 deletions(-)
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
diff --git a/src/lib/retrace.py b/src/lib/retrace.py
|
|
Michal Toman |
c99fcf2 |
index debd4a6..772b638 100644
|
|
Michal Toman |
c99fcf2 |
--- a/src/lib/retrace.py
|
|
Michal Toman |
c99fcf2 |
+++ b/src/lib/retrace.py
|
|
Michal Toman |
c99fcf2 |
@@ -75,7 +75,7 @@ INPUT_ARCH_PARSER = re.compile("^[a-zA-Z0-9_]+$")
|
|
Michal Toman |
c99fcf2 |
#name-version-arch (fedora-16-x86_64, rhel-6.2-i386, opensuse-12.1-x86_64)
|
|
Michal Toman |
c99fcf2 |
INPUT_RELEASEID_PARSER = re.compile("^[a-zA-Z0-9]+\-[0-9a-zA-Z\.]+\-[a-zA-Z0-9_]+$")
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
-CORE_ARCH_PARSER = re.compile("core file,? .*(x86-64|80386|ARM|IBM S/390|64-bit PowerPC)")
|
|
Michal Toman |
c99fcf2 |
+CORE_ARCH_PARSER = re.compile("core file,? .*(x86-64|80386|ARM|aarch64|IBM S/390|64-bit PowerPC)")
|
|
Michal Toman |
c99fcf2 |
PACKAGE_PARSER = re.compile("^(.+)-([0-9]+(\.[0-9]+)*-[0-9]+)\.([^-]+)$")
|
|
Michal Toman |
c99fcf2 |
DF_OUTPUT_PARSER = re.compile("^([^ ^\t]*)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+%)[ \t]+(.*)$")
|
|
Michal Toman |
c99fcf2 |
DU_OUTPUT_PARSER = re.compile("^([0-9]+)")
|
|
Michal Toman |
c99fcf2 |
@@ -202,9 +202,10 @@ STATUS = [
|
|
Michal Toman |
c99fcf2 |
]
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
ARCHITECTURES = set(["src", "noarch", "i386", "i486", "i586", "i686", "x86_64",
|
|
Michal Toman |
c99fcf2 |
- "s390", "s390x", "ppc", "ppc64", "ppc64iseries",
|
|
Michal Toman |
c99fcf2 |
+ "s390", "s390x", "ppc", "ppc64", "ppc64le", "ppc64iseries",
|
|
Michal Toman |
c99fcf2 |
"armel", "armhfp", "armv5tel", "armv7l", "armv7hl",
|
|
Michal Toman |
c99fcf2 |
- "armv7hnl", "sparc", "sparc64", "mips4kec", "ia64"])
|
|
Michal Toman |
c99fcf2 |
+ "armv7hnl", "aarch64", "sparc", "sparc64", "mips4kec",
|
|
Michal Toman |
c99fcf2 |
+ "ia64"])
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
# armhfp is not correct, but there is no way to distinguish armv5/armv6/armv7 coredumps
|
|
Michal Toman |
c99fcf2 |
# as armhfp (RPM armv7hl) is the only supported now, let's approximate arm = armhfp
|
|
Michal Toman |
c99fcf2 |
@@ -218,6 +219,8 @@ ARCH_MAP = {
|
|
Michal Toman |
c99fcf2 |
"x86_64": set(["x86_64"]),
|
|
Michal Toman |
c99fcf2 |
"s390x": set(["s390x"]),
|
|
Michal Toman |
c99fcf2 |
"ppc64": set(["ppc64"]),
|
|
Michal Toman |
c99fcf2 |
+ "ppc64le": set(["ppc64le"]),
|
|
Michal Toman |
c99fcf2 |
+ "aarch64": set(["aarch64"]),
|
|
Michal Toman |
c99fcf2 |
}
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
def now():
|
|
Michal Toman |
c99fcf2 |
@@ -335,9 +338,14 @@ def guess_arch(coredump_path):
|
|
Michal Toman |
c99fcf2 |
# version the coredump is. At the moment we only support
|
|
Michal Toman |
c99fcf2 |
# armv7hl / armhfp - let's approximate arm = armhfp
|
|
Michal Toman |
c99fcf2 |
return "armhfp"
|
|
Michal Toman |
c99fcf2 |
+ elif match.group(1) == "aarch64":
|
|
Michal Toman |
c99fcf2 |
+ return "aarch64"
|
|
Michal Toman |
c99fcf2 |
elif match.group(1) == "IBM S/390":
|
|
Michal Toman |
c99fcf2 |
return "s390x"
|
|
Michal Toman |
c99fcf2 |
elif match.group(1) == "64-bit PowerPC":
|
|
Michal Toman |
c99fcf2 |
+ if "LSB" in output:
|
|
Michal Toman |
c99fcf2 |
+ return "ppc64le"
|
|
Michal Toman |
c99fcf2 |
+
|
|
Michal Toman |
c99fcf2 |
return "ppc64"
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
result = None
|
|
Michal Toman |
c99fcf2 |
@@ -357,6 +365,11 @@ def guess_arch(coredump_path):
|
|
Michal Toman |
c99fcf2 |
child.kill()
|
|
Michal Toman |
c99fcf2 |
child.stdout.close()
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
+ # "ppc64le" matches both ppc64 and ppc64le
|
|
Michal Toman |
c99fcf2 |
+ # if file magic says little endian, fix it
|
|
Michal Toman |
c99fcf2 |
+ if result == "ppc64" and "LSB" in output:
|
|
Michal Toman |
c99fcf2 |
+ result = "ppc64le"
|
|
Michal Toman |
c99fcf2 |
+
|
|
Michal Toman |
c99fcf2 |
return result
|
|
Michal Toman |
c99fcf2 |
|
|
Michal Toman |
c99fcf2 |
def guess_release(package, plugins):
|
|
Michal Toman |
c99fcf2 |
--
|
|
Michal Toman |
c99fcf2 |
2.1.0
|
|
Michal Toman |
c99fcf2 |
|