Android kernel size

899 views
Skip to first unread message

Michal Suchanek

unread,
Jun 4, 2013, 5:42:11 AM6/4/13
to linux-sunxi
Hello,

I tried to build an android kernel with a more complete config and
currently the size is

kernel image 4.3M

modules 224M (down from 258M of the general Linux config)

most obvious offenders:

drivers/media 60M
out of that:
drivers/media/video 25M
drivers/media/video/sun4i_csi 2.8M
drivers/media/radio 2.7M
drivers/media/rc 4.9M
drivers/media/dvb 25M
drivers/media/common/tuners 3.3M

drivers/net/wireless 71M
drivers/net/wimax 3.2M
drivers/net/usb 5.2M
drivers/usb/serial 8.8M

drivers/staging 13M

drivers/hid 5.4M
drivers/input 11M

sound/usb 2.9M

drivers/scsi 4.3M
drivers/md 4.2M

drivers/rtc 3.4M

Removing some more drivers without losing much functionality is
possible but overall around 130M of drivers are for features people
are repeatedly asking about.

Thanks

Michal

Roman Mamedov

unread,
Jun 4, 2013, 5:54:04 AM6/4/13
to linux...@googlegroups.com, hram...@gmail.com
On Tue, 4 Jun 2013 11:42:11 +0200
Michal Suchanek <hram...@gmail.com> wrote:

> Hello,
>
> I tried to build an android kernel with a more complete config and
> currently the size is
>
> kernel image 4.3M
>
> modules 224M (down from 258M of the general Linux config)
>

Check if you have CONFIG_DEBUG_INFO enabled. It causes much larger binary
modules to be generated.

Comparing a random one with mine:

> most obvious offenders:
...
> drivers/media/dvb 25M

# find /lib/modules/3.4.29-20130418.1754-s-rm5+/kernel/drivers/media/dvb/ -type f | wc -l
88

# du -hsc /lib/modules/3.4.29-20130418.1754-s-rm5+/kernel/drivers/media/dvb/
2.0M /lib/modules/3.4.29-20130418.1754-s-rm5+/kernel/drivers/media/dvb/
2.0M total

--
With respect,
Roman
signature.asc

Hans de Goede

unread,
Jun 4, 2013, 6:01:32 AM6/4/13
to linux...@googlegroups.com, Roman Mamedov, hram...@gmail.com
Hi,

On 06/04/2013 11:54 AM, Roman Mamedov wrote:
> On Tue, 4 Jun 2013 11:42:11 +0200
> Michal Suchanek <hram...@gmail.com> wrote:
>
>> Hello,
>>
>> I tried to build an android kernel with a more complete config and
>> currently the size is
>>
>> kernel image 4.3M
>>
>> modules 224M (down from 258M of the general Linux config)
>>
>
> Check if you have CONFIG_DEBUG_INFO enabled. It causes much larger binary
> modules to be generated.

Yes, you likely have CONFIG_DEBUG_INFO enabled, besides disabling it and
recompiling everything, you can also do:

find <path-to-modules-dir> -name "*.ko" -exec arm-linux-gnu-strip --strip-debug '{}' \;

This assumes you're doing the stripping on your build machine, not on the
actual Axx itself.

Regards,

Hans

Michal Suchanek

unread,
Jun 4, 2013, 6:22:00 AM6/4/13
to Hans de Goede, linux-sunxi, Roman Mamedov
Yes, I have debug info enabled.

Is it reasonable to build android images with debug disabled by default?

Thanks

Michal
Reply all
Reply to author
Forward
0 new messages