首先要下载相关的工具链

In addition to the packages requested on the Android website, the following packages are also needed:$ sudo apt-get install uuid uuid-dev$ sudo apt-get install zlib1g-dev liblz-dev$ sudo apt-get install liblzo2-2 liblzo2-dev$ sudo apt-get install lzop$ sudo apt-get install git-core curl$ sudo apt-get install u-boot-tools$ sudo apt-get install mtd-utils$ sudo apt-get install android-tools-fsutils$ sudo apt-get install openjdk-8-jdk$ sudo apt-get install device-tree-compiler$ sudo apt-get install gdisk

注意的是如果Ubuntu 系统中已经安装了java7 ,现在编译imx8 需要java8.记得java要切换到java 8.
编译Android system

$ source build/envsetup.sh$ lunch mek_8q-userdebug$ make 2>&1 | tee build-log.txt

如果电脑配置不好,编译时间比较漫长 ,大概5小时。如果又任何错误 可以查看 build-log.txt 获得详细信息
编译完成后 生成img 文件如下:

编译 ota 升级版命令 ,生成升级包就是上图的标红的文件

make otapackage

编译uboot

You can use this command to generate u-boot.imx under the Android environment:# U-Boot image for i.MX 8QuadMax/8QuadXPlus MEK board:$ cd ${MY_ANDROID}$ source build/envsetup.sh$ lunch mek_8q-userdebug$ make bootloader -j4

生成kernelimg

Kernel image is automatically built when building the Android root file system.The following are the default Android build commands to build the kernel image:$ cd ${MY_ANDROID}/vendor/nxp-opensource/kernel_imx$ echo $ARCH && echo $CROSS_COMPILEMake sure that you have those two environment variables set. If the two variables are not set, set them as follows:$ export ARCH=arm64$ export CROSS_COMPILE=${MY_ANDROID}/prebuilts/gcc/linux-x86/aarch64/aarch64-linuxandroid-4.9/bin/aarch64-linux-android-android_defconfig.# to build the kernel zImage for i.MX 8QuadMax/8QuadXPlus$ make android_defconfig$ make KCFLAGS=-mno-android# to build the zImage which is used in MfgTOOL# zImage is under mfgtools\Profiles\Linux\OS Firmware\firmware\$ make defconfig$ make KCFLAGS=-mno-android -j4The kernel images are found in ${MY_ANDROID}/out/target/product/mek_8q/obj/KERNEL_OBJ/arch/arm64/boot/Image.

最后生成bootimage

# Boot image for i.MX 8MQuad EVK board$ source build/envsetup.sh$ lunch mek_8q-userdebug$ make bootimage

Building dtbo.img

Dtbo image holds the board's device tree binary.Use the following commands to generate dtbo.img under the Android environment:# dtbo image for the i.MX 8QuadMax/8QuadXPlus MEK board$ cd ${MY_ANDROID}$ source build/envsetup.sh$ lunch mek_8q-userdebug$ make dtboimage -j4

更多相关文章

  1. android编译时报错
  2. android-Java中实现删除文件 - 随心
  3. Android中SdCard的数据读写
  4. Android(安卓)xml Activity进入或退出动画
  5. Gradle version 与 Android(安卓)Plugin Version 对应的问题
  6. Android笔记——简单解析XML
  7. Android获得相机的所有信息
  8. Android(安卓)Studio下 SVN忽略文件设置
  9. transformClassesWithJarMergingForDebug

随机推荐

  1. Android Studio:如何使用Android Studio与
  2. Android如何实现振动器的移植与开发
  3. ListView的Adapter使用 之 初学ArrayAdap
  4. Android: Kotlin 材料设计入门
  5. 在Android studio中如何把项目放到远程gi
  6. 谷歌 Fuchsia 上手体验,将取代Android/win
  7. Taobao 5月底举办android、ios、java无线
  8. [实践] Android5.1.1源码 - 让某个APP以
  9. Android截屏和录制视频
  10. Android平台上如何让应用程序获得系统权