From eaa8d6e11dcf692917092f1a7acf0d5c5512325b Mon Sep 17 00:00:00 2001 From: Michal Toman Date: Mar 03 2015 08:48:10 +0000 Subject: backport bugfixes from upstream manager.wsgi - fix handling of kernelver add support for ppc64le and aarch64 --- diff --git a/retrace-server-add-ppc64le-aarch64.patch b/retrace-server-add-ppc64le-aarch64.patch new file mode 100644 index 0000000..856cef4 --- /dev/null +++ b/retrace-server-add-ppc64le-aarch64.patch @@ -0,0 +1,75 @@ +From d796769e317081f41f4185360969f40e5117e207 Mon Sep 17 00:00:00 2001 +From: Michal Toman +Date: Tue, 3 Mar 2015 09:30:43 +0100 +Subject: [PATCH 2/2] add support for ppc64le and aarch64 + +Signed-off-by: Michal Toman +--- + src/lib/retrace.py | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/src/lib/retrace.py b/src/lib/retrace.py +index debd4a6..772b638 100644 +--- a/src/lib/retrace.py ++++ b/src/lib/retrace.py +@@ -75,7 +75,7 @@ INPUT_ARCH_PARSER = re.compile("^[a-zA-Z0-9_]+$") + #name-version-arch (fedora-16-x86_64, rhel-6.2-i386, opensuse-12.1-x86_64) + INPUT_RELEASEID_PARSER = re.compile("^[a-zA-Z0-9]+\-[0-9a-zA-Z\.]+\-[a-zA-Z0-9_]+$") + +-CORE_ARCH_PARSER = re.compile("core file,? .*(x86-64|80386|ARM|IBM S/390|64-bit PowerPC)") ++CORE_ARCH_PARSER = re.compile("core file,? .*(x86-64|80386|ARM|aarch64|IBM S/390|64-bit PowerPC)") + PACKAGE_PARSER = re.compile("^(.+)-([0-9]+(\.[0-9]+)*-[0-9]+)\.([^-]+)$") + DF_OUTPUT_PARSER = re.compile("^([^ ^\t]*)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+)[ \t]+([0-9]+%)[ \t]+(.*)$") + DU_OUTPUT_PARSER = re.compile("^([0-9]+)") +@@ -202,9 +202,10 @@ STATUS = [ + ] + + ARCHITECTURES = set(["src", "noarch", "i386", "i486", "i586", "i686", "x86_64", +- "s390", "s390x", "ppc", "ppc64", "ppc64iseries", ++ "s390", "s390x", "ppc", "ppc64", "ppc64le", "ppc64iseries", + "armel", "armhfp", "armv5tel", "armv7l", "armv7hl", +- "armv7hnl", "sparc", "sparc64", "mips4kec", "ia64"]) ++ "armv7hnl", "aarch64", "sparc", "sparc64", "mips4kec", ++ "ia64"]) + + # armhfp is not correct, but there is no way to distinguish armv5/armv6/armv7 coredumps + # as armhfp (RPM armv7hl) is the only supported now, let's approximate arm = armhfp +@@ -218,6 +219,8 @@ ARCH_MAP = { + "x86_64": set(["x86_64"]), + "s390x": set(["s390x"]), + "ppc64": set(["ppc64"]), ++ "ppc64le": set(["ppc64le"]), ++ "aarch64": set(["aarch64"]), + } + + def now(): +@@ -335,9 +338,14 @@ def guess_arch(coredump_path): + # version the coredump is. At the moment we only support + # armv7hl / armhfp - let's approximate arm = armhfp + return "armhfp" ++ elif match.group(1) == "aarch64": ++ return "aarch64" + elif match.group(1) == "IBM S/390": + return "s390x" + elif match.group(1) == "64-bit PowerPC": ++ if "LSB" in output: ++ return "ppc64le" ++ + return "ppc64" + + result = None +@@ -357,6 +365,11 @@ def guess_arch(coredump_path): + child.kill() + child.stdout.close() + ++ # "ppc64le" matches both ppc64 and ppc64le ++ # if file magic says little endian, fix it ++ if result == "ppc64" and "LSB" in output: ++ result = "ppc64le" ++ + return result + + def guess_release(package, plugins): +-- +2.1.0 + diff --git a/retrace-server-manager-fix-kernelver.patch b/retrace-server-manager-fix-kernelver.patch new file mode 100644 index 0000000..ff22036 --- /dev/null +++ b/retrace-server-manager-fix-kernelver.patch @@ -0,0 +1,33 @@ +From 702a09da52b59edf712c23e80770964af4381688 Mon Sep 17 00:00:00 2001 +From: Harshula Jayasuriya +Date: Tue, 23 Sep 2014 11:49:00 +1000 +Subject: [PATCH 1/2] manager.wsgi: Don't treat a string as an object + +Error: + Traceback (most recent call last): + File "/usr/share/retrace-server/manager.wsgi", line 125, in application + arch = kernelver.arch + AttributeError: 'str' object has no attribute 'arch' + +Grab the arch from kernelver before it's made into a string. +--- + src/manager.wsgi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/manager.wsgi b/src/manager.wsgi +index fcd4b7e..d1765f3 100644 +--- a/src/manager.wsgi ++++ b/src/manager.wsgi +@@ -121,8 +121,8 @@ def application(environ, start_response): + except Exception as ex: + return response(start_response, "403 Forbidden", _("Please use VRA format for kernel version (e.g. 2.6.32-287.el6.x86_64)")) + +- kernelver = str(kernelver) + arch = kernelver.arch ++ kernelver = str(kernelver) + + if "notify" in get: + task.set_notify(filter(None, set(n.strip() for n in get["notify"][0].replace(";", ",").split(",")))) +-- +2.1.0 + diff --git a/retrace-server.spec b/retrace-server.spec index 5027ae3..70a5ce1 100644 --- a/retrace-server.spec +++ b/retrace-server.spec @@ -3,11 +3,13 @@ Summary: Application for remote coredump analysis Name: retrace-server Version: 1.12 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2+ Group: Applications/System URL: https://fedorahosted.org/abrt/wiki/AbrtRetraceServer Source: https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz +Patch0: %{name}-manager-fix-kernelver.patch +Patch1: %{name}-add-ppc64le-aarch64.patch BuildArch: noarch @@ -48,6 +50,8 @@ generation service over a network using HTTP protocol. %prep %setup -q +%patch0 -p1 +%patch1 -p1 %build autoconf @@ -132,6 +136,10 @@ fi %doc COPYING INSTALL README TODO %changelog +* Tue Mar 03 2015 Michal Toman 1.12-3 +- manager.wsgi - fix kernelver handling (harshula@redhat.com) +- add support for ppc64le and aarch64 + * Thu Jul 31 2014 Michal Toman 1.12-1 - do not run kmem on vmcores by default - fix group readability of vmcores