Upgrading to a new AOSP release

Getting the helper scripts

Some scripts to help with upgrading to a new AOSP release can be found in the git repository at git://android.git.linaro.org/people/bero/scripts.git. The repository is under the control of Gerrit - if you're making any changes, use git push ssh://[email protected]:29418/people/bero/scripts.git master:refs/for/master. You will want to put the scripts inside a new directory that will contain the source you're working on, because they check out code into ../src - e.g. if you run the checkout command inside /home/YOU/linaro-android (creating /home/YOU/linaro-android/scripts), source will end up in /home/YOU/linaro-android/src.


The helper scripts use the following tools that might not be installed on some systems - you will want to make sure they're installed:

  • git: Part of git, typically contained in a package called git-core or git

  • scp: Part of openssh, typically contained in a package called openssh-clients.

  • xmllint: Part of libxml2, typically contained in a package called libxml2-utils.

  • grep: grep, typically contained in a package called grep

  • dirname, basename: from coreutils typically contained in coreutils

  • realpath: typically contained in realpath

On OpenMandriva based systems, use urpmi git-core openssh-clients libxml2-utils grep coreutils to make sure all dependencies are installed.


Edit the file settings to match your user and environment. Variables that can be modified are:

  • USER: Your username on android.git.linaro.org

  • EMAIL: Your email address to be used in commits (if left blank, the setting from git config --global user.email will be used. This is useful if your global git config points to an email address other than [email protected].

  • ANDROIDVERSION: The current Android version you're working on (e.g. 4.2.1 if you're working on linaro_android_4.2.1/android-4.2.1_r1)

  • ANDROIDREVISION: The minor revision of the Android version you're working on (e.g. 1.2 for android-4.2.1_r1.2)

  • VERSIONS: Branch names that may be the ones you want to check out by default (e.g. a setting of linaro_android_${ANDROIDVERSION} linaro-jb would check out the linaro_android_${ANDROIDVERSION} branch where it exists, and try linaro-jb where it doesn't)


lco ("linaro checkouot") checks out a repository from the Linaro Android git server. lco platform/bionic will check out the platform/bionic repository. In addition to simply being shorter than git clone git://android.git.linaro.org/platform/bionic.git, lco checks out the branch you're most likely to want to work with, copies in the commit hook for generating a Change-Id: line automatically, and adds some remote repositories you may want to work with. For every checkout, the remote origin will be anonymous git access (as usual). The remote gerrit will be the writable version of the same repository (use git push gerrit whatever:refs/for/whatever to submit changes). The remote aosp will be the upstream AOSP repository (use git push aosp whatever:refs/for/whatever to submit a change upstream) where applicable. In some repositories (where available, e.g. busybox or ffmpeg), another remote upstream will be added for syncing with upstream. If you wish to check out a branch other than the default specified in settings, you can invoke lco with a second parameter indicating the branch name, e.g. you can use lco platform/bionic linaro_android_2.3.1 to start working on an ancient branch. While lco can be useful on its own, its primary use is being called from the other helper scripts.


get-source downloads an entire source tree using lco for every repository mentioned in a manifest. An optional parameter tells the script which manifest to use. By default, it uses staging-galaxynexus.xml. e.g. get-source staging-panda would check out the entire staging-panda code.


Shows the differences between 2 versions. The typical use is changes android-4.2.1_r1 android-4.2.1_r1.2 (this would show what changed between those 2 revisions). With just 1 parameter (changes android-4.2.1_r1, the difference between the given branch and the current version is shown.


This script automates as much work as possible when updating to a new upstream release.

It takes (up to) 3 parameters: update newversion [newrevision] [manifest]


  • newversion is the version to update to (e.g. 4.2.1)

  • newrevision is the revision to update to (e.g. 1.2 for android-4.2.1_r1.2). If omitted, 1 is assumed.

  • manifest is the manifest to use for the list of repositories. If omitted, staging-galaxynexus is assumed.

If newversion is different from the current version, update generates new branches (linaro_android_${newversion}) for repositories that have versioned linaro_android_* branches, and rebases for repositories that are derived from AOSP, but have unversioned branches (e.g. linaro-master or linaro-jb).

If newversion remains the same, but newrevision is different, changes will be merged into the existing branches instead.

If any merges go wrong, a list of repositories that need manual attention is displayed in the end.

Platform/Android/Upgrading (last modified 2013-07-24 19:25:34)