Setup, Build, and Flashing
Build Environment Setup
- 64-bit environment
- 450GB of free disk space (more is better)
- 64 GB of RAM (more is better)
Please see Android document 'Hardware requirements' for the detail.
There are two different methods you can use to set up the build environment. One is to install the required packages onto your host filesystem.
Another is to use a docker container, where the installation of the required packages is automated for you.
Host Build
Required Packages Installation
- The Ubuntu 22.04 64-bit version is the most tested environment for the Android 16 build.
- Update Ubuntu
sudo apt update
sudo apt full-upgrade
sudo apt autoclean
sudo apt autoremove - Install required packages
sudo apt-get install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 \
liblzo2-dev lzop git curl u-boot-tools mtd-utils \
android-sdk-libsparse-utils device-tree-compiler gdisk m4 bison \
flex make libssl-dev gcc-multilib libgnutls28-dev \
swig liblz4-tool libdw-dev dwarves bc cpio tar lz4 rsync \
ninja-build clang libelf-dev build-essential libncurses5 \
xxd unzip efitools
Install Repo Tool
Install repo
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
chmod a+x repo
sudo mv repo /usr/bin/repo
Download The Source Code
Initialize repo using the latest LTS release (LTS branch):
repo init -u https://github.com/technexion-android/manifest -b tn-android-16.0.0_1.2.0 -m tn-android-16.0.0_1.2.0.xml
Download the source code:
repo sync -j<N>
- <N> is up to core numbers on your host PC
Docker Container Build (Optional)
Adapt docker dontainer based compile environment
- Install docker
- Please follow the instruction of Install Docker Engine on Ubuntu
- Create docker image (Just first time)
cd cookers
docker build -t ubuntu_2204 --build-arg SSH_KEY="$(cat ~/.ssh/id_rsa)" . - Create and run a new docker container. Fill
$(your_source_folder)in following command.sudo docker run -itd --privileged --security-opt seccomp=unconfined --name a16_build -u jenkins -v $(your_source_folder):/home/build ubuntu_2204 /bin/bash - Run a existed docker container
sudo docker container start a16_build
sudo docker container attach a16_build - After entering the container, change directory to /home/build to build Android
Start Compiling The Source Code
Setup Android build environment
EDM-IMX95 + EVM (LVDS)
For example using display LVDS panel VL10112880
source cookers/env.bash.imx8.edm-imx95.evm.lvds10
EDM-G-IMX8MP + WANDBOARD (HDMI)
For example using display HDMI
source cookers/env.bash.imx8.edm-g-imx8mp.wandboard.hdmi
EDM-G-IMX8MP + WIZARD (HDMI)
For example using display HDMI
source cookers/env.bash.imx8.edm-g-imx8mp.wizard.hdmi
Get the NXP restricted extra packages
merge_restricted_extras
- sometimes could be stocking on the waiting github response, please try again.
- Note that it will showing up a EULA message before merge packages, please type 'yes' to continue the process as follows:
Could you agree this EULA and keep install packages?(yes/no) yes
- You only need to install it once, it will take a lot of time to install these packages
Get the Technexion firmware for WiFi/Bluetooth functions (recommended)
get_tn_firmware
- sometimes could be stocking on the waiting git server response, please try again.
- It will install to directory vendor/technexion automatically.
Full build OS image
cook -j<N>
- <N> is up to core numbers on your host PC
Clean the all compiled files
throw
Partial build
After modifying the source code, you can directly build U-Boot, kernel or Android.
Before building
- Goto the top directory of your Android project
- Remember to setup the build environment (see 'Setup Android build environment')
U-Boot
./imx-make.sh bootloader -j<N>
- <N> is up to core numbers on your host PC
Kernel
./imx-make.sh kernel -j<N>
- <N> is up to core numbers on your host PC
Android
Usually build U-Boot and kernel at the same time
./imx-make.sh -j<N>
or
cook -j<N>
- <N> is up to core numbers on your host PC
- If you want build single Android package, see the Android document 'Building the code' for details
Flashing The Output Images
Output relative image files of path:
ls <source>/out/target/product/<target board>/
- <source>: top directory of your project
- <target board>: edm_g_imx8mp or others
uuu way (recommended)
Android 16 need version 1.5.243 or above.
-
TechNexion Android sources already include uuu in vendor/technexion/utils/mfgtools
-
You can download uuu tool from TechNexion's download site
- Linux
- Confirm where the previous uuu was installed
The result may be /usr/bin, /usr/local/bin or other
which uuu - For example, the previous uuu is located in /usr/bin, move the uuu to /usr/bin/ and grant available permissions
If located in /usr/local/bin, move the uuu to /usr/local/bin/ and grant available permissions
sudo cp imx-mfg-uuu-tool/uuu/linux64/uuu /usr/bin/
sudo chmod a+x /usr/bin/uuusudo cp imx-mfg-uuu-tool/uuu/linux64/uuu /usr/local/bin/
sudo chmod a+x /usr/local/bin/uuu
- Confirm where the previous uuu was installed
- Windows
- The prebuilt uuu is located in imx-mfg-uuu-tool/uuu/windows64/uuu.exe
- For usage, please refer to Technexion mfgtools Wiki
- Linux
-
Quick way for flashing to board (adapt uuu based flash script): For Ubuntu host:
cd <source>/out/target/product/<target board>/
sudo ./uuu_imx_android_flash.sh -f [soc_name] -a -e -c [card_size] -D . (-u [uboot_feature])Options:
- [soc_name] is up to your SoC platform of device, such as imx95, imx8mp
- [card_size] is up to your eMMC size
- eMMC 32GB, card_size=28, it is default value.
- eMMC 16GB, card_size=13
- If device changed to QSPI mode, add "-u fspi" args.
sudo ./uuu_imx_android_flash.sh -f [soc_name] -a -e -c [card_size] -D . -u fspi
Example for edm-imx95:
- Linux
sudo ./uuu_imx_android_flash.sh -f imx95 -a -e -D . - Windows
uuu_imx_android_flash.bat -f imx95 -a -e
Example for edm-g-imx8mp:
- Linux
sudo ./uuu_imx_android_flash.sh -f imx8mp -a -e -D . - Windows
uuu_imx_android_flash.bat -f imx8mp -a -e
Steps for boot mode change when flash the image
- Firstly, the user must be change the boot mode to serial download mode and connect a OTG cable from board to host PC.
- Then, running the uuu commands as above post. In the end, change back the boot mode to eMMC boot mode, that's it.
Notes: users need change to serial download mode if adapt uuu tool, and ums just keep eMMC boot mode is enough.
Generate mass production image folder
Another situation is when you need move your image flash tool to factory side for MP, you can do these steps:
- issue command to generate a portable MP image folder
the output folder name is 'auto_test'
gen_mp_images - compress auto_test folder to zip file, then you can take it to factory.
zip -r auto_test.zip auto_test/* - prepare computers for MP, install Ubuntu host PC with required packages as Host Build chapter.
- extract auto_test.zip
then issue flash command as uuu way commands to flash image to target boards.
unzip auto_test.zip