Shortcut for building AOSP tree with new kernel

980 views
Skip to first unread message

Fred

unread,
Mar 13, 2014, 4:02:32 PM3/13/14
to android-...@googlegroups.com
Hi,
 
I am making some test building the AOSP tree of one of the branch of kitkat for a pandaboard, I did it using the prebuilt version of the kernel. Then I wanted to build a compatible kernel and create android build with this new kernel.
 
After build the kernel I placed the kernel file under /dev/ti/panda/kernel and just type make clean and then make. This will build the AOSP tree again and i will get my new kernel in the build but i will take quite some time.
 
I guess there is a smarter (and faster) way to create differents android builds when the only change is the kernel. Have any of you solved this?
 
Thanks and regards.
 
Fred.

Benoit Fouet

unread,
Mar 17, 2014, 9:14:54 AM3/17/14
to Fred, android-...@googlegroups.com
Hi,


On Thu, Mar 13, 2014 at 01:02:32PM -0700, Fred wrote:
> Hi,
>
> I am making some test building the AOSP tree of one of the branch of kitkat
> for a pandaboard, I did it using the prebuilt version of the kernel. Then I
> wanted to build a compatible kernel and create android build with this new
> kernel.
>
> After build the kernel I placed the kernel file under /dev/ti/panda/kernel
> and just type *make clean* and then *make.* This will build the AOSP tree
> again and i will get my new kernel in the build but i will take quite some
> time.
>
> I guess there is a smarter (and faster) way to create differents android
> builds when the only change is the kernel. Have any of you solved this?
>

Have you tried 'make bootimage-nodeps' (see build/core/main.mk)

--
Ben

JF Dionne

unread,
Mar 17, 2014, 2:57:16 PM3/17/14
to android-...@googlegroups.com, Fred
make bootimage OR delete the kernel and boot.img files in your out folder and rerun make

Dave Turvene

unread,
Mar 18, 2014, 9:56:21 AM3/18/14
to android-...@googlegroups.com
On Thursday, March 13, 2014 4:02:32 PM UTC-4, Fred wrote:
After build the kernel I placed the kernel file under /dev/ti/panda/kernel and just type make clean and then make. This will build the AOSP tree again and i will get my new kernel in the build but i will take quite some time.
 
I guess there is a smarter (and faster) way to create differents android builds when the only change is the kernel. Have any of you solved this?

I did some pandaboard kernel development back when and found the makefiles are best structured for a first-time build, which is great but means they are slow for build cycles.

Yes "make bootimage-nodeps"  is a clean way to make just "boot.img".   I have a couple additional thoughts.  I don't have a running pandaboard at the moment so this is taken from my old build scripts.  And I used the linaro baselines, which are different from the AOSP (e.g. uboot instead of the Android bootloader).  So you will need to massage these thoughts some for your testbed.

I use $(PRODUCT_OUT) as a short-cut for the shell functions in envsetup.sh, $(get_abs_build_var PRODUCT_OUT)

1. backup the current $(PRODUCT_OUT)/kernel so you can recover a working kernel if something goes bad
2. copy the new kernel zImage to $(PRODUCT_OUT)/kernel
3. make bootimage-nodeps creates a $(PRODUCT_OUT)/boot.img containing your kernel.  MUCH faster is to use the umkbootimg, boot_info, mkbootimg utilities (google for downloads) to update boot.img.
4.  Load JUST the boot.img onto the pandaboard.  system.img requires all the vendor proprietary shared objects, which I found to be tedious/slow for kernel work.  Use "fastboot boot $(PRODUCT_OUT)/boot.img" on a running system to boot your image but NOT overwrite internal flash.  If you are putting it on an SDcard use dd to overwrite the by-name LNX partition.  This is generally the first partition on the sdcard.

Good luck!

Jean-Baptiste Queru

unread,
Mar 18, 2014, 11:44:13 AM3/18/14
to android-...@googlegroups.com
I don't know if PandaBoard supports it, but IIRC the most common approach about testing just the kernel is to boot the new kernel over fastboot with fastboot boot <kernel>, instead of flashing a boot.img each time.

JBQ
 
--

Jean-Baptiste M. "JBQ" Quéru
Architect, Mobile, Yahoo


--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

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


Dave Turvene

unread,
Mar 18, 2014, 3:11:43 PM3/18/14
to android-...@googlegroups.com
On Tuesday, March 18, 2014 11:44:13 AM UTC-4, JBQ wrote:
I don't know if PandaBoard supports it, but IIRC the most common approach about testing just the kernel is to boot the new kernel over fastboot with fastboot boot <kernel>, instead of flashing a boot.img each time.

JBQ

Well I learn something new every day.   I looked at the fastboot code and it does indeed accept a kernel image or boot.img.  It determines if it's a boot.img by looking at the magic string of "ANDROID!" otherwise assumes it is a kernel image.   That little tip could have saved me some time....

BTW, "fastboot boot" only loads the image; it does not write to flash.  Test it and the run "fastboot flash boot..." which will write to the flash area.
Reply all
Reply to author
Forward
0 new messages