[Buildroot] Kernel zImage under 1MB

Peter Korsgaard peter at korsgaard.com
Wed Jun 10 08:18:51 UTC 2015


>>>>> "Michal" == Michal Gonda <gonda.miso at gmail.com> writes:

 > Thank you Yegor for link.
 > Hi Peter,

 > Yes I ment 1MB, sorry for the typo :)
 > To specify little bit more the setup. Altera SoC cyclon 5 arm 9.
 > 1GB sdRam but unfortunatelly just around ~6MB qspi flash for kernel +
 > rootfs image.

6MB? I thought you said 1MB for kernel+rootfs? 6MB is a lot more doable
with minimal effort.

 > But what you described is exactly what I need to accomplish.
 > A static uClibc based build with busybox +
 > dropbear as smallest possible image is perfect.
 > As you said I can drop probably more later on but few kB here and there if
 > kernel is ~1MB is perfect.
 > Even better ~450kB as you did.

Notice that the 450KB was for the rootfs. I don't know how big your
socfgpa kernel image is, but I would guess it is significantly bigger
than 1MB even with XZ compression?

 > If you have a time could you briefly point out the steps and parts I should
 > focused on ?

For the kernel? Basically just turn off all options that you don't need
and compress the kernel with XZ (config KERNEL_XZ).

For Buildroot just enable static linking (Build
options->libraries->static only) and only busybox+dropbear. For
filesystem you can either use an initramfs embedded in the kernel or
squashfs (with XZ compression).

 > As a question aside, Is it enough just
 > "make manuconfig" and "make" rebuild the kernel and rootfs or do i need to

Buildroot doesn't track changes in the configuration file / what files
were added by a package, so it will not remove a package if you do a
build and then use menuconfig to remove the package again.

It WILL rebuild the kernel or busybox after you used make
linux-menuconfig or make busybox-menuconfig to tweak the configuration.

-- 
Venlig hilsen,
Peter Korsgaard 



More information about the buildroot mailing list