Building Custom ROM and SDK


Prerequisites


  • Login to the VPS as user aga
  • Verify ~/bin/repo exists, if not download this file from http://commondatastorage.googleapis.com/git-repo-downloads/repo and make it executable and verify the repo file is in the PATH
  • Verify ~/bin/MakeCustomAgaBuild442.sh is available, if not copy the file to ~/bin and make it executable

References


The AGA build scripts are available at

Recommendations


Screen


It is recommended to use screen as the build process is time consuming and screen makes it possible to detach from the shell and later attach again.

To create a screen session:

screen -S <my-build-session-name>

To detach from the current session:

<Ctrl-a> <d>

To list current sessions:

screen -list

To attach to a session:

screen -r <my-build-session-name>

To force detach first and then re-attach (if someone is holding a session):

screen -d -r <my-build-session-name>

Tee


Use tee command to duplicate output to a log file, e.g.:

MakeCustomAgaBuild442.sh  sdk-eng 2>&1 | tee logfile.txt
Also by using tee with -a an exisiting file is being appended. Normally errors are printed to stderr instead of stdio, in bash these can be re-directed with 2>&1 so these are captured by tee as well.

​Build Process


Issue the command MakeCustomAgaBuild442.sh to get help:

$ MakeCustomAgaBuild442.sh
Please provide one argument: [ full_grouper-userdebug | aosp_manta-userdebug | sdk-eng ]

​The command provides you with a number of arguments that may be used.

Depending on the argument, a folder will be created:

  • ~/AGA_BUILD_aosp_manta_userdebug is created when the argument is aosp_manta-userdebug
  • ~/AGA_BUILD_full_grouper_userdebug is created when the argument is full_grouper-userdebug 
  • ~/AGA_BUILD_sdk_eng is created when the argument is sdk-eng

After the build, the following artifacts are available:

  • ~/aga/AGA_BUILD_aosp_manta_userdebug/out/target/product/manta/AGA_manta_ROM.zip when the argument is aosp_manta-userdebug
  • ~/aga/AGA_BUILD_full_grouper_userdebug/out/target/product/grouper/AGA_grouper_ROM.zip when the argument is full_grouper-userdebug
  • ~/aga/AGA_BUILD_sdk_eng/out/host/windows/sdk/android-sdk_eng.aga_windows.zip and ~/aga/AGA_BUILD_sdk_eng/out/host/linux-x86/sdk/android-sdk_eng.aga_linux-x86.zip when the argument is sdk-eng

Post build actions


Please copy out the build artifacts to /srv/repo with the owner jenkins.nogroup.

Flashing a device


Boot up  the device in recovery mode and attach the device with an USB and type:

fastboot devices

to verify that the device shows up and enter:

fastboot -w update <image.zip>

to flash the device.