From 186915d7a97fbb1d1a2050cdf9f396f59503f7ff547bfa4d8290387596607390 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sat, 7 Feb 2009 07:54:33 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/kexec-tools?expand=0&rev=69 --- kexec-tools-ppc64-reinit.diff | 68 +++++++++++++++++++++++++++++++++++ kexec-tools.changes | 10 ++++++ kexec-tools.spec | 10 ++++-- 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 kexec-tools-ppc64-reinit.diff diff --git a/kexec-tools-ppc64-reinit.diff b/kexec-tools-ppc64-reinit.diff new file mode 100644 index 0000000..d5c10c6 --- /dev/null +++ b/kexec-tools-ppc64-reinit.diff @@ -0,0 +1,68 @@ +From: Chandru S +Subject: [PATCH] powerpc: initialize drconf variables +References: bnc #468571 + +The ppc64-memory-ranges-dynamic.diff patch which added +realloc_memory_ranges() code to kexec-tools somehow removed +the initialization of lmb-size and num_of_lmbs required in +case of /proc/ibm,dynamic-reconfiguration-memory node. +Add the code here to initialize them back again in kexec-tools + +Signed-off-by: Chandru S +Acked-by: Bernhard Walle + +--- + kexec/arch/ppc64/kexec-ppc64.c | 27 +++++++++++++++++++++++++-- + 1 file changed, 25 insertions(+), 2 deletions(-) + +--- a/kexec/arch/ppc64/kexec-ppc64.c ++++ b/kexec/arch/ppc64/kexec-ppc64.c +@@ -96,7 +96,7 @@ err1: + + } + +-static int realloc_memory_ranges() ++static int realloc_memory_ranges(void) + { + size_t memory_range_len; + +@@ -150,6 +150,23 @@ static int get_dyn_reconf_base_ranges(vo + FILE *file; + int i, n; + ++ strcpy(fname, "/proc/device-tree/"); ++ strcat(fname, "ibm,dynamic-reconfiguration-memory/ibm,lmb-size"); ++ if ((file = fopen(fname, "r")) == NULL) { ++ perror(fname); ++ return -1; ++ } ++ if (fread(buf, 1, 8, file) != 8) { ++ perror(fname); ++ fclose(file); ++ return -1; ++ } ++ /* ++ * lmb_size, num_of_lmbs(global variables) are ++ * initialized once here. ++ */ ++ lmb_size = ((uint64_t *)buf)[0]; ++ fclose(file); + + strcpy(fname, "/proc/device-tree/"); + strcat(fname, +@@ -158,8 +175,14 @@ static int get_dyn_reconf_base_ranges(vo + perror(fname); + return -1; + } ++ /* first 4 bytes tell the number of lmbs */ ++ if (fread(buf, 1, 4, file) != 4) { ++ perror(fname); ++ fclose(file); ++ return -1; ++ } ++ num_of_lmbs = ((unsigned int *)buf)[0]; + +- fseek(file, 4, SEEK_SET); + for (i = 0; i < num_of_lmbs; i++) { + if ((n = fread(buf, 1, 24, file)) < 0) { + perror(fname); diff --git a/kexec-tools.changes b/kexec-tools.changes index b3a2646..5094feb 100644 --- a/kexec-tools.changes +++ b/kexec-tools.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Feb 5 13:06:38 CET 2009 - bwalle@suse.de + +- Re-initialize drconf variables for PPC64 (bnc #468571). + +------------------------------------------------------------------- +Wed Feb 4 12:23:50 CET 2009 - tiwai@suse.de + +- fix build failure due to missing xsltproc + ------------------------------------------------------------------- Fri Jan 16 18:57:47 CET 2009 - bwalle@suse.de diff --git a/kexec-tools.spec b/kexec-tools.spec index 6e1aa6d..14a3a4a 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -29,7 +29,7 @@ PreReq: %insserv_prereq %fillup_prereq AutoReqProv: on Summary: Tools for fast kernel loading Version: 2.0.0 -Release: 51 +Release: 54 Source: %{name}-%{version}.tar.bz2 Source1: kexec-bootloader Source2: kexec-bootloader.8.txt @@ -56,12 +56,13 @@ Patch17: %{name}-ppc64-memory-ranges-dynamic.diff Patch18: %{name}-ppc64-dynamic-fix-1.diff Patch19: %{name}-ppc64-dynamic-fix-2.diff Patch20: %{name}-ppc64-dynamic-fix-3.diff +Patch21: %{name}-ppc64-reinit.diff Url: http://ftp.kernel.org/pub/linux/kernel/people/horms/kexec-tools/ BuildRoot: %{_tmppath}/%{name}-%{version}-build #!BuildIgnore: fop BuildRequires: zlib-devel %if 0%{?suse_version} >= 1110 -BuildRequires: asciidoc +BuildRequires: asciidoc libxslt %endif %ifarch %ix86 x86_64 BuildRequires: xen-devel @@ -107,6 +108,7 @@ Authors: %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 %build %{?suse_update_config -f} @@ -174,6 +176,10 @@ install -m 0755 kexec.init ${RPM_BUILD_ROOT}/etc/init.d/kexec %endif %changelog +* Thu Feb 05 2009 bwalle@suse.de +- Re-initialize drconf variables for PPC64 (bnc #468571). +* Wed Feb 04 2009 tiwai@suse.de +- fix build failure due to missing xsltproc * Fri Jan 16 2009 bwalle@suse.de - The dynamic reallocation for PPC64 broke kdump completely. Fix the patch so that dynamic reallocation actually works