<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.icop.com.tw/product//index.php?action=history&amp;feed=atom&amp;title=1-1-4-1-2</id>
	<title>1-1-4-1-2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.icop.com.tw/product//index.php?action=history&amp;feed=atom&amp;title=1-1-4-1-2"/>
	<link rel="alternate" type="text/html" href="https://wiki.icop.com.tw/product/index.php?title=1-1-4-1-2&amp;action=history"/>
	<updated>2026-05-14T16:10:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.icop.com.tw/product/index.php?title=1-1-4-1-2&amp;diff=675&amp;oldid=prev</id>
		<title>Viky6: Created page with &quot;&lt;!-- Set release according to &quot;release&quot; parameter in URL and use RELEASE_O8.1.0_1.3.0_8M_DART-MX8M as default --&gt; {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} &lt;!-- --&gt; {{#...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.icop.com.tw/product/index.php?title=1-1-4-1-2&amp;diff=675&amp;oldid=prev"/>
		<updated>2020-03-12T06:35:16Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;!-- Set release according to &amp;quot;release&amp;quot; parameter in URL and use RELEASE_O8.1.0_1.3.0_8M_DART-MX8M as default --&amp;gt; {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} &amp;lt;!-- --&amp;gt; {{#...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Set release according to &amp;quot;release&amp;quot; parameter in URL and use RELEASE_O8.1.0_1.3.0_8M_DART-MX8M as default&lt;br /&gt;
--&amp;gt; {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} &amp;lt;!--&lt;br /&gt;
--&amp;gt; {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_O8.1.0_1.3.0_8M_DART-MX8M}}}} &amp;lt;!--&lt;br /&gt;
--&amp;gt; {{PageHeader|{{#var:HARDWARE_NAME}} - Android {{#var:ANDROID_NAME}} {{#var:ANDROID_VERSION}} Developer Guide}} {{DocImage|category1=Android|category2={{#var:HARDWARE_NAME}}}} __toc__&lt;br /&gt;
&lt;br /&gt;
= Introduction&amp;lt;br/&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
This Wiki describes how to build and deploy Android {{#var:ANDROID_NAME}} on the {{#var:HARDWARE_NAME}}. It is based on NXP's {{#var:NXP_BSP_VERSION}} release&lt;br /&gt;
&lt;br /&gt;
= Overview =&lt;br /&gt;
&lt;br /&gt;
The objective of this document is to guide {{#var:HARDWARE_NAME}} Android developers to obtain Android {{#var:ANDROID_NAME}} sources, setting up host environment, compilation, and deployment.&lt;br /&gt;
&lt;br /&gt;
This document contains instructions for:&lt;br /&gt;
&lt;br /&gt;
*Hardware and software requirements.&lt;br /&gt;
*Setup the hardware.&lt;br /&gt;
*Setup the toolchain.&lt;br /&gt;
*Download &amp;amp; build the sources.&lt;br /&gt;
*Install the binaries on the {{#var:HARDWARE_NAME}} SOM and variants.&lt;br /&gt;
&lt;br /&gt;
= Supported hardware and features =&lt;br /&gt;
{{#lst:Android_Platform_Customization|{{#var:ANDROID_SUPPORTED_HARDWARE_SECTION}}}}&lt;br /&gt;
&lt;br /&gt;
= Hardware Requirements =&lt;br /&gt;
You will need the Variscite {{#var:HARDWARE_NAME}} based evaluation kit.&lt;br /&gt;
&lt;br /&gt;
== Host (PC) setup requirements ==&lt;br /&gt;
&lt;br /&gt;
The host development environment for Android is based on Ubuntu, please install &lt;br /&gt;
Ubuntu version 16.04/18.04 64bit LTS [http://www.ubuntu.com/download/desktop http://www.ubuntu.com/download/desktop]&lt;br /&gt;
&lt;br /&gt;
If you are running Linux in a virtual machine you need at least 16GB of RAM/swap.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: &amp;lt;/span&amp;gt;Do not use other Ubuntu releases other than the ones recommended above.&lt;br /&gt;
&lt;br /&gt;
=== Install required packages on host PC ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo apt-get -y install gnupg flex bison gperf build-essential zip gcc-multilib g++-multilib &lt;br /&gt;
$ sudo apt-get -y install libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev&lt;br /&gt;
$ sudo apt-get -y install ccache libgl1-mesa-dev libxml2-utils xsltproc unzip bc&lt;br /&gt;
$ sudo apt-get -y install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev lzop git curl&lt;br /&gt;
$ sudo apt-get -y install u-boot-tools mtd-utils android-tools-fsutils device-tree-compiler gdisk m4 libz-dev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Configure GIT account ===&lt;br /&gt;
 $ git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
 $ git config --global user.email &amp;quot;Your Email&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Install the OpenJDK ===&lt;br /&gt;
To install it:&lt;br /&gt;
&lt;br /&gt;
 $ sudo apt-get update&lt;br /&gt;
 $ sudo apt-get install openjdk-8-jdk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If your Ubuntu version is missing the package (which shouldn't happen), add the PPA repository and run the previous commands again:&lt;br /&gt;
&lt;br /&gt;
 $ sudo add-apt-repository ppa:openjdk-r/ppa&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Update the default Java version by running:&lt;br /&gt;
&lt;br /&gt;
 $ sudo update-alternatives --config java&lt;br /&gt;
 $ sudo update-alternatives --config javac&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: &amp;lt;/span&amp;gt;The build process requires about 135GB of free space.&lt;br /&gt;
&lt;br /&gt;
= &amp;lt;span style=&amp;quot;line-height: 1.5em;&amp;quot;&amp;gt;Obtain source code&amp;lt;/span&amp;gt; =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;line-height: 1.5em;&amp;quot;&amp;gt;Variscite's Linux kernel and U-Boot are available through Github.&amp;lt;br&amp;gt;&lt;br /&gt;
Required patches for the Android file system are under: {{#var:ANDROID_VARFTP_PATCH_DIR}} in Variscite's FTP&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Files:&amp;lt;br&amp;gt;&lt;br /&gt;
* {{#var:ANDROID_VARFTP_BASE_PATCH_FILE}} - NXP's i.MX8M {{#var:ANDROID_NXP_VERSION}} original BSP patch files.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;line-height: 1.5em;&amp;quot;&amp;gt;Get NXP's Android Release Package&amp;lt;/span&amp;gt; ==&lt;br /&gt;
 $ mkdir {{#var:BUILD_FOLDER}}&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}&lt;br /&gt;
 $ curl -o ~/Downloads/{{#var:ANDROID_VARFTP_BASE_PATCH_FILE}} {{#var:ANDROID_VARFTP_PATCH_DIR}}{{#var:ANDROID_VARFTP_BASE_PATCH_FILE}}&lt;br /&gt;
 $ tar xvf ~/Downloads/{{#var:ANDROID_VARFTP_BASE_PATCH_FILE}}&lt;br /&gt;
&lt;br /&gt;
== Download Google Android {{#var:ANDROID_VERSION}} ==&lt;br /&gt;
 $ mkdir -p ~/bin&lt;br /&gt;
 $ curl -o ~/bin/repo http://commondatastorage.googleapis.com/git-repo-downloads/repo&lt;br /&gt;
 $ chmod a+x ~/bin/repo&lt;br /&gt;
 $ export PATH=~/bin:$PATH&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}&lt;br /&gt;
 $ source {{#var:ANDROID_FOLDER_ID}}/imx_android_setup.sh&lt;br /&gt;
* Note : Since Oreo the distribution of Android Source code is partially hosted on Linux Foundation https://source.codeaurora.org/*&lt;br /&gt;
Wait for the script to finish running, and it should create a &amp;quot;{{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}&amp;quot; folder&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}; mkdir -p vendor/variscite/&lt;br /&gt;
&lt;br /&gt;
== Clone Variscite's U-Boot and Linux kernel sources ==&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}/vendor/variscite/&lt;br /&gt;
 $ git clone {{#var:U-BOOT_GIT}} -b {{#var:U-BOOT_BRANCH}}&lt;br /&gt;
 $ git clone {{#var:KERNEL_GIT}} kernel_imx -b {{#var:KERNEL_BRANCH}}&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span style=&amp;quot;line-height: 1.5em;&amp;quot;&amp;gt;Apply Variscite's i.MX platforms' patches&amp;lt;/span&amp;gt; ==&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}/device&lt;br /&gt;
 $ git clone {{#var:ANDROID_VARISCITE_GIT}} -b {{#var:ANDROID_VARISCITE_BRANCH}} variscite&lt;br /&gt;
 $ variscite/scripts/install.sh&lt;br /&gt;
&lt;br /&gt;
= Build Android Images =&lt;br /&gt;
&lt;br /&gt;
Change to Android top level directory.&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}&lt;br /&gt;
 $ source build/envsetup.sh&lt;br /&gt;
 $ lunch {{#var:ANDROID_MACHINE_NAME}}-eng&lt;br /&gt;
 or&lt;br /&gt;
 $ lunch {{#var:ANDROID_MACHINE_NAME}}-userdebug&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: &amp;lt;/span&amp;gt; userdebug build creates a debuggable version of Android.&lt;br /&gt;
eng build creates an engineering version of Android. Development mode enable and development tools are available on target.&lt;br /&gt;
&lt;br /&gt;
 $ export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
== Switching from eMMC build to SD card build and vice versa ==&lt;br /&gt;
Unlike previous Android BSPs, the boot media is autodetected at boot time.&lt;br /&gt;
&lt;br /&gt;
== Build Android ==&lt;br /&gt;
 $ make -j4 2&amp;gt;&amp;amp;1 | tee build1-1.log&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Images created by the Android build ==&lt;br /&gt;
The resulted images are located in out/target/product/{{#if: {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_MACHINE_NAME}} }}.&lt;br /&gt;
&lt;br /&gt;
{{#lst:Android_Platform_Customization|{{#var:ANDROID_IMAGES_SECTION}}}}&lt;br /&gt;
&lt;br /&gt;
= Boot options=&lt;br /&gt;
&lt;br /&gt;
Boot options of the Android:&amp;lt;br&amp;gt;&lt;br /&gt;
1. Directly from SD card&amp;lt;br&amp;gt;&lt;br /&gt;
2. U-Boot boots from on-SOM eMMC&lt;br /&gt;
&lt;br /&gt;
== Flash and boot Android from SD card ==&lt;br /&gt;
=== Create a bootable SD card ===&lt;br /&gt;
Partition and format SD card, and copy all images&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo ./var-mksdcard.sh -f &amp;lt;name&amp;gt; /dev/sdX;sync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Replace &amp;lt;name&amp;gt; with the actual desired setup name according to the second table in the [[#Images_created_by_the_Android_build|&amp;quot;Images created by the Android build&amp;quot; section]].&lt;br /&gt;
* Replace /dev/sdX with your true device, You can identify it with dmesg.&lt;br /&gt;
&lt;br /&gt;
=== Boot From SD card ===&lt;br /&gt;
{{#lst:Android_Recovery_SD_card|BOOT_FROM_SD_CARD}}&lt;br /&gt;
&lt;br /&gt;
== Flash and boot Android from eMMC ==&lt;br /&gt;
&lt;br /&gt;
=== Preparing images ===&lt;br /&gt;
&lt;br /&gt;
All Android built images but system.img are ready for flashing out of the default build.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default system.img and vendor.img format is suitable for flashing using fastboot, and must be modified for flashing using 'dd'.&lt;br /&gt;
&lt;br /&gt;
 $ cd out/target/product/{{#if: {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_MACHINE_NAME}} }}&lt;br /&gt;
 $ simg2img system.img system_raw.img&lt;br /&gt;
 $ simg2img vendor.img vendor_raw.img&lt;br /&gt;
&lt;br /&gt;
=== Flashing Android from Linux shell (when the primary installation android) ===&lt;br /&gt;
An example of flashing eMMC, can be found {{Varlink|Android Recovery SD card|{{#var:RELEASE_PARAM|RELEASE_O8.1.0_1.3.0_8M_DART-MX8M}}|here}}.&lt;br /&gt;
&lt;br /&gt;
Follow the following steps instructions above:&lt;br /&gt;
&lt;br /&gt;
1. Preparing a rescue SD card;&lt;br /&gt;
&lt;br /&gt;
2. Flash from command line (use the install_android.sh script)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further, follow the steps described in paragraph &amp;quot;'''Flashing Android with USB Fastboot'''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Flashing Android with USB Fastboot ===&lt;br /&gt;
==== Install tools on host ====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ sudo apt-get install android-tools-adb android-tools-fastboot&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;Note: &amp;lt;/span&amp;gt; Make sure you built Android for eMMC&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
'''Connect the target with host PC at fastboot mode:'''&lt;br /&gt;
#Connect a USB OTG cable from the target board OTG port to a your host machine USB HOST port.&lt;br /&gt;
#Power up the board and hit return/space to stop the boot at U-Boot.&lt;br /&gt;
#type '''fastboot q''' in the U-Boot command line.&lt;br /&gt;
&lt;br /&gt;
'''On the Host PC:'''&lt;br /&gt;
{{#lst:Android_Platform_Customization|{{#var:ANDROID_FASTBOOT_SECTION}}}}&lt;br /&gt;
Replace ''&amp;lt;name&amp;gt;'' with the actual desired setup name according to the table in the [[#Images_created_by_the_Android_build|&amp;quot;Images created by the Android build&amp;quot; section]].&lt;br /&gt;
&lt;br /&gt;
=== Android recovery mode ===&lt;br /&gt;
==== Enter board in Android Recovery mode ====&lt;br /&gt;
&lt;br /&gt;
Turn on the device by holding down the &amp;quot;back&amp;quot; button must be held until the end of the boot and logged in &amp;quot;Android Recovery&amp;quot; mode.&lt;br /&gt;
&lt;br /&gt;
==== Control menu in Android Recovery Mode ====&lt;br /&gt;
&lt;br /&gt;
# To switch between menu items, use a short press of UP or DOWN buttons&lt;br /&gt;
# To highlight an item, use a long press of BACK or HOME buttons or long touch the touchscreen&lt;br /&gt;
# To activate an item, use a short press of ON/OFF button&lt;br /&gt;
&lt;br /&gt;
==== Update Android firmware ====&lt;br /&gt;
&lt;br /&gt;
===== Generate OTA packages =====&lt;br /&gt;
For generating &amp;quot;OTA&amp;quot; packages, use the following commands:&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}&lt;br /&gt;
 $ make PRODUCT={{#var:ANDROID_MACHINE_NAME}}-userdebug otapackage -j4 2&amp;gt;&amp;amp;1 | tee build1-1.log&lt;br /&gt;
&lt;br /&gt;
===== Install OTA package to device =====&lt;br /&gt;
* extract payload.bin and payload_properties.txt from OTA zip file&lt;br /&gt;
* push file payload.bin to somewhere on the device (typically /cache folder)&lt;br /&gt;
* open payload_properties.txt on an editor to copy its content, lets suppose it's like in the NXP manual:&lt;br /&gt;
  FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=&lt;br /&gt;
  FILE_SIZE=379074366&lt;br /&gt;
  METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ/de8Dgp9zFXt8Fo+Hxccp465uTOvKNsteWU=&lt;br /&gt;
  METADATA_SIZE=46866&lt;br /&gt;
* Issue the following command on adb shell:&lt;br /&gt;
  update_engine_client --payload=file:///cache/payload.bin --update --headers=&amp;quot;FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=&lt;br /&gt;
  FILE_SIZE=379074366&lt;br /&gt;
  METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ/de8Dgp9zFXt8Fo+Hxccp465uTOvKNsteWU=&lt;br /&gt;
  METADATA_SIZE=46866&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note that the command argument --headers=&amp;quot;...&amp;quot; contains the exact (4-line) content of the payload_properties.txt file between quotes (you can copy and paste it), including 3 newline characters.&lt;br /&gt;
 &lt;br /&gt;
After issuing the command, nothing seems to happen on the device, but you can monit logcat for operation progress. After a successful update you can reboot into the updated version.&lt;br /&gt;
&lt;br /&gt;
You can check chapter 7 of official NXP &amp;quot;Android User Guide&amp;quot; for further &amp;quot;Over-The-Air (OTA) Update&amp;quot; examples.&lt;br /&gt;
&lt;br /&gt;
= Manual operations =&lt;br /&gt;
&lt;br /&gt;
== Build boot.img ==&lt;br /&gt;
When you perform changes to the kernel, you may build boot.img solely instead of building the whole Android.&lt;br /&gt;
 $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}&lt;br /&gt;
 $ source build/envsetup.sh&lt;br /&gt;
 $ lunch {{#var:ANDROID_MACHINE_NAME}}-userdebug&lt;br /&gt;
 $ make bootimage&lt;br /&gt;
&lt;br /&gt;
== Toolchain setup for manual build ==&lt;br /&gt;
Setup the toolchain path to point to arm-linux-androideabi- tools in prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin&lt;br /&gt;
 $ export ARCH=arm64&lt;br /&gt;
 $ export CROSS_COMPILE={{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}}/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-&lt;br /&gt;
&lt;br /&gt;
{{#if: {{#var:ANDROID_FASTBOOT_NEED_UNLOCK}} |&lt;br /&gt;
== Unlock device for fastboot ==&lt;br /&gt;
&lt;br /&gt;
Our build behaves like any other standard Android device.&lt;br /&gt;
&lt;br /&gt;
To use fastboot, you should go through the following steps&lt;br /&gt;
&lt;br /&gt;
* Settings =&amp;gt; System =&amp;gt; About Tablet =&amp;gt; Build number&lt;br /&gt;
* keep on tapping until you see a prompt that says &amp;quot;You are now a developer!&amp;quot;&lt;br /&gt;
* Settings =&amp;gt; System =&amp;gt; Advanced =&amp;gt; Developer options =&amp;gt; OEM unlocking&lt;br /&gt;
* reboot to bootloader&lt;br /&gt;
* type &amp;quot;fastboot q&amp;quot; in the U-Boot command line&lt;br /&gt;
* run &amp;quot;sudo `which fastboot` oem unlock&amp;quot; from the Host PC&lt;br /&gt;
* wait until the unlock process is complete&lt;br /&gt;
* proceed for flashing&lt;br /&gt;
&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Viky6</name></author>
		
	</entry>
</feed>