Difference between revisions of "IoTGateway/BSP/Android/Android BSP User Guide 5.1"

From ESS-WIKI
Jump to: navigation, search
 
(26 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
=== Java ===
 
=== Java ===
  
$ sudo apt-get install openjdk-7-jdk
+
  <small>$ sudo apt-get install openjdk-7-jdk</small>
  
 
=== freescale Android_User's_Guide ===
 
=== freescale Android_User's_Guide ===
Line 38: Line 38:
 
The BSP contains cross toolchain, linux kernel source code, u-boot source code, Android root file system and some scripts. It is consist of three top folders: "android", "image", "scripts".
 
The BSP contains cross toolchain, linux kernel source code, u-boot source code, Android root file system and some scripts. It is consist of three top folders: "android", "image", "scripts".
  
 
+
=== Image File Naming Rule ===
 
 
<small> prebuilt/gcc/linux-x86/host/  &nbsp;: cross toolchain
 
  bootable/bootloader/uboot-imx/&nbsp;: u-boot source code
 
  kernel_imx/                  &nbsp;: linux kernel source code
 
  device
 
  fsl/&nbsp;: Android device related settings
 
  fsl-proprietary/              &nbsp;: modules & firmware(e.g. WiFi, GPU)
 
  hardware/imx/                &nbsp;: HAL (Hardware Abstraction Layer)
 
  image/                        &nbsp;: all built images located in
 
  scripts/                      &nbsp;: to simplify building process</small>
 
 
 
=== Naming Rule ===
 
  
 
It is consist of the model name followed by "AB" plus version number, for example, 4410ABV5001 which "4410" stands for RSB-4410, "AB" is acronym of Android BSP, "V5001" stands for Version 5001; other model names list below:
 
It is consist of the model name followed by "AB" plus version number, for example, 4410ABV5001 which "4410" stands for RSB-4410, "AB" is acronym of Android BSP, "V5001" stands for Version 5001; other model names list below:
Line 57: Line 45:
 
   "5420" stands for ROM-5420_B1
 
   "5420" stands for ROM-5420_B1
 
   "4411" stands for RSB-4411-A1</small>
 
   "4411" stands for RSB-4411-A1</small>
 
===  ===
 
  
 
=== Build Instructions ===
 
=== Build Instructions ===
  
[Step1]&nbsp; Set&nbsp; the $JAVA_HOME environment variable&nbsp;
+
<span style="font-family:times new roman,times,serif;"><span style="font-size:small;">If your product is RSB-4410, the product name is rsb_4410_a2</span></span>
<pre>export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
 
</pre>
 
 
 
[Step2] &nbsp;Set up the environment for building.
 
<pre>$ source build/envsetup.sh</pre>
 
  
 +
<span style="font-family:times new roman,times,serif;"><span style="font-size:small;">$PRODUCT = rsb_4410_a2</span></span>
  
 +
<span style="font-family:times new roman,times,serif;"><span style="font-size:small;">If your product is ROM-5420 B1, the product name is rom_5420_b1</span></span>
  
[Step3]&nbsp; Execute the Android lunch command.
+
<span style="font-family:times new roman,times,serif;"><span style="font-size:small;">$PRODUCT = rom_5420_b1</span></span>
  
If your product is RSB-4410, please send command.
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;">[<span style="color:#0000CD;">Step1</span>]&nbsp;&nbsp;Upzip BSP</span></span>
  
User mode
+
<small>$ tar zxvf imx6ABV500x_2016-xx-xx.tgz</small>
<pre>lunch rsb_4410_a2-user</pre>
 
  
Eng mode
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;">[<span style="color:#0000CD;">Step2</span>] &nbsp;</span></span>
<pre>lunch rsb_4410_a2-eng</pre>
 
  
If your product is ROM-5420 B1, please send command.
+
<small>$ cd ~/imx6ABV500x_2016-xx-xx/android</small>
  
User mode
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;">[<span style="color:#0000CD;">Step3</span>]&nbsp; Set&nbsp; the $JAVA_HOME environment variable&nbsp;</span></span>
<pre>$ lunch rom_5420_b1-user    </pre>
 
  
Eng mode
+
<small>$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/</small>
<pre>$ lunch rom_5420_b1-eng</pre>
 
  
[Step4]&nbsp; Make command to generate the image
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;">[<span style="color:#0000CD;">Step4</span>] &nbsp;Set up the environment for building.</span></span>
<pre>$ make 2>&1 | tee build-log.txt</pre>
 
  
 +
<small>$ source build/envsetup.sh</small>
  
 +
<small><span style="font-size:small;"><span style="font-family:times new roman,times,serif;">[<span style="color:#0000CD;">Step5</span>]&nbsp; Execute the Android lunch command.</span></span></small>
  
 +
<small>$ lunch $PRODUCT-user                  <-- User mode</small>
 +
<small>$ lunch $PRODUCT-eng                  <-- Eng mode</small>
  
 +
<small><span style="font-size:small;">[<span style="color:#0000CD;">Step6]</span>&nbsp; Make command to generate the image</span></small>
 +
<small>$ make 2>&1 | tee build-log.txt</small>
  
=== ===
+
<small><span style="font-size:small;"><span style="font-family:times new roman,times,serif;">[<span style="color:#0000CD;">Step7]</span>&nbsp; Converts a sparse system image to a raw system image</span></span></small>
  
Building U-Boot images
+
<small>$ out/host/linux-x86/bin/simg2img out/target/product/$PRODUCT/system.img out/target/product/$PRODUCT/system_raw.img
 +
$ mv out/target/product/$PRODUCT/system_raw.img out/target/product/$PRODUCT/system.img</small>
  
Perform the following command in terminal console
+
<small><small><span style="font-size:x-small;"><span style="font-family:times new roman,times,serif;">Building U-Boot images</span></span></small></small>
  
:<pre><code>$ make -j4 bootloader</code></pre>
+
<small><small><span style="font-size:x-small;"><span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span></span></small></small>
  
:The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./out/target/product/product_name
+
<small><small><small>$ make -j4 bootloader</small></small></small>
  
Building boot.img
+
:<small><small><span style="font-size:x-small;"><span style="font-family:times new roman,times,serif;">The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./out/target/product/product_name</span></span></small></small>
  
:Perform the following command in terminal console
+
<small><small><span style="font-size:x-small;"><span style="font-family:times new roman,times,serif;">Building boot.img</span></span></small></small>
:to do build bootimage<br/>
 
:<pre>$ make -j4 bootimage</pre>
 
  
Building system.img
+
:<small><small><span style="font-family:times new roman,times,serif;"><span style="font-size:x-small;">Perform the following command in terminal console</span></span></small></small>
 +
:<small><small><span style="font-family:times new roman,times,serif;"><span style="font-size:x-small;">to do build bootimage</span></span></small></small><br/>
  
:Perform the following command in terminal console
+
<small>$ make -j4 bootimage</small>
:to do build systemimage<br/>
 
:<pre>$ make -j4 systemimage</pre>
 
  
:<pre>$ out/host/linux-x86/bin/simg2img out/target/product/$PRODUCT/system.img out/target/product/$PRODUCT/system_raw.img</pre>
+
<small><small><span style="font-size:x-small;"><span style="font-family:times new roman,times,serif;">Building system.img</span></span></small></small>
  
:<pre>$ mv out/target/product/$PRODUCT/system_raw.img out/target/product/$PRODUCT/system.img</pre>
+
:<small><small><span style="font-size:x-small;"><span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span></span></small></small>
 +
:<small><small><span style="font-size:x-small;"><span style="font-family:times new roman,times,serif;">to do build systemimage</span></span></small></small><br/>
  
simg2img is a tool that converts a sparse system image to a raw system image on a Linux host PC and is located in myandroid/out/host/linux-x86/bin/simg2img.<br/>The android-tools-fsutils package includes the simg2img command for Ubuntu Linux OS.
+
<small>$ make -j4 systemimage</small>
  
 +
<small>$ out/host/linux-x86/bin/simg2img out/target/product/$PRODUCT/system.img out/target/product/$PRODUCT/system_raw.img
 +
$ mv out/target/product/$PRODUCT/system_raw.img out/target/product/$PRODUCT/system.img</small>
  
 +
<small><small><span style="font-family:times new roman,times,serif;"><span style="font-size:x-small;">simg2img is a tool that converts a sparse system image to a raw system image on a Linux host PC and is located in myandroid/out/host/linux-x86/bin/simg2img.<br/>The android-tools-fsutils package includes the simg2img command for Ubuntu Linux OS.</span></span></small></small>
  
 +
<small><small><span style="font-family:times new roman,times,serif;"><span style="font-size:x-small;">Building recovery image</span></span></small></small>
  
 +
:<small><small><span style="font-family:times new roman,times,serif;"><span style="font-size:x-small;">Perform the following command in terminal console</span></span></small></small>
 +
:<small><small><span style="font-family:times new roman,times,serif;"><span style="font-size:x-small;">to do build recoveryimage</span></span></small></small><br/>
  
Building recovery image
+
<small>$ make -j4 recoveryimage</small>
  
:Perform the following command in terminal console
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><small><small>Boot up from SD card or eMMC</small></small></span></span>
:to do build recoveryimage<br/>
 
:<pre>$ make -j4 recoveryimage</pre>
 
  
===  ===
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><small><small>To create a bootable SD card</small></small></span></span>
  
=== Boot up from SD card or eMMC ===
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span></span>
  
=== To create a bootable SD card ===
+
<small>$ cd {BSPHOME}/scripts
 +
$ ./mksd-android.sh ${SD_DEVICE}</small>
  
:Perform the following command in terminal console
 
  
  $ cd {BSPHOME}/scripts
 
  $ ./mksd-android.sh ${SD_DEVICE}</code>
 
  
=== To create a bootable SD card ===
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><small><small>To create a bootable SD card</small></small></span></span>
  
:Perform the following command in terminal console
+
<span style="font-size:small;"><span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span></span>
  
  $ cd /data/mkimage/scripts
+
<small>$ cd /data/mkimage/scripts  
  $ sh ./mksd-android.sh ${MMC_DEVICE}
+
$ sh ./mksd-android.sh ${MMC_DEVICE}</small>

Latest revision as of 07:29, 9 December 2016

Setup host computer

Setup Ubuntu host computer

Install Ubuntu 14.04 LTS 64bit. You should have about 80 Gbytes of free disk space for building images.

Go to http://releases.ubuntu.com/14.04/ and download 64-bit PC (AMD64) desktop image: http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso for the installation.

Install required packages

Java

 $ sudo apt-get install openjdk-7-jdk

freescale Android_User's_Guide

 $ sudo apt-get apt-get update
 $ 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

Android Open Source Project (AOSP)

http://source.android.com/source/initializing.html

 sudo apt-get install 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 ccache \
 libgl1-mesa-dev libxml2-utils xsltproc unzip

Setup Advantech Android BSP In RISC Platform

The BSP contains cross toolchain, linux kernel source code, u-boot source code, Android root file system and some scripts. It is consist of three top folders: "android", "image", "scripts".

Image File Naming Rule

It is consist of the model name followed by "AB" plus version number, for example, 4410ABV5001 which "4410" stands for RSB-4410, "AB" is acronym of Android BSP, "V5001" stands for Version 5001; other model names list below:

 "4410" stands for RSB-4410-A2
 "5420" stands for ROM-5420_B1
 "4411" stands for RSB-4411-A1

Build Instructions

If your product is RSB-4410, the product name is rsb_4410_a2

$PRODUCT = rsb_4410_a2

If your product is ROM-5420 B1, the product name is rom_5420_b1

$PRODUCT = rom_5420_b1

[Step1]  Upzip BSP

$ tar zxvf imx6ABV500x_2016-xx-xx.tgz

[Step2]  

$ cd ~/imx6ABV500x_2016-xx-xx/android

[Step3]  Set  the $JAVA_HOME environment variable 

$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/

[Step4]  Set up the environment for building.

$ source build/envsetup.sh

[Step5]  Execute the Android lunch command.

$ lunch $PRODUCT-user                  <-- User mode
$ lunch $PRODUCT-eng                   <-- Eng mode

[Step6]  Make command to generate the image

$ make 2>&1 | tee build-log.txt

[Step7]  Converts a sparse system image to a raw system image

$ out/host/linux-x86/bin/simg2img out/target/product/$PRODUCT/system.img out/target/product/$PRODUCT/system_raw.img
$ mv out/target/product/$PRODUCT/system_raw.img out/target/product/$PRODUCT/system.img

Building U-Boot images

Perform the following command in terminal console

$ make -j4 bootloader
The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./out/target/product/product_name

Building boot.img

Perform the following command in terminal console
to do build bootimage
$ make -j4 bootimage

Building system.img

Perform the following command in terminal console
to do build systemimage
$ make -j4 systemimage
$ out/host/linux-x86/bin/simg2img out/target/product/$PRODUCT/system.img out/target/product/$PRODUCT/system_raw.img
$ mv out/target/product/$PRODUCT/system_raw.img out/target/product/$PRODUCT/system.img

simg2img is a tool that converts a sparse system image to a raw system image on a Linux host PC and is located in myandroid/out/host/linux-x86/bin/simg2img.
The android-tools-fsutils package includes the simg2img command for Ubuntu Linux OS.

Building recovery image

Perform the following command in terminal console
to do build recoveryimage
$ make -j4 recoveryimage

Boot up from SD card or eMMC

To create a bootable SD card

Perform the following command in terminal console

$ cd {BSPHOME}/scripts
$ ./mksd-android.sh ${SD_DEVICE}


To create a bootable SD card

Perform the following command in terminal console

$ cd /data/mkimage/scripts 
$ sh ./mksd-android.sh ${MMC_DEVICE}