Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Karim Yaghmour <karim.yaghmour@opersys.com>
To: buildroot@busybox.net
Subject: [Buildroot] Android.mk file for integration into AOSP build
Date: Sun, 27 Oct 2013 13:50:42 -0400	[thread overview]
Message-ID: <526D5272.6010909@opersys.com> (raw)


I've been meaning to post this for a while. With the help of Thomas and
Maxime from Free Electrons, I created an Android.mk to have the AOSP
merge Buildroot's output into the final Android images. The whole thing
took us like 10 minutes at the last ABS/ELC in SFO; 10 min *without*
Android's build time.

Here's how it works - instructions for 2.3.7 (see below for 4.x):

1- Setup:
- Create a "buildroot" directory at the top of the AOSP
- Untar a buildroot in there
- Configure and build buildroot
- Create a symlink to buidroot's output:
$ cd buildroot/
$ ln -s buildroot-2012.11.1/output/images/rootfs.tar .
- Put the attached Android.mk in [aosp]/buildroot/

2- Build AOSP

3- Profit

If all goes well, you'll have a /bin/ and /lib/ in the Android rootfs
that will contain all the Buildroot stuff. And it won't overlap with
Android since the latter uses /system/bin/ and /system/lib/.

Note: you need to use a separate toolchain to build Buildroot than the
one provided in the AOSP.

In 4.x, the "ALL_PREBUILT" in the Android.mk is no longer supported "out
of the box". So you need to "help" the AOSP a little. Edit the
build/core/legacy_prebuilts.mk and add "buildroot" to the list of
items in "GRANDFATHERED_ALL_PREBUILT":
GRANDFATHERED_ALL_PREBUILT := \
	akmd2 \
	am \
...
	zoneinfo.idx \
	zoneinfo.version \
	buildroot

Enjoy!

-- 
Karim Yaghmour
CEO - Opersys inc. / www.opersys.com
http://twitter.com/karimyaghmour
-------------- next part --------------
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

# This part is a hack, we're doing "addprefix" because if we don't,
# this dependency will be stripped out by the build system
BUILDROOT_ROOTFS := $(addprefix $(TARGET_ROOT_OUT)/, buildroot)

$(BUILDROOT_ROOTFS):
	mkdir -p $(TARGET_ROOT_OUT)
	tar --exclude="dev" -xvf $(TOPDIR)buildroot/rootfs.tar -C $(TARGET_ROOT_OUT)

ALL_PREBUILT += $(BUILDROOT_ROOTFS)

                 reply	other threads:[~2013-10-27 17:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=526D5272.6010909@opersys.com \
    --to=karim.yaghmour@opersys.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox