Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Oct 1999 10:20:51 -0600
From:      Greg Lehey <grog@lemis.com>
To:        bill slaybaugh <slay3241@bright.net>, FreeBSD Questions <questions@freebsd.org>, Jeff Gray <jwg@netbox.com>, "Jason C. Wells" <jcwells@u.washington.edu>
Subject:   Re: newbie kernel question-
Message-ID:  <19991025102051.16442@mojave.worldwide.lemis.com>
In-Reply-To: <3810879B.EC8F4DB3@bright.net>; from bill slaybaugh on Fri, Oct 22, 1999 at 11:49:47AM -0400
References:  <3810879B.EC8F4DB3@bright.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, 22 October 1999 at 11:49:47 -0400, bill slaybaugh wrote:
> I am a recent entry to the FreeBSD realm, having used several
> versions and distributions of Linux.
> Using 3.2, I just built my first custom kernel.  Nothing fancy;
> pretty much just turning off devices and options that weren't
> needed.  I was pretty surprised when the size of the new kernel
> came back as 5980783, when the generic kernel had been 2329748.
> It does load faster, what with skipping unnecessary probing.
> Why so much larger than the generic?
> This is probably a classic newbie misunderstanding - -
> and I'm in new territory.

On Friday, 22 October 1999 at 11:41:58 -0700, Jeff Gray wrote:
>>
>> You probably have a debug kernel with symbols built into it. I think you
>> can "strip -g kernel" but it has been a while.
>
> Have never tried this so I wish to be a bit careful.
>
> Looking at man strip and the archives, for ELF kernels
>  cd /
>  strip -g --strip-debug kernel

Use one option or the other.  They're equivalent.

> Nothing else required, this will reduce the size of the object file
> /kernel
>
> This is a real good thing if it is safe, for those with / partitions that
> are too small.
>
> Safe?  Any other steps?

It's safe, and that's all you need to do.  But.

The real purpose of a debug kernel is to have information needed for
debugging a system if you have a crash.  A lot of people say "but
FreeBSD never crashes", and they're almost right.  When it does,
however, it's almost impossible to find out why if you don't have a
debug kernel.

On the face of it, the best idea is to have a larger root file system
which can take a debug kernel.  A typical debug kernel weighs in at
round about 10MB, compared to about 2.2 MB for a non-debug kernel.
Expect both values to grow; I'd guess that a 50 MB root file system
will do for the foreseeable future.  If you leave the kernel in the
root file system as a debug kernel, you don't have to worry about
wiping away your sys/compile/MYKERNEL directory, which would save
about 30 MB per kernel.  Don't worry about the size of the kernel; the
bootstrap loads only the parts which are needed, not including the
symbols.

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?19991025102051.16442>