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