Search code examples
gitandroid-buildrepo

How do I compile Android 4.4.2 for Qualcomm MSM systems?


I need to make OpenCV's native camera work on device that is using a version of android with Qualcomm's changes for snapdragon systems (Android 4.4.2). Based on the answer to this bug report, I need to compile the target android tree for my project to reference when I compile OpenCV's native camera library.

I've identified this tag as the one that is relevant to the device: LNX.LA.3.6-00210-8084.0

I acquired the source with

repo init -u git://codeaurora.org/platform/manifest.git -b release --repo-url=git://codeaurora.org/tools/repo.git --repo-branch=caf-stable

repo sync

The default branch is 4.0.4. I tried to checkout my tag with

repo forall -c git checkout LNX.LA.3.6-00210-8084.0

However, many of the subprojects lacked this tag. As a result, the projects seemed desynched/unmatched. I have a strong feeling that this is not the proper way to change to the MSM 4.4.2 tree, but I've failed to find the correct way to do it. After attempting the checkout the tag in every project, I get errors when running lunch

build/core/product_config.mk:223: *** Cannot locate config makefile for product "aosp_arm". Stop.

** Don't have a product spec for: 'aosp_arm' ** Do you have the right repo manifest?

Once I clone the source with repo, what commands do I need to run to get the projects in a buildable state for MSM 4.4.2 - In particular, the tag LNX.LA.3.6-00210-8084.0? Do I need to run a different repo command when first initalizing?


Solution

  • According to CodeAurora's Android for MSM Project wiki page the Repo command to use for recent releases is

    $ repo init -u git://codeaurora.org/platform/manifest.git \
        -b release -m [manifest] \
        --repo-url=git://codeaurora.org/tools/repo.git \
        --repo-branch=caf-stable
    

    where [manifest] is the name of the manifest file. I can't find a reference table that correlates manifest files (named after CAF's internal release names) to AOSP releases, but you have yourself said it's LNX.LA.3.6-00210-8084.0 you're after so let's go with that. And indeed, there is such a manifest file in the release branch of CAF's platform/manifest.git. Hence:

    $ repo init -u git://codeaurora.org/platform/manifest.git \
        -b release -m LNX.LA.3.6-00210-8084.0.xml \
        --repo-url=git://codeaurora.org/tools/repo.git \
        --repo-branch=caf-stable
    

    As a side note, repo forall -c git checkout name-of-tag shouldn't be relied on since different releases may have different sets of gits in their manifests. That command only works if you already have the exact same set of gits in your current manifest and the one you want to switch to.