Mediatek X20 Board Compile

After you download all the code source, you can build the X20-Board images.

  1. Set up environment
    $ source build/envsetup.sh

  2. Choose a target
    $ lunch full_amt6796_64_open-eng

  3. Build the code
    $ make -j8
    (Build everything with make. GNU make can handle parallel tasks with a -jN argument, and it’s common to use a number of tasks N that’s between 1 and 2 times the number of hardware threads on the computer being used for the build. For example, on a dual-E5520 machine (2 CPUs, 4 cores per CPU, 2 threads per core), the fastest builds are made with commands between make -j16 and make -j32.)

or make one by one manually
$ make pl -j8
$ make lk -j8
$ make kernel -j8
$ make bootimage -j8
$ make systemimage -j8
(Note that, the Android OS for x20 96Boards is open source, but excluding HAL part, and the preloader part.
So, there is no need to execute “$ make pl -j8”.)

  1. Images in the out directory(\out\target\product\amt6797_64_oam)
    boot.img
    cache.img
    lk.bin
    logo.bin
    MT6797_Android_scatter.txt
    PGPT
    preloader_amt6797_64_open.bin
    recovery.img
    system.img
    tinysys-scp.bin
    trustzone.bin
    userdata.img

Thanks for the write up. We’ll have to see if we can get that information somewhere more prominent.

@swrobertw: Should this sort of thing be slotted into the docs for the board somewhere? To me, this seems more like docs than FAQ material.

@lowkeyway
In 2nd step, I cannot find combo option full_amt6796_64_open-eng for lunch.

FYI I downloaded aosp by doing repo init -u https://android.googlesource.com/platform/manifest2 -b android-6.0.0_r1 followed by repo sync. I couldn’t understand what to do with SLA source at https://builds.96boards.org/releases/helio-x20/mediatek/aosp/16.07/sla.tar.gz. I simply copied vendor folder from SLA to aosp root directory.
What else need to be done? Am I missing any source?

Thanks,
Shailesh

Hi Shailesh

Do you have copy the device folder to the aosp root dircetory? The lunch combo is decided by the device folder.

Thanks.

Hi Ekko,

Thank you for your response.
When I look into into device folder of aosp it has below folders:
asus, common, generic, google, htc, lge, moto, sample.
I believe for this dev board there should be additional different device folder that’s of amt6797?
My question is from where I get this device specific source?
SLA folder doesn’t have device source.
Simply building aosp with different lunch option won’t work for this board right?

Thanks,
Shailesh

Hi Shailesh:

In the SLA folder, there are device folder,vendor folder etc. Please copy this folder’s contents to the AOSP corresponding folder.

For example, copy the sla/device/amt folder to the aosp/device.

Thanks.

My bad!
Device folder was missing from my SLA folder, only vendor and prebuilt folder was present.
I re-downloaded SLA and merged device and vendor folder.
Now I can see appropriate lunch option.

Thanks,
Shailesh

Hi Ekko,

I am getting below error after executing make clean & make -j4.

make: *** No rule to make target ‘out/target/product/amt6797_64_open/kernel’, needed by ‘out/target/product/amt6797_64_open/boot.img’. Stop.
make: *** Waiting for unfinished jobs…
Notice file: external/zlib/NOTICE – out/host/linux-x86/obj/NOTICE_FILES/src//bin/minigzip.txt

make failed to build some targets (04:03 (mm:ss))

Looks like some makefile is missing? FYI I have overwritten any local changes I may have in aosp and kernel by using repo and git commands. What could be wrong?

Thanks,
Shailesh

Hi Shailesh

From the error information, we can see there is no target when make the kernel. Please check whether the kernel-3.18 folder is coyied to aosp

Thanks

Hi,

I am new to this platform, I am facing the same issue too. The folder kernel-3.18 exists in aosp but still I am getting the following error,

make: *** No rule to make target ‘out/target/product/amt6797_64_open/kernel’, needed by ‘out/target/product/amt6797_64_open/boot.img’. Stop.
make: *** Waiting for unfinished jobs…
Notice file: external/zlib/NOTICE – out/host/linux-x86/obj/NOTICE_FILES/src//bin/minigzip.txt

Do I need to clone kernel from a different repo?

Thanks a lot!

Regards
Anusha