Accepting request 90830 from Kernel:kdump

License tag fixed.
See README.static for an explanation why static linking is preferred for some libraries.

OBS-URL: https://build.opensuse.org/request/show/90830
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/makedumpfile?expand=0&rev=39
This commit is contained in:
Stephan Kulow 2011-11-10 14:50:51 +00:00 committed by Git OBS Bridge
commit d9d58f9e46
7 changed files with 146 additions and 22 deletions

45
README.static Normal file
View File

@ -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.

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4a6ee891256078d6a587cfe1a3f40404f87ec23790dc48d4fef6b5b7fab550e4
size 58324

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:772ff9212f6d139fab1f33fd0016e9ca1b66053dff2ca818506acb44a0665fa1
size 81016

View File

@ -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

View File

@ -0,0 +1,30 @@
From: Petr Tesarik <ptesarik@suse.cz>
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 <ptesarik@suse.cz>
---
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

View File

@ -1,3 +1,34 @@
-------------------------------------------------------------------
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
- license update: GPL-2.0
SPDX format (http://www.spdx.org/licenses)
-------------------------------------------------------------------
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

View File

@ -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,22 @@
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-2.0
Version: 1.4.0
Release: 1
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
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 +51,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