Building Android

Preperations

Building

Note

Before you start to build, make sure you have done all the Preperations listed above.

Build U-Boot

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ cd uboot
$ make CROSS_COMPILE=aarch64-linux-gnu- kvim_defconfig
$ make CROSS_COMPILE=aarch64-linux-gnu-
Note

Gernerated images in this step:

  • fip/u-boot.bin: for onboard eMMC storage booting
  • fip/u-boot.bin.sd.bin: for external TF card booting
1
2
3
$ cd PATH_YOUR_PROJECT
$ cd bootloader/uboot
$ ./mk kvim
Note

Gernerated images in this step:

  • build/u-boot.bin: for onboard eMMC storage booting
  • build/u-boot.bin.sd.bin: for external TF card booting

Build Android

1
2
3
4
$ cd PATH_YOUR_PROJECT
$ source build/envsetup.sh
$ lunch TARGET_LUNCH
$ make -jN otapackage
Note
  • Replace ‘N’ as the number you want when you run ‘make -jN’
  • Replace ‘TARGET_LUNCH’ to your lunch select.
    For Android Marshmallow(6.0), it’s kvim-userdebug-32.
    For Android Nougat(7.1), it’s kvim-userdebug-64.
    For Android Pie(9.0), it’s kvim-userdebug.

Gernerated images in this step:

  • out/target/product/kvim/update.img

Build Linux kernel

When you build Android aboved, will build Linux kernel at the same time.

In some case, you might want to build Linux kernel separately, you can run the script below to do that:

1
$ source device/khadas/kvim/mkern.sh
1
$ make bootimage

See Also