Adding Android kernel to manifest

Posted by Frank December - 25 - 2011 - Sunday

So say you want to grab the Android linux kernel along with the rest of the project. By default the kernels are not included in the manifest to save bandwidth for the vast majority of developers that don’t need it. I like to add them back for convience and to track new code dumps automatically. There are a few kernel projects listed at the bottom of the AOSP page based on the SoC used. I’ve made a short list for reference:

  • common – Collects changes from each the platform variants
  • goldfish – Emulator
  • msm – Qualcomm
  • omap – Texas Instruments
  • samsung – Samsung
  • tegra – NVidia

So once you know which kernel(s) you want to add to your repo manifest. Here’s how you can do it (Note: $AOSP is the top directory of your Android tree):


$ cd $AOSP/.repo/manifests # Goto manifests directory
$ git checkout -b with_kernel # Make a new branch to add kernel(s)

Then you need to edit the default.xml manifest to add your kernel(s) between the tags:

By default you’ll get the master branch, which is empty. To find the one you really want, sync with repo then list all the branches available:

$ repo sync
$ cd $AOSP/kernel/$KERNEL_NAME
$ git branch -la

Then you need to edit the default.xml manifest again with the correct branch (called revision in manifest):

Now when you sync you’ll get the kernel tree. Since you just did a sync remotely, you can just a do a local sync to avoid going out to the internet to check for changes and speed it up:

$ repo sync -l

If all this works, then you should commit the changes to your default.xml and repo will merge them into new versions for you:

$ git commit -a -m "Added kernels to manifest"

One Response to “Adding Android kernel to manifest”

  1. [...] git hash for the tree containing the kernel. So if we go to the right kernel repository (See my previous entry about that) all we have to do is checkout that [...]

Leave a Reply

Most Recent Talk