Build system

ota_from_target_files: Don't update recovery image

build: Add bacon target, and mka/brunch/breakfast aliases

Makefile: Fix target display

Change-Id: I07e60e6b9a6b09d798ca50c6295072828b643a50

Generic target: Don't build Music, we have Apollo

Change-Id: I3ff30b44dc53dcadb7155cfe69344810a5af77d7

build: Allow building with OpenJDK

Change-Id: I6348bc1187240729f75f50d7ef91802c68e7788b

Some changes added to compile and run with Java 6 and Java 7.

  - correction of errors with Javac 6:
    - target 1.5 and source empty.
  - correction of errors with Javadoc 7:
    - strange behavior when duplicate classes are given.

Change-Id: Ib814ede143f7799ef18e0fb1b733547519b8b0e5

Conflicts:

	core/main.mk

Change-Id: Ief980703f0ff747166c1ec79ad748c09d5979c01

build: Inline kernel building as a buildtime task
By arcee

Kernel image integration is now done in the build system. The
"one true way" of doing this is to download the kernel source
into kernel/TARGET_BOOTLOADER_NAME (by usage of the cm.dependencies
mechanism or otherwise), and defining the TARGET_KERNEL_CONFIG
variable in the device's BoardConfig makefile

If the kernel's location doesn't match the automagic location
(multi-device kernel source, for instance), TARGET_KERNEL_SOURCE
can be used to specify a kernel path (i.e.,
"TARGET_KERNEL_SOURCE := kernel/shared-whatever")

If the device requires out-of-kernel-tree modules to be built,
the TARGET_KERNEL_MODULES variable can be used, pointing to a
_make target_ that will build and install such modules. Definition
of such a target is the device author's responsibility, the only
restriction is that it is a normal makefile recipe (example
below)

Optionally (or as an alternative), a prebuilt binary can also be
defined at BoardConfig, by usage of the TARGET_PREBUILT_KERNEL
variable. This binary will be used if the kernel source is absent
(or undefined).

A minimal BoardConfig.mk should look something like this:

TARGET_KERNEL_CONFIG := cyanogenmod_<device>_defconfig
TARGET_PREBUILT_KERNEL := device/<vendor>/<device>/kernel

To include, for example, the TI WLAN modules, this can be used:

-----------------------------
TIWLAN_MODULES:
       make -C hardware/ti/wlan/wl1283/platforms/os/linux/ KERNEL_DIR=$(KERNEL_OUT) ARCH="arm"
CROSS_COMPILE="arm-eabi-" TNETW=1273 RANDOM_MAC=n REPORT_LOG=n
       mv hardware/ti/wlan/wl1283/platforms/os/linux/tiwlan_drv.ko $(KERNEL_MODULES_OUT)
       make -C hardware/ti/wlan/wl1283_softAP/platforms/os/linux/ KERNEL_DIR=$(KERNEL_OUT) ARCH="arm"
CROSS_COMPILE="arm-eabi-" TNETW=1273 REPORT_LOG=n
       mv hardware/ti/wlan/wl1283_softAP/platforms/os/linux/tiap_drv.ko $(KERNEL_MODULES_OUT)

TARGET_KERNEL_MODULES := TIWLAN_MODULES
---------------------------

Change-Id: I8634fa4c788a42dc6f62e62ca170825b66db126a

build: Fix kernel.mk typos

Change-Id: I5980d6a30dd66741a561a95e0dfba60a3ad0ef5d

product: Remove MusicFX, we have DSPManager

Change-Id: I6be4c766f83a91c2e6104cbaa18ee18abd7784cf

envsetup: Add pushboot function

This function lets you push a file from your current OUT dir
for your current device. It root/remount the device, push the
file, and reboots it. Example: pushboot system/app/SystemUI.apk

Change-Id: I8a404323a4091e8502fbdd24198c66f1ac598192

build: Add Qualcomm's helper macros

 * This is used everywhere in Qualcomm's code. There's no reason we need
   to constantly replace it with uglier stuff in our Makefiles.

Change-Id: I0183a338470ec96a38f356a47bae65a0d3fb2c95

build: Add board platforms to qcom_utils

Change-Id: I85458167bf2b9c04b029d09b87bf791ff4cfd04d

build: Use common name for QCOM 7K boards.

This is needed to build QCOM HAL without external modifications. The
device would now have to specify msm7x27 or msm7x30 instead of
specifying the full name.

Patch Set 2: Add msm7x27a into the list.

Change-Id: I25018e397b5aad27fab5244731a574ae86752e17

Add new version to qcom_utils.mk

Change-Id: I1ca1532fd4968450715ecd0cca7729e0e6d507ef

Allow a device to generically define its own headers

We have a few cases of devices including specific versions of projects
just because of modified headers (msm_mdp.h comes to mind), and I just
had enough of ifdeffing header files for specific cases (the P990 needs
a lot of these).
Now... if a target defines a TARGET_SPECIFIC_HEADER_PATH, any headers in
there will take precedence over the standard ones; for example, on the
p990, I have

TARGET_SPECIFIC_HEADER_PATH := device/lge/p990/include

which makes, for example, the
device/lge/p990/include/hardware_legacy/AudioHardwareInterface.h be
used instead of
hardware/libhardware_legacy/include/hardware_legacy/AudioHardwareInterface.h
whenever a source file uses <hardware_legacy/AudioHardwareInterface.h>

Change-Id: I41b62668b60e3f62a6ebd3738d8d2675103a81e6

envsetup: set OUT_DIR to an absolute path always

OUT_DIR was set to $(TOPDIR)out previously,
but $(TOPDIR) was null, so it was a relative path.
This broke releasetools, inline kernel building, etc
since they require absolute paths.
Fix it so that it is set to $(shell readlink -f .)/out
if $(TOPDIR) is null.

Also remove hacks which checked if (OUT_DIR) was out
and changed it to $(ANDROID_BUILD_TOP)/out to workaround
the aforementioned problem.

Change-Id: I459a3b1325a1bbea0565cd73f6acf160d4ed9b39

Conflicts:
	core/base_rules.mk
	core/tasks/kernel.mk

Change-Id: I52a7a6024f0f2b708c230e53c0152ed138726cc1

envsetup: Set CUSTOM_BUILD environment variable

This is used to gate a few features, including backuptool

Change-Id: I02fee9e0765cca88c833bb0514762aa3b14642e3

Add backuptool support to the releasetools system

Pulled from CyanogenMod 10.1

Change-Id: Iffd9a45865011ad9108508d31f79e53d609dd6f4

Allow override of device asserts, including multi-device support.

Set in board file with TARGET_OTA_ASSERT_DEVICE.
(cherry-picked from commit 0f452f21fc9323b9d1fe746161761cf40aaa5030)

Change-Id: Icd10de924f2b88168912c9575174cebf6b0104ba

envsetup: add a helper to fix "out/target/common" not being really common

* out/target/common isn't really common, and if you do
  back to back builds for multiple devices, that is noticable.
* Use out/target/common-$device instead, and link the appropriate
  dir to out/target/common every time lunch() is run, if
  ANDROID_FIXUP_COMMON_OUT is set.
* Refer https://groups.google.com/forum/#!topic/android-building/ispbOgzoyg8
  for more info.

Change-Id: I11e7df0e68e2a60ce32576f06397d60fc9465b60

recovery: fix custom recoveries

This is a squashed set of commits with some updates to minimize conflict with AOSP

recovery: custom recovery build fixes

Patch by Koush

Extract uboot image creation from core/Makefile

http://memegenerator.net/instance/12495768

This change utilizes BOARD_CUSTOM_BOOTIMG_MK to extract out the Uboot boot and
recovery image generation out into it's own file (approx 130 lines).

This should:
    * Clean up the already huge Makefile and the keep ifdeffyness down
    * Make sure Uboot changes don't effect other builds
    * Extract a lot of code that is only for 3 devices

This depreciates BOARD_USES_UBOOT but BOARD_USES_UBOOT_MULTIIMAGE is still valid.

Boards who use uboot boot images should remove BOARD_USES_UBOOT and add
  BOARD_CUSTOM_BOOTIMG_MK := device/common/uboot-bootimg.mk
to their BoardConfig.mk
(location of the makefile is not finalized)

Conflicts:
	core/Makefile

Patch by nemith

remove unused BOARD_USES_COMBINED_RECOVERY

Change-Id: I79520c510488d63d469b0d1a3a099420f7de1fe6

Patch by codeworkx

Change-Id: I6bcab88b76272526bdc558fbf8d7b43347bb5ef1

build: fix BOARD_CUSTOM_BOOTIMG_MK

Change-Id: I1b9fa7d8eb67bdcaaae7b55ca538b33545e73581

build: add support for custom releasetools

Change-Id: I2337559ac669bb5868708c4726cbacbf5713261a

releasetools: use prebuilt boot image if using a custom boot image makefile

Change-Id: Ic348d31e8df7933dc4f9f055b7a5a2beacc21d32

Add ARMv6J and ARMv6-VFP processor combo option

Cherry-picked from gingerbread branch.

Change-Id: I8015149184ab3e1ee61ef93c62a395233ad1d156

Re-add ARCH_ARM_HAVE_TLS_REGISTER for armv7

OpenGL needs this flag for armv7

For more information :
https://github.com/androidarmv6/android_bionic/commit/7bc88df02f887229738b08fd7f7bd2668805f306
https://github.com/androidarmv6/android_frameworks_native/commit/4ffa795a3e9f2d2a26766147b1cfedbe78e823d4

Change-Id: Ib68c17e2f8dd3c8c15f8f3ea235fe25a46d05b6a

Add repopick script from CM

patchset 4: cybojenix
  clean up the script:
    remove fetching from github
    cleaned up fetching locations of binaries
    if ANDROID_BUILD_TOP isn't defined, error out

PS 5:
  Added back the check if fetch succeeded.
  Fixed verbose print about fetching.

patchset 6:
  final changes
    fix detecting ANDROID_BUILD_TOP
    send all relavant data to stderr

Change-Id: If67c5f178d03fadd8b79b1908f4a9cb231efbb28

repopick: Add a way to checkout instead of cherrypick

This helps if you want to take a commit and its dependencies, and not
just a particular commit

Change-Id: Ib245cce560c7b0d6fd03198a8c69a13d4720a4cb

add support for overriding build.prop settings.

Change-Id: Ie4224d608b7bcb0c2087bd77bc954f8f5f9b6495

brunch: custom->omni

Change-Id: I5482c765a7c78d6caae371d6fabb8f55e10ac655

FM Radio: Add support for FM Radio in Android

Creating interface and framework for using FM Radio
RX and TX from different vendors.

Change-Id: I1a71aed01bfffdddfabf1cdfbfa3707cb1ed016b

Signed-off-by: Benn Porscke <benn.porscke@stericsson.com>

Conflicts:

	core/pathmap.mk
	target/product/core.mk

build: work around missing readlink -f on Mac

Change-Id: I5d56366cf33a2b02f1886c87815d00cff279779d

build: Rename ota packages from custom to omni.

Change-Id: Idc344f404244cca466770f884dee361f38ea2ebe

build: change custom -> omni in a few more places

* these weren't changed when the transtition occured - fix them now

Change-Id: I47bedb96ad63a41959baa98e1a265cb616d17918

releasetools: support more partitions and different fstab types

* add BML support for Samsung legacy devices
* add ext2, ext3 and vfat, f2fs support for EMMC
* fix recovery.fstab for ADV recovery

Change-Id: I6b76d2a21fe68096cf1b0cd850cdfb3a313370d1

build: Build with colors

Based on tpruvot/chirayudesai's commits, add some color to stdout
and but make it a little easier to customize. Colors are now mapped to
categories and can be edited in Makefile if you or your terminal's
background color do not like them. Defaults:

host stuff: yellow
target stuff: cyan
install/copy: green
filesystem/images: green
imports/exports/includes/notices: green
deletes: red
complete msg: bold green

Coloring can be disabled with "export BUILD_WITH_COLORS=0"

Change-Id: Idcfe9bbf925759f88425f914269855da05c5eef0

Allow disabling PIE for dynamically linked executables

arm: Allow disabling PIE for dynamically linked executables

PIE can and does break some binaries that were built without it,
resulting in relocation-related issues (addressing memory
wrongly assumed to be at a fixed position).

Use this as a last resort measure for compatibility with pre-JB
binary blobs, and only if confirmed to fix a broken executable.
If you're not sure, do NOT enable this on a device.

Change-Id: I3b7001e682a6f7a845e62278fe2afa9ccf5552a4

arm: Drop linker script when building without PIE

The current section headers generated by bionic are incompatible
with this (interp is in, ctors were dropped, and other tiny changes
related to Elf32_Dyn). But... we don't actually need this to
disable PIE, so drop it entirely instead of writing a new one.

Change-Id: I3b350a9f6251e60bf52114343d190f3d6d83b216

build: update qcom_utils.mk

This is a combination of 2 commits.

commit 65849f502ad3e16f6916ddc640d4305c36b7bebc
Author: Jake Weinstein <xboxfanj@msn.com>
Date:   Sat Sep 14 13:10:43 2013 -0500

    Build: update qcom_utils.mk

    Add build macro to determine Android Release

    Adding platform sdk version 18 for JB MR2.

    Change-Id: I79aa831ddd335bd14bd777506c210acc5d9960f1

commit 677d8efcb831b4b29c5bb5123897943870a55627
Author: andrew.boren <andrew.boren@gmail.com>
Date:   Sat May 18 22:15:13 2013 -0700

    qcom_utils: Add qsd8k to qcom platforms

    PS2: fix typo

    Change-Id: Id85569d1dd7be2f4c0620827da6d89e63b658aa9

Change-Id: I58d70c079c6ec2c76ab7fc169664f1e4c55fb552

build: tools: add in roomservice

This is a new implementation of roomservice
use the new github search api to reduce the memory footprint, and make it less processor intensive
allow for unofficial devices to fetch dependencies. just specify your github organization

to fetch dependencies:
    add a file called 'omni.dependencies' to the root of your device tree
    an example configuration for the dependency file is:

[
  {
    "repository": "android_device_sony_common",
    "target_path": "device/sony/common"
  },
  {
    "repository": "legacybop/android_hardware_qcom_display-legacy",
    "target_path": "hardware/qcom/display-legacy",
    "revision": "omni-4.3"
  }

please note that comments can not go into this file. It must be valid json

PatchSet 7:
  add support to change port script to another team with config
  finished pep8'ing
  more checks on manifest parsing

Change-Id: I3d7a8d46d3effbb3d2480c136c9b6b6e610b9b2e

kernel.mk: Use standard toolchain paths

Change-Id: I1225fd05dcedcff03a1cf1102841cbd010b609cf

Support fetching dependencies even if device tree fails.

This is required when device tree depends on dependencies to lunch.

Change-Id: If62cd9777caf768f8070570ca0835052645c6b20

build: recovery: don't remove init.*.rc

Change-Id: Ic1e14e1e82cb28106da5b39f530e0b667377840d

core: Support GNU make 4.0 and any future releases

http://lists.gnu.org/archive/html/make-w32/2013-10/msg00021.html

Change-Id: Iaf6aa32e64269bf0368c20b0393e3fcfa540558d

updating roomservice.py to default on android-4.4 branch to be android-4.4

EDIT: removing useless comments while I thumb my nose at elitist friends
EDIT: elitist extra line removed
Change-Id: Iebf4dfc4237d6e251acb9e9d32ae1cee68e514ed

roomservice: Fix os.path.isdir calls

Apparently on some Python installations
it throws exception instead of returning False.

Change-Id: I9d901e3260bab411cf3466346c421594f0922562

roomservice: Add -f and --no-clone-bundle flags to repo sync

Suppress scary-looking common warnings during resolving.

Change-Id: I4337ec95992ad68ff4471b0d0b7346e933269503

Allow override of device asserts, including multi-device support

Set in board file with TARGET_OTA_ASSERT_DEVICE.
(cherry-picked from commit 0f452f21fc9323b9d1fe746161761cf40aaa5030)

Change-Id: Icd10de924f2b88168912c9575174cebf6b0104ba

Fix building custom recovery with userdebug

Credit Koushik Dutta

Change-Id: I41f1a91849f3aab435a3398696149afce68d8708

generic_no_telephony: Build Launcher3 instead of Launcher2

Change-Id: I8efbeb480f0f1c4314c106c4d791fd1ffe3dc1a5

build: Don't copy APN list from emulator

This list is severely incomplete and is overwriting the proper APN list in the vendor
directory.

Change-Id: I0e1b1d26e0cdf2df9a05462f0c9343bd3115635b

Add SED_INPLACE macro - based on squashed commits from Cyanogenmod

Make sed in-place more portable

In-place sed (sed -i) works differents for GNU vs BSD version like
what is found on OS X.

This adds a check and does a sed -i for GNU and a sed -i '' for
Darwin only.

This allows my OS X machine to fully compile CM without the need
for any GNU specific packages.

Author: Brandon Bennett <bennetb@gmail.com>

Darwin: Use gsed for SED_INPLACE if found.

Change-Id: I5922b31ff2d192d5c6cc0cd8cabfe64d8b4f2620
Author: Koushik Dutta

core_base: Remove "Home Sample"

Change-Id: I690ab7d65fe02c0771c796d37d15f9ef857daaaf

inline kernel dtb build

also add sony device filter

Change-Id: Iffeda58c7086f49e76ecafd37941503611346983

Allow prebuild APK's in Vendor

Change-Id: I361c32fac1e003ec985ffe2282bf8ef922b11ac0

Revert "inline kernel dtb build"

This reverts commit fbc87ca4f1549e97c110c93e323a628b57f0b118.

We have everything we need to build the kernel in it's source tree.

Change-Id: I93459342a65150b1326d1d7061ed4cc51b5bf61b

Make the kernel image format parametric instead of a chain of if/elses

Change-Id: I54bfcdecb8647f7bcf744e72b2de19fcf4e4e7ac

build: recovery: disable ro.adb.secure

We have no way of authorizing adb in recovery and this locks the
user/developer out of adb

Change-Id: I6e9b6bfe01e7221295ed7b15936b3ebdf1c55316

Add more info while flashing

Change-Id: I6ada4cb5b2962073037b28045ca8304d602155c4

releasetools: fix omni logo while flashing

The double backslashes were being parsed out so they've been changed to use other characters

Change-Id: I96e486e51bfd525bbfe83b93a2e3742677abf45c

build: Fix zip creation on Mac OSX

When checking if files are symbolic links, then ota_from_target_files
expect the permissions of the file to be 0755 which is always the case
on Linux, but not on Mac OSX. I adapted the function so that permissions
are not included in the check anymore. Instead it uses only the type
attributes of the zip external_attr flags.
CM uses the same kind of check.

Change-Id: I5d5d0567cb798b765cbc19a66661163f80e21f70

Fix utc date in recovery default.prop

We had this in Omni 4.3 but apparently it got lost during the
transition to 4.4

Change-Id: I09aed0e35eeeada3f3b998e69b3092741a745385

build: Add SKIP_SET_METADATA flag

On some of the older devices the recovery doesn't support
metadata when setting permissions. This allows to use
set_perm vs set_metadata.
Enable this behavior by setting SKIP_SET_METADATA := true

Change-Id: Ib6cf97b5ca28cee8a87975231f3a61b156e77d29

ota: Disable downgrade check

We want users to be able to downgrade their packages.

Change-Id: I6bcbd4ee2a02640fe0855b0f1f197a02e914c927

build: Add ro.omni.device

Some devices, such as n7100, report under another product name
in ro.product.name.
As this is breaking delta updater, we introduce another variable
to retrieve the actual device name as it was used to build.

Change-Id: I96ecd189453ea9929884d094a7b846365506c397

core: main: remove all the spam about including make files

to disable showing the makefile includes:

	export HIDE_MAKEFILE_INCLUDES=y

Change-Id: Ifd2ef0e239d16b169c572472416c2c31df62a367

script to handle new static landing pages for sample topics

Change-Id: If90531da327e2d664ca7856af6a9737ea1879eaa

Enable incremental builder to find files that moved, and
try to process them via patch + rename, instead of
delete + add.

b/11437930

Change-Id: Ie70632a2fa0a13d4bb259f61c620bb01812494e5

Add a platform library for remote display providers.

Bug: 11257292
Change-Id: Ia0207010c2f3ae143b483e9c1aa6643142740312

roomservice: Change default remote to omnirom

Using the default of github results in people unable to use gerrit
to submit patches to repos brought in by roomservice

Change-Id: Idccd6c35bf81a35135e893ed03f6c5745059ec82

roomservice: Fix handling of devices with _ in their name

Currently, roomservice takes every _ in the device tree name and
replaces it with /

Instead, strip the device name (such as pollux_windy) from the repo
name before replacing _ with / and then append it again when we're done

Change-Id: Ieabe85ecd8829c959a7296e5cd73f577879c4ffc

roomservice: urgent: add "+fork:true"

Enable a device config to be found on github if it was forked

thx @cybojenix

Change-Id: Ic63f82b9ed754dcba17725f5aa75d0011896b09c

repopick: Allow picking batch of commits with the same Change-Id

Gerrit does allow assigning the same Change-Id for multiple commits. This patch allows picking them properly.

Change-Id: Idedc64f58eebe41a0d212c72329d15acff24efb9

Illusionify

Conflicts:
	CleanSpec.mk
	core/Makefile
	core/build_id.mk

Change-Id: I72fe3614cec1980d1584f33e00e8d3e2769e7c83