Open Devices

For some of the Xperia™ devices, we provide Android™ Open Source Project (AOSP) device configurations on GitHub. This means that the software will be open for you as a developer to use and contribute to. This is a way for us to support the open Android community, and it is also a tool for us to facilitate and verify contributions to AOSP.

How to automatically build the Linux kernel

1. Set up the source code and environment

Select one of the Android build guides (see the AOSP build instructions page) and do the following steps of the guide:

  1. Prepare your Java environment
  2. Install the necessary tools to make an Android build
  3. Download Repo tool and set PATH
  4. Initialise the AOSP tree
  5. Add the necessary patches from the AOSP upstream branch

Note: If you already have the environment set then steps 1-3 are optional. This automatically rebuild only works with Android 6.0.1 and newer build guides.

2. Prepare the repository for kernel rebuild

To rebuild the kernel you have to remove the pre-build kernel folder by typing the command:

rm –r device/sony/common-kernel

Note: The open device tree will automatically build the kernel from source if a pre-built kernel is not found.Next

3. Rebuild the boot image

To rebuild the boot image with a kernel built from source, use the following commands:

source build/ && lunch

When prompted, pick the number corresponding to your device in the list displayed and press enter. To start the build, type:

make -j <insert the cpu thread number of your computer> bootimage

Note: The build will take some minutes to complete.

4. Flash the boot image file

Use the Fastboot protocol to flash the boot image file to your phone or tablet. Enter the following command:

fastboot flash boot out/target/product/<device>/boot.img

When prompted to connect your device, first make sure that your device is turned off. Then, hold down the Volume Up button and connect the device to your computer with a USB cable. Your device’s notification light should shine blue to confirm it’s in Fastboot mode.

When the flashing is completed, reboot your device by entering:

fastboot reboot