boot.img too large

1,303 views
Skip to first unread message

zoe vas

unread,
Jun 1, 2014, 8:27:25 AM6/1/14
to android...@googlegroups.com
I have compiled a kernel from source for the htc evo 4g. I get successfully the zImage.
So, when i build the whole tree, i use the zImage as kernel instead of the prebuilt kernel.

However when i build the whole android tree, i get the following error:

out/target/product/supersonic/boot.img total size is 5988352
error: out/target/product/supersonic/boot.img too large (5988352 > [5406720 - 270336])
make: *** [out/target/product/supersonic/boot.img] Error 1
make: *** Deleting file `out/target/product/supersonic/boot.img'

Searching in web, i didn't find a solution. 

I only found that the size of partitions are defined in the file device/htc/supersonic/BoardConfig.mk  but i don't know how to change them.

BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00280000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00500000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x15e00000 # limited so we enforce room to grow
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x1aba0000

BOARD_FLASH_BLOCK_SIZE := 131072

I dont know how to solve this issue. Please help!

mark gross

unread,
Jun 2, 2014, 3:58:13 PM6/2/14
to android...@googlegroups.com
Before tossing out guesses first did you verify you can reproduce the baseline build for the htc device?
There should be some site for getting the GPL fulfilment of kernel source and kernel config used by that device.  I like to start by making sure I can build what is shipped such that I can see my bits running on the target before I start with changing things.

some guesses:
* you built the kernel with the different .config options from the baseline turn debug options and any unneeded configs you know are not needed off.
* run strip --strip-debug
* try the bzImage instead of the zImage,  bzImage's are smaller. <-- likely this is what you need.

Are you sure its the kernel that is too big?  boot.img holds kernel, and initial RAM-DISK  does your ramdisk need a diet?

FWIW In one of my builds I had kernel driver modules part of my ramdisk and if I didn't run trip on the *.ko files I'd see similar issues.  But I don't think HTC does what I did WRT kernel modules so its unlikely that's your problem.


good luck.


--
--
unsubscribe: android-kerne...@googlegroups.com
website: http://groups.google.com/group/android-kernel
---
You received this message because you are subscribed to the Google Groups "Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-kerne...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
create interesting things.

JF Dionne

unread,
Jun 2, 2014, 9:14:01 PM6/2/14
to android...@googlegroups.com
I agree with most of what has been answered so far.

To get a little bit more info

Where did you get your config file and where did you get your device folder for android?

Guess both form cyanogen?

Did you check the versions for each to see if they match?

Android recently removed kernel module support. So probably your kernel is configured to build the kernel modules in the zimage but the size is not accepted by your older board config that was made for kernel modules.

zoe vas

unread,
Jun 3, 2014, 4:08:33 PM6/3/14
to android...@googlegroups.com

Thanks a lot about your quick responses.

As for mark gross comments:

What do you mean with the baseline  build for the htc device? There are many
defconfig files in the arch/arm/configs folder. I chose the supersonic_defconfig
which is for the htc 4g evo device (model supersonic). Is there some defconfig for
the baseline build or do you mean something else?

- I get the .config file by doing make ARCH=arm supersonic_defconfig.
I didn't modified the supersonic_defconfig.

- I saw that  strip --strip-debug filename removes debugging symbols from a binary.
Do you mean to run strip on every *.ko? 
However, I don't find any modules in my kernel folder.
Also, I unset CONFIG_MODULES in the .config file and i have again the same error about boot.img.

- I do in the kernel folder:
     make bzImage
and again  a zImage is produced and not a bzImage. To produce a bzImage, I found only this way in the web.



JF Dionne:
- I downloaded this version of android from Cyanogenmod:

    repo init -u git://github.com/CyanogenMod/android.git -b gingerbread


  The supersonic_defconfig is already in the arch/arm/configs   folder of the kernel source.

  You mentioned  "Did you check the versions for each to see if they match?"
   What versions to check? The version of the kernel is 2.6.32.

  
  I also tried another kernel git clone git://github.com/CyanogenMod/cm-kernel.git
    cd cm-kernel
    git checkout supersonic-kernel-2.6.34

    but i get this error:

    In function 'msm_v4l2_video_dev_init':
   drivers/media/video/msm/msm_v4l2.c:713: error: 'VID_TYPE_CAPTURE' undeclared (first use in this function)

   Therefore, i tried the version 2.6.32 which is built successfully but i face the problem with the very large boot.img.

mark gross

unread,
Jun 4, 2014, 9:33:08 AM6/4/14
to android...@googlegroups.com
if there is CM brunch target then the CM build will pick a config file and build a kernel (likely not the baseline / reference kernel for the shipping device from the OEM but, at least something someone thought worked)

Another trick to get a proper config (assuming its enabled) "adb pull /proc/config.gz" and ungzip the actual config from the device.  note: /proc/config.gz is an option they may not have enabled but if there its a life saver.  YMMV.

FWIW no moduels makes it simpler for you.

Other random thoughts I have are 
1) where did you get the kernel source *exactly*.  (git remote and branch)
2) what toolchain is getting used to compile your kernel.  how are you setting CROSS_COMPILE and ARCH on your make command line for the kernel?  and where did you get whatever toolchain in use with compiling your kernel?

make V=1 will make the kernel build more verbose around what compiler and comile time options used that could help you.


--
--
unsubscribe: android-kerne...@googlegroups.com
website: http://groups.google.com/group/android-kernel
---
You received this message because you are subscribed to the Google Groups "Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-kerne...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
create interesting things.
Reply all
Reply to author
Forward
0 new messages