Accepting request 222379 from Kernel:kdump
- kdump-0.8.7-nr_cpus.patch: Use nr_cpus instead of maxcpus with recent kernels. (FATE#315725). - kdump-0.8.7-bsp.patch: Add disable_cpu_apicid for BSP to the commandline (bnc#861981). - kdump-0.8.7-calibrate.patch: Implement kdump memory calibration (FATE#315241). - Added patch kdumptool_find_kernel.patch: kdumptool argument order was wrong in debug mode - Removed s390x from the list of excluded architectures. OBS-URL: https://build.opensuse.org/request/show/222379 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kdump?expand=0&rev=61
This commit is contained in:
commit
39647a47ae
49
kdump-0.8.7-bsp.patch
Normal file
49
kdump-0.8.7-bsp.patch
Normal file
@ -0,0 +1,49 @@
|
||||
From: Petr Tesarik <ptesarik@suse.cz>
|
||||
Subject: Add disable_cpu_apicid for BSP to the commandline
|
||||
References: bnc#861981
|
||||
Patch-mainline: v0.8.8
|
||||
|
||||
Since the BSP cannot be brought up in the kdump environment, and there is no
|
||||
reliable way of getting the APIC ID of an offlined CPU, it must be figured
|
||||
out by the primary kernel and passed as a command-line option.
|
||||
|
||||
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
|
||||
|
||||
---
|
||||
NEWS | 2 ++
|
||||
init/rc.kdump.functions | 13 +++++++++++--
|
||||
2 files changed, 13 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,5 +1,7 @@
|
||||
0.8.8
|
||||
-----
|
||||
+ * Add disable_cpu_apicid parameter to the command line on x86 to prevent
|
||||
+ bringing up the BSP in the kdump kernel.
|
||||
* Use nr_cpus instead of maxcpus with recent kernels.
|
||||
|
||||
0.8.7
|
||||
--- a/init/rc.kdump.functions
|
||||
+++ b/init/rc.kdump.functions
|
||||
@@ -103,9 +103,18 @@ function build_kdump_commandline()
|
||||
< /proc/cmdline)
|
||||
# Use deadline for saving the memory footprint
|
||||
commandline="$commandline elevator=deadline sysrq=yes reset_devices"
|
||||
- case `uname -i` in
|
||||
+ local arch=$(uname -i)
|
||||
+ case "$arch" in
|
||||
i?86|x86_64|ia64)
|
||||
- commandline="$commandline irqpoll maxcpus=${KDUMP_CPUS:-1}"
|
||||
+ local nr_cpus=$(cpus_param "$kdump_kernel")
|
||||
+ commandline="$commandline irqpoll ${nr_cpus}=${KDUMP_CPUS:-1}"
|
||||
+ if [ "$arch" = "x86_64" -o -z "${arch#i?86}" ]; then
|
||||
+ local boot_apicid=$(
|
||||
+ awk -F':[ \t]' '/^initial apicid[ \t]*:/ {print $2; exit}' \
|
||||
+ /proc/cpuinfo)
|
||||
+ test -n "$boot_apicid" &&
|
||||
+ commandline="$commandline disable_cpu_apicid=$boot_apicid"
|
||||
+ fi
|
||||
;;
|
||||
s390*)
|
||||
commandline="$commandline zfcp.allow_lun_scan=0"
|
200
kdump-0.8.7-calibrate.patch
Normal file
200
kdump-0.8.7-calibrate.patch
Normal file
@ -0,0 +1,200 @@
|
||||
From: Petr Tesarik <ptesarik@suse.cz>
|
||||
Subject: Implement kdump memory calibration
|
||||
References: FATE#315241
|
||||
Patch-mainline: v0.8.8
|
||||
|
||||
This command is used by yast-kdump to find out how much RAM should
|
||||
be reserved for the crash kernel.
|
||||
|
||||
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
|
||||
|
||||
---
|
||||
NEWS | 1
|
||||
kdumptool/CMakeLists.txt | 2 +
|
||||
kdumptool/calibrate.cc | 78 +++++++++++++++++++++++++++++++++++++++++++++++
|
||||
kdumptool/calibrate.h | 60 ++++++++++++++++++++++++++++++++++++
|
||||
kdumptool/main.cc | 2 +
|
||||
5 files changed, 143 insertions(+)
|
||||
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,5 +1,6 @@
|
||||
0.8.8
|
||||
-----
|
||||
+ * New command: calibrate
|
||||
* Add disable_cpu_apicid parameter to the command line on x86 to prevent
|
||||
bringing up the BSP in the kdump kernel.
|
||||
* Use nr_cpus instead of maxcpus with recent kernels.
|
||||
--- a/kdumptool/CMakeLists.txt
|
||||
+++ b/kdumptool/CMakeLists.txt
|
||||
@@ -86,6 +86,8 @@ SET(COMMON_SRC
|
||||
quotedstring.h
|
||||
multipath.cc
|
||||
multipath.h
|
||||
+ calibrate.cc
|
||||
+ calibrate.h
|
||||
)
|
||||
|
||||
add_library(common STATIC ${COMMON_SRC})
|
||||
--- /dev/null
|
||||
+++ b/kdumptool/calibrate.cc
|
||||
@@ -0,0 +1,78 @@
|
||||
+/*
|
||||
+ * (c) 2014, Petr Tesarik <ptesarik@suse.de>, SUSE LINUX Products GmbH
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License
|
||||
+ * as published by the Free Software Foundation; either version 2
|
||||
+ * of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
+ * 02110-1301, USA.
|
||||
+ */
|
||||
+#include <iostream>
|
||||
+
|
||||
+#include "subcommand.h"
|
||||
+#include "debug.h"
|
||||
+#include "calibrate.h"
|
||||
+
|
||||
+// Default reservation size depends on architecture
|
||||
+#if defined(__x86_64__)
|
||||
+# define DEF_RESERVE_MB 128
|
||||
+#elif defined(__i386__)
|
||||
+# define DEF_RESERVE_MB 128
|
||||
+#elif defined(__powerpc64__)
|
||||
+# define DEF_RESERVE_MB 256
|
||||
+#elif defined(__powerpc__)
|
||||
+# define DEF_RESERVE_MB 128
|
||||
+#elif defined(__s390x__)
|
||||
+# define DEF_RESERVE_MB 128
|
||||
+#elif defined(__s390__)
|
||||
+# define DEF_RESERVE_MB 128
|
||||
+#elif defined(__ia64__)
|
||||
+# define DEF_RESERVE_MB 512
|
||||
+#elif defined(__aarch64__)
|
||||
+# define DEF_RESERVE_MB 128
|
||||
+#elif defined(__arm__)
|
||||
+# define DEF_RESERVE_MB 128
|
||||
+#else
|
||||
+# error "No default crashkernel reservation for your architecture!"
|
||||
+#endif
|
||||
+
|
||||
+using std::cout;
|
||||
+using std::endl;
|
||||
+
|
||||
+//{{{ Calibrate ----------------------------------------------------------------
|
||||
+
|
||||
+// -----------------------------------------------------------------------------
|
||||
+Calibrate::Calibrate()
|
||||
+ throw ()
|
||||
+{}
|
||||
+
|
||||
+// -----------------------------------------------------------------------------
|
||||
+const char *Calibrate::getName() const
|
||||
+ throw ()
|
||||
+{
|
||||
+ return "calibrate";
|
||||
+}
|
||||
+
|
||||
+// -----------------------------------------------------------------------------
|
||||
+void Calibrate::execute()
|
||||
+ throw (KError)
|
||||
+{
|
||||
+ unsigned long required;
|
||||
+ Debug::debug()->trace("Calibrate::execute()");
|
||||
+
|
||||
+ required = DEF_RESERVE_MB;
|
||||
+ cout << required << endl;
|
||||
+}
|
||||
+
|
||||
+//}}}
|
||||
+
|
||||
+// vim: set sw=4 ts=4 fdm=marker et: :collapseFolds=1:
|
||||
--- /dev/null
|
||||
+++ b/kdumptool/calibrate.h
|
||||
@@ -0,0 +1,60 @@
|
||||
+/*
|
||||
+ * (c) 2014, Petr Tesarik <ptesarik@suse.de>, SUSE LINUX Products GmbH
|
||||
+ *
|
||||
+ * This program is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License
|
||||
+ * as published by the Free Software Foundation; either version 2
|
||||
+ * of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This program is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU General Public License
|
||||
+ * along with this program; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
+ * 02110-1301, USA.
|
||||
+ */
|
||||
+#ifndef CALIBRATE_H
|
||||
+#define CALIBRATE_H
|
||||
+
|
||||
+#include "subcommand.h"
|
||||
+
|
||||
+//{{{ Calibrate ----------------------------------------------------------------
|
||||
+
|
||||
+/**
|
||||
+ * Subcommand to calibrate reserved memory
|
||||
+ */
|
||||
+class Calibrate : public Subcommand {
|
||||
+
|
||||
+ public:
|
||||
+ /**
|
||||
+ * Creates a new Calibrate object.
|
||||
+ */
|
||||
+ Calibrate()
|
||||
+ throw ();
|
||||
+
|
||||
+ public:
|
||||
+ /**
|
||||
+ * Returns the name of the subcommand (calibrate).
|
||||
+ */
|
||||
+ const char *getName() const
|
||||
+ throw ();
|
||||
+
|
||||
+ /**
|
||||
+ * Executes the function.
|
||||
+ *
|
||||
+ * @throw KError on any error. No exception indicates success.
|
||||
+ */
|
||||
+ void execute()
|
||||
+ throw (KError);
|
||||
+
|
||||
+ private:
|
||||
+};
|
||||
+
|
||||
+//}}}
|
||||
+
|
||||
+#endif /* CALIBRATE_H */
|
||||
+
|
||||
+// vim: set sw=4 ts=4 fdm=marker et: :collapseFolds=1:
|
||||
--- a/kdumptool/main.cc
|
||||
+++ b/kdumptool/main.cc
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "read_ikconfig.h"
|
||||
#include "read_vmcoreinfo.h"
|
||||
#include "savedump.h"
|
||||
+#include "calibrate.h"
|
||||
|
||||
using std::cerr;
|
||||
using std::cout;
|
||||
@@ -61,6 +62,7 @@ int main(int argc, char *argv[])
|
||||
kdt.addSubcommand(new ReadIKConfig);
|
||||
kdt.addSubcommand(new ReadVmcoreinfo);
|
||||
kdt.addSubcommand(new SaveDump);
|
||||
+ kdt.addSubcommand(new Calibrate);
|
||||
|
||||
kdt.parseCommandline(argc, argv);
|
||||
kdt.readConfiguration();
|
64
kdump-0.8.7-nr_cpus.patch
Normal file
64
kdump-0.8.7-nr_cpus.patch
Normal file
@ -0,0 +1,64 @@
|
||||
From: Petr Tesarik <ptesarik@suse.cz>
|
||||
Subject: Use nr_cpus instead of maxcpus with recent kernels.
|
||||
References: FATE#315725
|
||||
Patch-mainline: v0.8.8
|
||||
|
||||
Linux 2.6.34+ has nr_cpus, which limits the number of possible CPUs
|
||||
(unlike maxcpus, which only limits the number of online CPUs at boot).
|
||||
|
||||
For compatibility, use maxcpus with older kernels.
|
||||
|
||||
Signed-off-by: Petr Tesarik <ptesarik@suse.cz>
|
||||
|
||||
---
|
||||
NEWS | 4 ++++
|
||||
init/rc.kdump.functions | 18 +++++++++++++++++-
|
||||
2 files changed, 21 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/NEWS
|
||||
+++ b/NEWS
|
||||
@@ -1,3 +1,7 @@
|
||||
+0.8.8
|
||||
+-----
|
||||
+ * Use nr_cpus instead of maxcpus with recent kernels.
|
||||
+
|
||||
0.8.7
|
||||
-----
|
||||
* Change libelf interface to elfutils (libelf1)
|
||||
--- a/init/rc.kdump.functions
|
||||
+++ b/init/rc.kdump.functions
|
||||
@@ -75,9 +75,25 @@ function remove_from_commandline()
|
||||
}
|
||||
|
||||
#
|
||||
+# Get the name of kernel parameter to limit CPUs
|
||||
+# Linux 2.6.34+ has nr_cpus, older versions must use maxcpus
|
||||
+function cpus_param()
|
||||
+{
|
||||
+ local version=$(get_kernel_version "$1")
|
||||
+ version="${version%%-*}"
|
||||
+ local verhex=$(IFS=. ; set -- $version ; printf "0x%02x%02x%02x" $1 $2 $3)
|
||||
+ if [ $(( $verhex )) -ge $(( 0x020622 )) ] ; then
|
||||
+ echo nr_cpus
|
||||
+ else
|
||||
+ echo maxcpus
|
||||
+ fi
|
||||
+}
|
||||
+
|
||||
+#
|
||||
# Builds the kdump command line from KDUMP_COMMANDLINE.
|
||||
function build_kdump_commandline()
|
||||
{
|
||||
+ local kdump_kernel="$1"
|
||||
local commandline="$KDUMP_COMMANDLINE"
|
||||
|
||||
if [ -z "$commandline" ]; then
|
||||
@@ -168,7 +184,7 @@ function load_kdump_kexec()
|
||||
rc_exit
|
||||
fi
|
||||
|
||||
- local kdump_commandline=$(build_kdump_commandline)
|
||||
+ local kdump_commandline=$(build_kdump_commandline "$kdump_kernel")
|
||||
local kexec_options=$(build_kexec_options "$kdump_kernel")
|
||||
|
||||
KEXEC_CALL="$KEXEC -p $kdump_kernel --append=\"$kdump_commandline\""
|
@ -1,3 +1,25 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 14 16:14:45 UTC 2014 - ptesarik@suse.cz
|
||||
|
||||
- kdump-0.8.7-nr_cpus.patch: Use nr_cpus instead of maxcpus with
|
||||
recent kernels. (FATE#315725).
|
||||
- kdump-0.8.7-bsp.patch: Add disable_cpu_apicid for BSP to the
|
||||
commandline (bnc#861981).
|
||||
- kdump-0.8.7-calibrate.patch: Implement kdump memory calibration
|
||||
(FATE#315241).
|
||||
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 14 12:15:14 UTC 2014 - juwolf@suse.com
|
||||
|
||||
- Added patch kdumptool_find_kernel.patch: kdumptool argument order was
|
||||
wrong in debug mode
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jan 24 02:26:20 UTC 2014 - mpost@suse.com
|
||||
|
||||
- Removed s390x from the list of excluded architectures.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jan 13 06:37:39 UTC 2014 - ptesarik@suse.cz
|
||||
|
||||
|
11
kdump.spec
11
kdump.spec
@ -47,6 +47,10 @@ PreReq: %insserv_prereq %fillup_prereq mkinitrd
|
||||
Source: %{name}-%{version}.tar.bz2
|
||||
Source2: %{name}-%{version}-rpmlintrc
|
||||
Source3: kdump.service
|
||||
Patch1: kdumptool_find_kernel.patch
|
||||
Patch2: %{name}-%{version}-nr_cpus.patch
|
||||
Patch3: %{name}-%{version}-bsp.patch
|
||||
Patch4: %{name}-%{version}-calibrate.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
# rename "kdump-helpers" (10.3) -> "kdump" (11.0/SP2)
|
||||
Provides: kdump-helpers = %{version}
|
||||
@ -59,7 +63,7 @@ Requires: kexec-tools
|
||||
%endif
|
||||
Recommends: nfs-client cifs-utils
|
||||
PreReq: coreutils sed
|
||||
ExcludeArch: s390 s390x ppc
|
||||
ExcludeArch: s390 ppc
|
||||
|
||||
%description
|
||||
kdump is a package that includes several scripts for kdump, including
|
||||
@ -84,6 +88,11 @@ Authors:
|
||||
|
||||
%prep
|
||||
%setup
|
||||
%patch1 -p0
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
|
||||
%build
|
||||
export CFLAGS="%optflags"
|
||||
export CXXFLAGS="%optflags"
|
||||
|
11
kdumptool_find_kernel.patch
Normal file
11
kdumptool_find_kernel.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- init/rc.kdump.functions.old 2014-01-13 07:35:41.000000000 +0100
|
||||
+++ init/rc.kdump.functions 2014-02-14 12:46:28.375308000 +0100
|
||||
@@ -261,7 +261,7 @@
|
||||
find_kernel_args="-D"
|
||||
fi
|
||||
|
||||
- local output=$(kdumptool find_kernel $find_kernel_args)
|
||||
+ local output=$(kdumptool $find_kernel_args find_kernel)
|
||||
if [ $? -ne 0 ] ; then
|
||||
rc_status -s
|
||||
rc_failed 6
|
Loading…
x
Reference in New Issue
Block a user