首先要下载相关的工具链
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
$ source build/envsetup.sh $ lunch mek_8q-userdebug $ make 2>&1 | tee build-log.txt
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_COMPILE Make 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 -j4 The 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
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/176881.html原文链接:https://javaforall.net
