Two AndroidProducts, One BoardConfig

66 views
Skip to first unread message

Dave Smith

unread,
Jun 23, 2015, 11:24:46 PM6/23/15
to android-...@googlegroups.com
Sorry for cross-posting, but I think this question would probably be better suited to this group…

Hi All -

I have a question regarding building a new product on top of an existing one. One of the nice features of the Android build system is product inheritence, so I don't need to duplicate all the definitions required if I'm basing my build off a working product. In other words, I can do the following (essentially):

1) device/moto/shamu/aosp_shamu.mk contains the definition necessary to build for the Nexus 6
2) I can create device/mycompany/mydevice/mydevice.mk with the following contents:
----------
# Inherit all packages from the Nexus 6 build
$(call inherit-product, device/moto/shamu/aosp_shamu.mk)

# Override inherited values
PRODUCT_NAME := mydevice
PRODUCT_DEVICE := mydevice
PRODUCT_MODEL := My New Device Stub

# Add more of my own stuff
----------
3) Build (lunch/make/etc.) for my new device target

However, the same does not seem to be true for the board support files (BoardConfig.mk, AndroidBoard.mk), at least that I am aware of. In the above example, these files have to be copied into the new device directory for the build to succeed.

If we are building a product to be used on the exact same board hardware as an existing product, is there a better way to tell the build system to use the board definitions found in our inherited product?

Cheers,
--
Dave Smith, PE
@devunwired

Gary Bisson

unread,
Jun 24, 2015, 8:07:44 AM6/24/15
to android-...@googlegroups.com
Hi Dave,


On Wednesday, June 24, 2015 at 5:24:46 AM UTC+2, Dave Smith wrote:
Sorry for cross-posting, but I think this question would probably be better suited to this group…

Hi All -

I have a question regarding building a new product on top of an existing one. One of the nice features of the Android build system is product inheritence, so I don't need to duplicate all the definitions required if I'm basing my build off a working product. In other words, I can do the following (essentially):

1) device/moto/shamu/aosp_shamu.mk contains the definition necessary to build for the Nexus 6
2) I can create device/mycompany/mydevice/mydevice.mk with the following contents:
----------
# Inherit all packages from the Nexus 6 build
$(call inherit-product, device/moto/shamu/aosp_shamu.mk)

# Override inherited values
PRODUCT_NAME := mydevice
PRODUCT_DEVICE := mydevice
PRODUCT_MODEL := My New Device Stub

# Add more of my own stuff
----------
3) Build (lunch/make/etc.) for my new device target

However, the same does not seem to be true for the board support files (BoardConfig.mk, AndroidBoard.mk), at least that I am aware of. In the above example, these files have to be copied into the new device directory for the build to succeed.

You should be able to include the other BoardConfig.mk and modify the values you want to overwrite:
include device/moto/shamu/BoardConfig.mk

Here is an example of BoardConfig.mk inclusion from the AOSP:

Hope this helps.

Gary

Dave Smith

unread,
Jun 24, 2015, 7:48:45 PM6/24/15
to android-...@googlegroups.com
Thanks Gary!
This was starting me right in the face (I was just complaining about the lack of BoarConfigVendor.mk to the same provider) and I just couldn't see it.

Cheers,
Dave Smith, PE
@devunwired
Reply all
Reply to author
Forward
0 new messages