【分享】为MPSoC编译Android 8的主要流程和命令

作者:hankf,Xilinx Employee

1. 参考文章

Getting Started with Android 8 v2018.1 for Xilinx MPSoC

https://github.com/MentorEmbedded/mpsoc-manifest/wiki/Getting-Started-wi...

2.测试环境

Ubuntu 16.04

3.安装Ubuntu软件包命令

sudo apt-get install openjdk-8-jdk git-core gnupg flex bison gperf \
build-essential zip curl zlib1g-dev gcc-multilib g++-multilib \
libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev \
lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip \
dosfstools e2fsprogs parted

4.下载Android源代码命令

mkdir -p ~/bin
PATH=~/bin:$PATH

curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

mkdir zynqmp-android8
cd zynqmp-android8

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

repo init -u git://github.com/MentorEmbedded/mpsoc-manifest.git \
-b zynqmp-android_8 -m release_android-8_xilinx-v2018.1.xml

repo sync -c

4.1 下载Android源代码的简化的打印输出

android$ repo sync -c
Fetching project platform/hardware/intel/common/libmix
Fetching project platform/external/gptfdisk
Fetching project platform/system/libhwbinder
Fetching project platform/frameworks/opt/vcard
Skipped fetching project platform/hardware/intel/common/libmix (already have persistent ref)
Skipped fetching project platform/external/gptfdisk (already have persistent ref)
... ...
* [new tag] android-2.3.5_r1 -> android-2.3.5_r1
* [new tag] android-2.3.4_r1 -> android-2.3.4_r1
... ...
Fetching project platform/pdk
... ...
aborted by user

android$ ls .repo/
manifests manifests.git manifest.xml project-objects projects repo

android$ ls .repo/repo/
color.py editor.py git_command.py git_refs.py manifest_xml.pyc progress.py README.md trace.py
color.pyc editor.pyc git_command.pyc git_refs.pyc pager.py progress.pyc repo trace.pyc
command.py error.py git_config.py git_ssh pager.pyc project.py repoc wrapper.py
command.pyc error.pyc git_config.pyc hooks platform_utils.py project.pyc subcmds wrapper.pyc
COPYING event_log.py gitc_utils.py main.py platform_utils.pyc pyversion.py SUBMITTING_PATCHES.md
docs event_log.pyc gitc_utils.pyc manifest_xml.py platform_utils_win32.py pyversion.pyc tests

5. 下载 MALI 400 Userspace Binaries命令

mkdir -p tmp_mali
tar -xf mali-400-userspace.tar -C ./tmp_mali
mkdir -p vendor/xilinx/zynqmp/proprietary
cp -r tmp_mali/mali/Android/android-8/MALI-userspace/r8p0-01rel0/* vendor/xilinx/zynqmp/proprietary/
rm -rf tmp_mali/

5.1 MALI 400 Userspace Binaries,最后应该含有下列文件。

$ tree vendor/xilinx/zynqmp/proprietary/
vendor/xilinx/zynqmp/proprietary/
├── lib64
│ └── libGLES_mali.so
└── libGLES_mali.so

6. 编译Android命令

source build/envsetup.sh
lunch zcu106-eng
make -j8

6.1 可以根据电脑CPU个数,设置命令“make -j8”中的数字。比如我使用了“make -j32”。

6.2 编译完成后,目录"out/target/product/zcu106/boot/"下有下列文件。

BOOT.BIN
kernel
u-boot.elf
uEnv.txt
uramdisk.img
zynqmp-zcu106-revA.dtb

最新文章

最新文章