[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Can't get a Linux 3.6-rc zImage smaller than 2MB



On Wed, Sep 12, 2012 at 3:47 PM, Maciej Soltysiak <maciej@soltysiak.com> wrote:
> On Wed, Sep 12, 2012 at 1:50 AM, Luke Kenneth Casson Leighton
> <lkcl@lkcl.net> wrote:
>> On Tue, Sep 11, 2012 at 9:46 PM, Maciej Soltysiak <maciej@soltysiak.com> wrote:
>>> Hi,
>>>
>>> Was anyone successful in getting a 3.6-rc5 kernel zImage smaller than 2MB?
>>> I'm trying to fit this onto SS4000-e and I've been failing desperately
>>> for the last couple of days.
>>
>>  isn't there a parameter which allows you to select the modules that
>> go into an initrd?  hmmm.... /etc/initramfs-tools/initramfs.conf -
>> modules=most
> I'm aiming to get the kernel under 2MB and initrd under 4MB and I have
> initrd under 4MB.
> It's just the kernel too big and I've been trying to move things out to modules
> or remove completely. I honestly tried to keep things to a minimum.
>
>>  also it looks like you can specify COMPRESS=xz which, assuming you've
>> enabled xz compression in the linux kernel, would give you a bit more
>> space.
> I've been setting LZMA, I'll try with XD then.

 remember to set the appropriate config setting for adding xz
compression in the linux kernel build

>>  also are you using busybox?  again, that would likely save some
>> space, esp. if you compiled it specially and *only* with the actual
>> functions you need.
> Busybox is enabled for initrams. For the kernel I don't think it makes
> any difference if I'm using busybox or util-linux to invoke gcc
> (arm-linux-gnueabi actually from emdebian.org), maybe that's the problem?

 well, you've included busybox, but are using libc6 which is probably
1.3mb on its own.  consider finding a version that compiles with
uclibc.  you'll also need to compile libudev as well.

> Is there a recommended cross_compiling chain?

 for debian?  i'm sure one's around.  although it'd be slower i'd
consider just booting up qemu-arm and running the native arm compiler,
there?  heck, you could use the same kernel and initrd you just built.

>>  send a link to a file online where the list of files is, in the
>> initrd - it will help check what's going on here.
> Sure, initrd is here: http://pastebin.com/sdQhJxsn

 ok, yep you've cut things down drastically.  do you really need ppp
and slip?  also if you recompile busybox to use uclibc you'll need to
do udev too.

> Also, .config is here: http://pastebin.com/mvnkW2DD

ok it looks sane to me - line 1880 has "CONFIG_DEBUG_KERNEL=y" which
could make a difference, i dunno.  there's nothing unreasonable set.

# CONFIG_XZ_DEC is not set
# CONFIG_XZ_DEC_BCJ is not set

remember to try enabling those (and disabling the others, save _some_ space).

>>  .... but, just for a laugh please do tell me the size of the kernel
>> you've got.  i remember doing 2.4.24 kernels and they were only 600k.
>> we converted to 2.6.8 or thereabouts and that *immediately* shot up to
>> 900k (exactly the same config options).  hilarious.  not.
> I went down from whopping 5MB to 2.1MB

 fuck me that's insane.  i was expecting a large number but not that large.

> I also tried to use a .config file from
> linux-image-3.2.0-3-iop32x_3.2.23-1_armel.deb
> but during make it asked for a bunch of new stuff to which I said 'N'
> and it's still is a big image.

 i'm not impressed.  what the fuck's going on with the linux kernel??
this is really bad news for embedded systems.  sure it's fine for x86
(just checking the 2.6.39-2-amd64 kernel on my machine and
vmlinuz-2.6-36-2-amd64 is 2.9mb)

l.


Reply to: