Build Android from source code


#1

Hi,
I am trying to build Android for hikey board from source code by following the instructions in section AOSP build of HiKeyGettingStarted (https://github.com/96boards/documentation/wiki/HiKeyGettingStarted#section-2).

Firstly, download the android source code by the followings
$ repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r1 -g “default,-device,hikey”
$ cd .repo/
$ git clone https://github.com/96boards/android_manifest -b android-5.0 local_manifests
$ cd -
$ repo sync -j8
$ source build/envsetup.sh
$ lunch hikey-userdebug
$ make droidcore -j8
$ cd out/target/product/hikey

Questions:

  1. How to build the kernel for Android?
    I have tried:
    $ cd kernel/linaro/hisilicon
    $ make help
    $ make x86_64_defconfig
    $ make menuconfig <— doesn’t work
    And which dts file is for building kernel (cannot find any dts for hi6620)?

  2. According to the section
    AOSP sources are hosted in these repositories:
    https://github.com/96boards/android_hardware_ti_wpan
    https://github.com/96boards/android_external_wpa_supplicant_8
    https://github.com/96boards/android_device_linaro_hikey
    https://github.com/96boards/android_manifest

Where to store these file to build Android?

Can someone to give a clear instructions?
Thanks.


#2

Once you have built your aosp as explained above, if you want to rebuild the kernel do the following:

$ cd aosp
$ source build/envsetup.sh
$ lunch hikey-userdebug
$ make -j8 boot_fatimage
$ cd out/target/product/hikey

look for your images in the above directory