Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Apr 2000 16:20:38 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Kenneth Wayne Culver <culverk@wam.umd.edu>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: HUGE kernel built from 3.2 CDRom
Message-ID:  <20000414162038.D53164@freebie.lemis.com>
In-Reply-To: <Pine.GSO.4.21.0004110932450.3931-100000@rac9.wam.umd.edu>
References:  <20000411155707.N26373@freebie.lemis.com> <Pine.GSO.4.21.0004110932450.3931-100000@rac9.wam.umd.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, 11 April 2000 at  9:35:52 -0400, Kenneth Wayne Culver wrote:
>> On Monday, 10 April 2000 at 23:12:04 -0400, Eric Ogren wrote:
>>> On Mon, Apr 10, 2000 at 10:58:36PM -0400, James B. Wilkinson wrote:
>>>> One of the machines in my networking lab has three Ethernet cards in it.
>>>> This seems to require a rebuild of the kernel. I edited GENERIC and added
>>>> ed1 and ed2 right after ed0. The kernel built fine, and it works ok, but it
>>>> is almost 11 MB, whereas the GENERIC kernel is 2,329,748 bytes. So I ran
>>>> strip on the new kernel, and that made it small allright, 2017520 bytes. It
>>>> still works ok, but dmesg doesn't work with it, and I forgot to try ps, but
>>>> I'll bet that it doesn't work, either. Is there something like a partial
>>>> strip that I need to do? My root filesystem is getting crowded.
>>>
>>>  By any chance did you run "config -g KERNEL" or do you have a
>>> "-g" hanging around in your /etc/make.conf somewhere? It looks like you
>>> managed to build a debug kernel, and the debugging symbols are big, as
>>> you've noticed.
>>
>>> You also noticed that stripping a kernel is going to cause Bad
>>> Things(tm) to happen; I wouldn't recommend it.
>>
>> This isn't quite correct.  Kernels with full symbols contain two
>> different kinds of symbols: global symbols and debug symbols.  Some
>> programs, such as dmesg, need the global symbols.  It's the debug
>> symbols which cause the "bloat".  Correspondingly, there are different
>> ways to strip a kernel.  Use 'strip kernel' to remove all symbols;
>> this will cause some programs to fail.  Use 'strip -g kernel' to
>> remove only the debugging symbols.
>>
>> I personally recommend keeping the debug symbols.  If you ever have a
>> panic and want to find out why, you'll need the symbols.
>>
> you don't need to do that, just keep a second copy of the kernel, and put
> the one with debug symbols someplace safe. You shouldn't run a kernel with
> debug symbols in it because it takes a lot of memory and stuff... and it
> takes forever to load when you boot... 

This is no longer correct.  The system does not load the symbols into
kernel memory, so it doesn't take up any more system memory, and the
load time is the same.

> if the kernel panics, you can just use the saved copy of the kernel
> to debug the crash dump. At least this is what the handbook says to
> do :-)

Sure, you can do that, but then you need two copies of the kernel.
Even if one is smaller than the other, you waste space, and you
increase the opportunity of kernel mismatches.

> (and who probably wrote that??? heh heh)

Jörg Wunsch.  Is that funny?

Greg
--
When replying to this message, please copy the original recipients.
For more information, see http://www.lemis.com/questions.html
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000414162038.D53164>