RE: System.map and .config in zImage (was Re: A couple "normal u

Daniel A. Taylor (danielt@dgii.com)
Mon, 03 Feb 1997 10:22:35 -0600 (CST)


Aren't things like this what the .comments and .notes sections
of the ELF binaries are intended for? I do not believe that they
are loaded into memory, so it would only increase the disk footprint.

Note that I haven't researched this thoroughly, so feel free
to flame me if I'm wrong.

On 01-Feb-97 Ion Badulescu scribed:
>On Fri, 31 Jan 1997, Jim Nance wrote:
>
>> How about slipping a compressed copy of System.map and .Config into
the
>> compressed kernel image, but not do anything with them at boot time
.
>> This way they do not take up any kernel space, but you could still
extract
>> they with some sort of utility if you wanted to.
>
>Just appending them to zImage seems to be fine with lilo, I assume lo
adlin
>won't have problems either. This way they don't get loaded at boot ti
me,
>and a script can extract them from zImage easily; the script could be
>called from the rc.* scripts to generate System.map on the fly.
>
>The size of zImage increases by 25-30k, which is no big deal.
>
>See the attached patched for a (working) example, and feel free to im
prove
>upon it. :-)
>
>
>Ionut
>
>--
> It is better to keep your mouth shut and be thought a fool,
> than to open it and remove all doubt.
>
>--- linux-2.1.24/arch/i386/boot/Makefile.old Sat Feb 1 01:47:41 1997
>+++ linux-2.1.24/arch/i386/boot/Makefile Sat Feb 1 01:40:34 1997
>@@ -21,6 +21,8 @@
> $(OBJCOPY) compressed/vmlinux compressed/vmlinux.out; \
> fi
> tools/build bootsect setup compressed/vmlinux.out $(ROOT_DEV) > zIm
age
>+ (echo -e '\n-- start .config file --'; gzip -c $(TOPDIR)/.config) >
> zImage
>+ (echo -e '\n-- start System.map file --'; gzip -c $(TOPDIR)/System.
map) >> zImage
> sync
>
> bzImage: $(CONFIGURE) bbootsect setup compressed/bvmlinux tools/bbui
ld
>@@ -30,6 +32,8 @@
> $(OBJCOPY) compressed/bvmlinux compressed/bvmlinux.out; \
> fi
> tools/bbuild bbootsect setup compressed/bvmlinux.out $(ROOT_DEV) >
bzImage
>+ (echo -e '\n-- start .config file --'; gzip -c $(TOPDIR)/.config) >
> bzImage
>+ (echo -e '\n-- start System.map file --'; gzip -c $(TOPDIR)/System.
map) >> bzImage
> sync
>
> compressed/vmlinux: $(TOPDIR)/vmlinux
>--- linux-2.1.24/scripts/analyse_kernel.pl.old Sat Feb 1 01:48:11 19
97
>+++ linux-2.1.24/scripts/analyse_kernel.pl Sat Feb 1 01:46:17 1997
>@@ -0,0 +1,18 @@
>+#!/usr/bin/perl
>+if ($#ARGV == -1) {
>+ die "Usage: $0 <compressed-kernel-file>\n";
>+}
>+open(ZIMAGE, "<$ARGV[0]") || die "Cannot open kernel file $ARGV[0].\
n";
>+open(OUTPUT, ">/dev/null");
>+while (<ZIMAGE>) {
>+ if (m|^-- start .config file --$|) {
>+ close OUTPUT;
>+ open(OUTPUT, "|gzip -cd >.config 2>/dev/null") || die "Cannot crea
te .config\n";
>+ } elsif (m|^-- start System.map file --$|) {
>+ close OUTPUT;
>+ open(OUTPUT, "|gzip -cd >System.map 2>/dev/null") || die "Cannot c
reate System.map\n";
>+ } else {
>+ print OUTPUT $_;
>+ }
>+}
>+close OUTPUT;
>

Daniel Taylor Digi International Tech Support