From 6de579e260805b61cb4adbe80530619309cc39b8ec3ec4565274278868cc9758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Wed, 2 Nov 2011 22:55:52 +0000 Subject: [PATCH 1/3] Accepting request 89990 from home:ptesarik:branches:Kernel:kdump upgrade to 1.4.0 OBS-URL: https://build.opensuse.org/request/show/89990 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/makedumpfile?expand=0&rev=51 --- makedumpfile-1.3.6.tar.bz2 | 3 --- makedumpfile-1.4.0.tar.bz2 | 3 +++ makedumpfile-coptflags.diff | 18 ++++++++-------- makedumpfile-supports-3.0.patch | 30 ++++++++++++++++++++++++++ makedumpfile.changes | 19 +++++++++++++++++ makedumpfile.spec | 37 ++++++++++++++++++++++++--------- 6 files changed, 88 insertions(+), 22 deletions(-) delete mode 100644 makedumpfile-1.3.6.tar.bz2 create mode 100644 makedumpfile-1.4.0.tar.bz2 create mode 100644 makedumpfile-supports-3.0.patch diff --git a/makedumpfile-1.3.6.tar.bz2 b/makedumpfile-1.3.6.tar.bz2 deleted file mode 100644 index d7fa89c..0000000 --- a/makedumpfile-1.3.6.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4a6ee891256078d6a587cfe1a3f40404f87ec23790dc48d4fef6b5b7fab550e4 -size 58324 diff --git a/makedumpfile-1.4.0.tar.bz2 b/makedumpfile-1.4.0.tar.bz2 new file mode 100644 index 0000000..9e74367 --- /dev/null +++ b/makedumpfile-1.4.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:772ff9212f6d139fab1f33fd0016e9ca1b66053dff2ca818506acb44a0665fa1 +size 81016 diff --git a/makedumpfile-coptflags.diff b/makedumpfile-coptflags.diff index 6ca1f60..667c2ab 100644 --- a/makedumpfile-coptflags.diff +++ b/makedumpfile-coptflags.diff @@ -1,11 +1,11 @@ --- - Makefile | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + Makefile | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) --- a/Makefile +++ b/Makefile -@@ -4,10 +4,10 @@ VERSION=1.3.5 - DATE=25 June 2010 +@@ -4,10 +4,10 @@ VERSION=1.4.0 + DATE=12 September 2011 CC = gcc -CFLAGS = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ @@ -15,14 +15,14 @@ -CFLAGS_ARCH = -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ +CFLAGS_ARCH = $(COPTFLAGS) -g -O2 -Wall -D_FILE_OFFSET_BITS=64 \ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE + # LDFLAGS = -L/usr/local/lib -I/usr/local/include - ARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/sun4u/sparc64/ \ -@@ -32,7 +32,7 @@ $(OBJ_ARCH): $(SRC_ARCH) +@@ -38,7 +38,7 @@ $(OBJ_ARCH): $(SRC_ARCH) $(CC) $(CFLAGS_ARCH) -c -o ./$@ ./$(@:.o=.c) - makedumpfile: $(SRC) $(OBJ_ARCH) -- $(CC) $(CFLAGS) $(OBJ_ARCH) -o $@ $< -static -ldw -lelf -lz -+ $(CC) $(CFLAGS) $(OBJ_ARCH) -o $@ $< -Wl,-Bstatic -ldw -lelf -Wl,-Bdynamic -lz + makedumpfile: $(SRC) $(OBJ_PART) $(OBJ_ARCH) +- $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -o $@ $< -static -ldw -lbz2 -lebl -ldl -lelf -lz ++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ_PART) $(OBJ_ARCH) -o $@ $< -Wl,-Bstatic -ldw -lebl -lelf $(LIBS_STATIC) -Wl,-Bdynamic -ldl -lz $(LIBS_DYNAMIC) echo .TH MAKEDUMPFILE 8 \"$(DATE)\" \"makedumpfile v$(VERSION)\" \"Linux System Administrator\'s Manual\" > temp.8 grep -v "^.TH MAKEDUMPFILE 8" makedumpfile.8 >> temp.8 mv temp.8 makedumpfile.8 diff --git a/makedumpfile-supports-3.0.patch b/makedumpfile-supports-3.0.patch new file mode 100644 index 0000000..0725ac7 --- /dev/null +++ b/makedumpfile-supports-3.0.patch @@ -0,0 +1,30 @@ +From: Petr Tesarik +Subject: Mark kernel 3.0 as supported +References: bnc#719648 + +Without the patch, makedumpfile gives the following warning: + + The kernel version is not supported. + The created dumpfile may be incomplete. + +Since makedumpfile has been successfully tested with kernel 3.0, let's +mark all 3.0 releases as supported. This is no problem, at least for +SLES, because incompatible changes are forbidden by the policy. + +Signed-off-by: Petr Tesarik + +--- + makedumpfile.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/makedumpfile.h ++++ b/makedumpfile.h +@@ -447,7 +447,7 @@ do { \ + #define KVER_MIN_SHIFT 16 + #define KERNEL_VERSION(x,y,z) (((x) << KVER_MAJ_SHIFT) | ((y) << KVER_MIN_SHIFT) | (z)) + #define OLDEST_VERSION KERNEL_VERSION(2, 6, 15)/* linux-2.6.15 */ +-#define LATEST_VERSION KERNEL_VERSION(2, 6, 36)/* linux-2.6.36 */ ++#define LATEST_VERSION KERNEL_VERSION(3, 0, 0xffff) /* linux-3.0, all releases */ + + /* + * vmcoreinfo in /proc/vmcore diff --git a/makedumpfile.changes b/makedumpfile.changes index c31bf32..f27c2cd 100644 --- a/makedumpfile.changes +++ b/makedumpfile.changes @@ -1,3 +1,22 @@ +------------------------------------------------------------------- +Wed Nov 2 22:03:33 UTC 2011 - ptesarik@suse.cz + +- Fix build on older distros. + +------------------------------------------------------------------- +Mon Oct 31 07:28:59 UTC 2011 - ptesarik@suse.cz + +- fix the specfile License tag: since ppc64.c and s390x.c are + licensed under GPL-2.0 only, the whole package cannot be GPL-2.0 + or later (bnc#727022). + +------------------------------------------------------------------- +Thu Oct 27 05:15:53 UTC 2011 - ptesarik@suse.cz + +- upgrade to makedumpfile-1.4.0. +- makedumpfile-supports-3.0.patch: Mark all kernel 3.0 releases + as supported. + ------------------------------------------------------------------- Wed Sep 22 08:13:48 UTC 2010 - ptesarik@novell.com diff --git a/makedumpfile.spec b/makedumpfile.spec index 531b317..be25307 100644 --- a/makedumpfile.spec +++ b/makedumpfile.spec @@ -1,7 +1,7 @@ # -# spec file for package makedumpfile (Version 1.3.6) +# spec file for package makedumpfile # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,22 +19,21 @@ Name: makedumpfile -BuildRequires: zlib-devel -%if 0%{?suse_version} > 1100 -BuildRequires: libdw-devel -%else -BuildRequires: libdw-devel libdw1 libelf-devel libelf0 libelf1 +BuildRequires: libdw-devel libebl-devel libelf-devel zlib-devel +%if 0%{?suse_version} >= 1140 || 0%{?sles_version} >= 11 +BuildRequires: libbz2-devel lzma-devel %endif -License: GPLv2+ -Version: 1.3.6 +License: GPL v2 only +Version: 1.4.0 Release: 1 Summary: Partial kernel dump Group: System/Kernel Url: https://sourceforge.net/projects/makedumpfile/ Source: %{name}-%{version}.tar.bz2 Patch0: %{name}-coptflags.diff +Patch1: %{name}-supports-3.0.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build -ExclusiveArch: %ix86 x86_64 ia64 ppc64 +ExclusiveArch: %ix86 x86_64 ia64 ppc64 s390x %arm %description makedumpfile is a dump program to shorten the size of dump file. It @@ -51,8 +50,26 @@ Authors: %prep %setup -q %patch0 -p1 +%patch1 -p1 %build +LIBS_STATIC= +LIBS_DYNAMIC= +if nm -u -f posix %{_libdir}/libdw.a | grep '^BZ2_bzDecompress U'; then + if [ -e %{_libdir}/libbz2.a ]; then + LIBS_STATIC="$LIBS_STATIC -lbz2" + else + LIBS_DYNAMIC="$LIBS_DYNAMIC -lbz2" + fi +fi +if nm -u -f posix %{_libdir}/libdw.a | grep '^lzma_code U'; then + if [ -e %{_libdir}/liblzma.a ]; then + LIBS_STATIC="$LIBS_STATIC -llzma" + else + LIBS_DYNAMIC="$LIBS_DYNAMIC -llzma" + fi +fi +export LIBS_STATIC LIBS_DYNAMIC make COPTFLAGS="$RPM_OPT_FLAGS" %install From 94b0ae1713a1b2fa2dd666bb6ef5ba5fea0cfde43b3384ba9172bd95a7d2c216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Thu, 3 Nov 2011 08:43:42 +0000 Subject: [PATCH 2/3] Accepting request 90011 from home:babelworx:ldig:branches:Kernel:kdump license update: GPL-2.0 SPDX format (http://www.spdx.org/licenses) OBS-URL: https://build.opensuse.org/request/show/90011 OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/makedumpfile?expand=0&rev=52 --- makedumpfile.changes | 6 ++++++ makedumpfile.spec | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/makedumpfile.changes b/makedumpfile.changes index f27c2cd..db3631a 100644 --- a/makedumpfile.changes +++ b/makedumpfile.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Nov 3 07:48:12 UTC 2011 - cfarrell@suse.com + +- license update: GPL-2.0 + SPDX format (http://www.spdx.org/licenses) + ------------------------------------------------------------------- Wed Nov 2 22:03:33 UTC 2011 - ptesarik@suse.cz diff --git a/makedumpfile.spec b/makedumpfile.spec index be25307..5d005f3 100644 --- a/makedumpfile.spec +++ b/makedumpfile.spec @@ -23,7 +23,7 @@ BuildRequires: libdw-devel libebl-devel libelf-devel zlib-devel %if 0%{?suse_version} >= 1140 || 0%{?sles_version} >= 11 BuildRequires: libbz2-devel lzma-devel %endif -License: GPL v2 only +License: GPL-2.0 Version: 1.4.0 Release: 1 Summary: Partial kernel dump From 284c12d52d66d91a3c8aa5f7f25113fc22a7350c009270a4a515621e7f5bf55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Tesa=C5=99=C3=ADk?= Date: Wed, 9 Nov 2011 17:36:07 +0000 Subject: [PATCH 3/3] - README.static: Explain why static linking of some libraries is preferred. OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/makedumpfile?expand=0&rev=53 --- README.static | 45 ++++++++++++++++++++++++++++++++++++++++++++ makedumpfile.changes | 6 ++++++ makedumpfile.spec | 1 + 3 files changed, 52 insertions(+) create mode 100644 README.static diff --git a/README.static b/README.static new file mode 100644 index 0000000..133f5ac --- /dev/null +++ b/README.static @@ -0,0 +1,45 @@ +Q: Why is makedumpfile linked statically? + +A: To save space. + +Loner answer follows. + +The secondary kernel runs in a very constrained environment. It cannot use +the whole RAM of the machine, simply because this is the data that should +be saved. Instead, it uses a special portion of RAM that is reserved for +that purpose in the primary kernel. Since this is memory that cannot be +used by the primary kernel (it is basically dead unless there is a kernel +crash, which should be a rare event), it is desirable to keep the size of +the reserved memory as small as possible. + +One thing that takes up RAM in the secondary kernel is the root file +system. Now, the makedumpfile binary is also run from this filesystem. +Consequently, initrd must also include all the dynamic libraries that +this binary links against. This can increase the size of the initrd +considerably. + +However, we don't need most of that space, because makedumpfile uses only +a fraction of all the code present in the dynamic libraries. In fact, when +makedumpfile is the only user of those libraries in the secondary kernel +environment, the other usual term for these libraries, "shared libraries", +no longer matches reality. It is not shared with anything else in the +system. On the other hand, some libraries are also used by other binaries +in the initrd, so it makes sense to link to them dynamically. + +The following libraries are shared with other tools: + + libdl + libz + +The following libraries are only used by makedumpfile, and thus should be +linked statically: + + libdw + libebl + libelf + libbz2 + liblzma + +Static versions of some of the above libraries may not be available in the +distro, so a build-time check is performed, and they fall back to linking +dynamically if necessary. diff --git a/makedumpfile.changes b/makedumpfile.changes index db3631a..5e4d8de 100644 --- a/makedumpfile.changes +++ b/makedumpfile.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 9 17:31:50 UTC 2011 - ptesarik@suse.cz + +- README.static: Explain why static linking of some libraries is + preferred. + ------------------------------------------------------------------- Thu Nov 3 07:48:12 UTC 2011 - cfarrell@suse.com diff --git a/makedumpfile.spec b/makedumpfile.spec index 5d005f3..a3e1e93 100644 --- a/makedumpfile.spec +++ b/makedumpfile.spec @@ -30,6 +30,7 @@ Summary: Partial kernel dump Group: System/Kernel Url: https://sourceforge.net/projects/makedumpfile/ Source: %{name}-%{version}.tar.bz2 +Source1: README.static Patch0: %{name}-coptflags.diff Patch1: %{name}-supports-3.0.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build