Advice on decreasing kernel size

4 views
Skip to first unread message

ernstoud

unread,
Feb 7, 2010, 6:03:21 PM2/7/10
to Bifferboard
I have 833 bytes spare kernel space in a 1 Mb. BB (slackware 2.6.32).
Does not leave a lot of room for something extra... like NFS support.

Trying to shrink the kernel is a trial and error exercise taking ages.
Has someone here found out how to shrink bzImage by say 50 kb by
removing a rarely used feature?

Would ext2 instead of ext3 help?

There is a wiki on this subject (using the size command on built-in.o
modules) but the obvious outcome is that drivers take the most
space... but which ones can safely be taken out?

Any advice?

Rumen Telbizov

unread,
Feb 7, 2010, 6:34:30 PM2/7/10
to biffe...@googlegroups.com
Hi,

1MB is pretty tight already.
Have you thought about getting one of the 8MB models ?
It does make a big difference :)

On the other hand ... what about network boot? Is it supported on the
old models? Maybe you can download a 1MB+ kernel over TFTP
and boot from it rather than worrying for the local flash size?!

Just my 0.02 cad.

Cheers,
Rumen Telbizov


--
You received this because you are subscribed to the "Bifferboard" Google group - honest!
To unsubscribe from this group, send email to bifferboard...@googlegroups.com

ernstoud

unread,
Feb 8, 2010, 5:43:34 AM2/8/10
to Bifferboard
Ah, silly me. Completely overlooked the kexec that works fine on
slackware. So I can use Biff's bzImage that runs /boot/kexec. I'll go
that route.

Ernst

On Feb 8, 12:34 am, Rumen Telbizov <telbi...@gmail.com> wrote:
> Hi,
>
> 1MB is pretty tight already.
> Have you thought about getting one of the 8MB models ?
> It does make a big difference :)
>
> On the other hand ... what about network boot? Is it supported on the
> old models? Maybe you can download a 1MB+ kernel over TFTP
> and boot from it rather than worrying for the local flash size?!
>
> Just my 0.02 cad.
>
> Cheers,
> Rumen Telbizov
>

> On Sun, Feb 7, 2010 at 3:03 PM, ernstoud <ernst...@gmail.com> wrote:
> > I have 833 bytes spare kernel space in a 1 Mb. BB (slackware 2.6.32).
> > Does not leave a lot of room for something extra... like NFS support.
>
> > Trying to shrink the kernel is a trial and error exercise taking ages.
> > Has someone here found out how to shrink bzImage by say 50 kb by
> > removing a rarely used feature?
>
> > Would ext2 instead of ext3 help?
>
> > There is a wiki on this subject (using the size command on built-in.o
> > modules) but the obvious outcome is that drivers take the most
> > space... but which ones can safely be taken out?
>
> > Any advice?
>
> > --
> > You received this because you are subscribed to the "Bifferboard" Google
> > group - honest!
> > To unsubscribe from this group, send email to

> > bifferboard...@googlegroups.com<bifferboard%2Bunsu...@googlegroups.com>

biff...@yahoo.co.uk

unread,
Feb 8, 2010, 7:38:13 AM2/8/10
to Bifferboard

On Feb 7, 11:03 pm, ernstoud <ernst...@gmail.com> wrote:

> Would ext2 instead of ext3 help?

Definitely. But be careful with the 'iterative' build experiments:
1. make menuconfig
2. make
3. ls -l bzImage
4. Goto 1

When you take something out, it doesn't always result in the size
reduction you expected, it depends what you take out, and I can swear
I've done a complete rebuild from clean, with the same kernel config
and it resulted in a different size kernel compared to one where I
arrived at the final config through several different configs one
after another.

Don't forget to take out math emulation (in case you are not already),
that saves a bit. You can go a bit further with some debugging
options, if you are sure you won't get any Ooops - that saves some
space.

regards,
Biff.

Mike

unread,
Feb 9, 2010, 10:57:42 AM2/9/10
to Bifferboard
There is a menuconfig option to specify optimizing the kernel for
size.
My kernel was initially over the magical limit, but was able to
substantially
decrease the size.
I believe the option is
CONFIG_CC_OPTIMIZE_FOR_SIZE

Also, I'de definitely stay with ext3 because it is a journeled fs.

Andrew Scheller

unread,
Feb 9, 2010, 12:03:15 PM2/9/10
to biffe...@googlegroups.com
> Trying to shrink the kernel is a trial and error exercise taking ages.
> Has someone here found out how to shrink bzImage by say 50 kb by
> removing a rarely used feature?
>
> There is a wiki on this subject (using the size command on built-in.o
> modules) but the obvious outcome is that drivers take the most
> space... but which ones can safely be taken out?

I did some googling and the best I was able to find was the
(now-defunct?) 'Linux Tiny' project, and http://elinux.org/System_Size
which appears to be the wiki that ernstoud is talking about.

There seems to be more focus on tweaking the kernel-in-memory size
than on tweaking the kernel-on-disk size...
(which makes sense, given that disk space is usually more abundant
than memory space)

Lurch

Reply all
Reply to author
Forward
0 new messages