Re: kernels gettin' bigger

Tobias Gruetzmacher <[email protected]> Fri, 20 Feb 2004 23:21:32 +0100
Newsgroups gmane.linux.bbc.devel
Message-ID <[email protected]>
Hi,

let me introduce myself first: I'm monitoring your project for I while
now and thought it would be a good time to contribute a little bit. I'm
a student in Germany and amember of the development team of the floppy
router fli4l (http://fli4l.de/) - mainly successful in Germany because
we support ISDN and DSL but currently no modems and our documentation is
written in German and the English translation is not very up-to-date
(that may change in the future...).


 Am Fri, 2 Jan 2004 20:27:41 -0800 schrieb Nick Moffitt:
> So we need to upgrade our kernel, and that means stripping it down to
> a useful size.  This is super tough, and may not even be possible once
> we play with 2.6.

In the fli4l development process we have evaluated some strategies to
get the kernel very small. Mainly the following were successful:

- Using -Os in the kernel Makefile
- bzip2ing the kernel
   (http://freehost03.websamba.com/chrissicool/ I think)
- really new: stripping unneeded symbols from kernel modules.
  The relevant parts of our kernel build script:

--- CUT ---
get_needed_symbols ()
{
    for symbol in `modinfo -p $1 | cut -d " " -f 1,1`
    do
        echo -n " -K $symbol "
    done
}

strip_modules ()
{
    cd $instdir/lib/modules/$version/kernel
    for i in `find . -name *.o`
    do
        needed_symbols=`get_needed_symbols $i`
        echo "$i: needed symbols -- $needed_symbols"
        strip --strip-unneeded $needed_symbols $i
    done
}
--- CUT ---

To keep programs and libraries small, we mostly stick to alternative
tools, which are designed for embedded usage: uclibc instead of glibc,
dropbear instead of OpenSSH, busybox, no C++ libs or programs.

I hope I helped a little bit.

Greetings Tobi

-- 
GPG-Key 0xE2BEA341 - signed/encrypted mail preferred
My, oh so small, homepage: http://portfolio16.de/
http://www.fli4l.de/ - ISDN- & DSL-Router on one disk!
Registered FLI4L-User #00000003