Difference between revisions of "IoTGateway/BSP/Android/BSPsandImagesn"
(Created page with "== Set-up Development Environment == === <span style="font-family:times new roman,times,serif;"><span style="font-size:medium;">Setup Ubuntu host computer</span></span> ===...") |
|||
Line 21: | Line 21: | ||
== Source code == | == Source code == | ||
+ | === <span style="font-family:times new roman,times,serif;"><span style="font-size:medium;">Getting Android source code (Android 6.0.1_2.1.0/kernel Yocto-2.0 /U-Boot Yocto-2.0)</span></span> === | ||
+ | |||
+ | |||
+ | <syntaxhighlight lang="bash">$ mkdir myandroid $ mkdir bin | ||
+ | $ cd myandroid/ | ||
+ | $ curl [https://storage.googleapis.com/git-repo-downloads/repo https://storage.googleapis.com/git-repo-downloads/repo] > ../bin/repo | ||
+ | $ chmod a+x ../bin/repo | ||
+ | $ ../bin/repo init -u [https://github.com/ADVANTECH-Corp/android-manifest.git https://github.com/ADVANTECH-Corp/android-manifest.git] -b m6.0.1_2.1.0-ga | ||
+ | $ ../bin/repo sync</syntaxhighlight><span style="font-family:times new roman,times,serif;"><span style="font-size:small;">Remove the .repo and .git file</span></span> | ||
+ | |||
+ | <syntaxhighlight lang="bash">$ find . -name .repo | xargs rm -rf | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | <syntaxhighlight lang="bash">$ find . -name .git | xargs rm -rf | ||
+ | </syntaxhighlight> <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">Patch to Android M6.0.1_2.1.0</span></span> | ||
+ | |||
+ | <syntaxhighlight lang="bash">$ cd myandroid/bootable/bootloader/uboot-imx/ | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | <syntaxhighlight lang="bash">$ patch -p1 <../../../patches_android_6.0.1/6001-Uboot_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch | ||
+ | $ cd myandroid/kernel_imx/ | ||
+ | $ patch -p1 <../patches_android_6.0.1/6001-Linux_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch | ||
+ | $ cd myandroid/ | ||
+ | </syntaxhighlight> | ||
== Build Android == | == Build Android == | ||
+ | |||
+ | === <span style="font-family:times new roman,times,serif;">Building Android 6.0.1_2.1.0 android image</span> === | ||
+ | |||
+ | <span style="font-family:times new roman,times,serif;">[ For reference ]</span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">If your product is RSB-4410A1, the product name is rsb_4410_a1</span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><span style="color:#FF0000;">$PRODUCT = rsb_4410_a1</span></span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">If your product is RSB-xxxx the product name is rsb_xxxx_a1</span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><span style="color:#FF0000;">$PRODUCT = rsb_xxxx_a1</span></span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">If your product is ROM-xxxx the product name is rom_xxxx_a1</span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><span style="color:#FF0000;">$PRODUCT = rom_xxxx_a1</span></span></span> | ||
+ | |||
+ | === <span style="font-family:times new roman,times,serif;">Build Instructions</span> === | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">Set the $JAVA_HOME environment variable</span></span> | ||
+ | |||
+ | <small>$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/</small> | ||
+ | |||
+ | |||
+ | |||
+ | ==== <span style="font-family:times new roman,times,serif;">To build android image</span> ==== | ||
+ | |||
+ | :<span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span> | ||
+ | :<span style="font-family:times new roman,times,serif;">to do build systemimage</span><br/> | ||
+ | |||
+ | <small>$ make -j4 systemimage</small> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">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.</span></span> | ||
+ | |||
+ | <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> | ||
== Build U-Boot and Kernel == | == Build U-Boot and Kernel == | ||
+ | |||
+ | ==== <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">To build u-boot</span></span> ==== | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span></span> | ||
+ | |||
+ | <small>$ make -j4 bootloader</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 style="font-family:times new roman,times,serif;">To build kernel</span> ==== | ||
+ | |||
+ | :<span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span> | ||
+ | :<span style="font-family:times new roman,times,serif;">to do build bootimage</span><br/> | ||
+ | |||
+ | <small>$ make -j4 bootimage</small> | ||
== U-Boot Upgrade == | == U-Boot Upgrade == | ||
+ | |||
+ | <span style="font-size:small;"># The script below can be used to upgrade u-boot reference: [https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script <span style="color:#0000FF;">https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script</span>]</span> | ||
== Flash SD Card == | == Flash SD Card == | ||
+ | |||
+ | <span style="font-size:small;"># The script below can be used to partition a SD card reference: [https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script <span style="color:#0000FF;">https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script</span>]</span> | ||
== Flash eMMC == | == Flash eMMC == | ||
+ | |||
+ | <span style="font-size:small;"># The script below can be used to flash to eMMC reference: [https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script <span style="color:#0000FF;">https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script</span>]</span> | ||
+ | |||
+ | == Make OTA == | ||
+ | |||
+ | === Build OTA image === | ||
+ | |||
+ | ==== <span style="font-family:times new roman,times,serif;">Build ota image</span> ==== | ||
+ | |||
+ | <span style="font-family:times new roman,times,serif;">[ For reference ]</span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">If your product is RSB-4410A1, the product name is rsb_4410_a1</span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><span style="color:#FF0000;">$PRODUCT = rsb_4410_a1</span></span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">If your product is RSB-xxxx the product name is rsb_xxxx_a1</span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><span style="color:#FF0000;">$PRODUCT = rsb_xxxx_a1</span></span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">If your product is ROM-xxxx the product name is rom_xxxx_a1</span></span> | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;"><span style="color:#FF0000;">$PRODUCT = rom_xxxx_a1</span></span></span> | ||
+ | |||
+ | ==== <span style="font-family:times new roman,times,serif;">Build Instructions</span> ==== | ||
+ | |||
+ | <span style="font-size:small;"><span style="font-family:times new roman,times,serif;">Set the $JAVA_HOME environment variable</span></span> | ||
+ | |||
+ | <small>$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/</small> | ||
+ | |||
+ | ===== <span style="font-family:times new roman,times,serif;">To build ota image</span> ===== | ||
+ | |||
+ | :<span style="font-family:times new roman,times,serif;">Perform the following command in terminal console</span> | ||
+ | :<span style="font-family:times new roman,times,serif;">to do build ota image</span><br/> | ||
+ | |||
+ | <small>$ make -j4 otapackage</small> | ||
+ | |||
+ | <span style="font-family:times new roman,times,serif;">The ota package update.zip, will be located in directory, ./out/target/product/product_name</span> | ||
+ | |||
+ | === Flash OTA image === | ||
+ | |||
+ | <span style="font-family:times new roman,times,serif;">copy the ota image file update.zip to corresponding vendor partition</span> | ||
+ | |||
+ | === Use ota image to upgrade android system === | ||
+ | |||
+ | ==== Click Settings / About tablet / Addition system updates: ==== | ||
+ | |||
+ | [[File:Android-ota1.jpg|RTENOTITLE]] | ||
+ | |||
+ | ==== Wait for one moment, system will reboot for updating. ==== | ||
+ | |||
+ | [[File:Android-ota2.jpg|RTENOTITLE]] | ||
+ | |||
+ | ==== It will take some time to update. ==== | ||
+ | |||
+ | <span style="font-family:times new roman,times,serif;">When the system startup next time,it runs the upgraded system!</span> | ||
== Release Note == | == Release Note == | ||
+ | [[Category:Pages with broken file links]] |
Revision as of 07:03, 4 February 2017
Contents
Set-up Development Environment
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 docker and Use docker
Please use docker environment to compiler Android 6.0.1_2.1.0
Android 6.0.1_2.1.0 Docker
Image Repository : advrisc/u14.04-imx6abv4
Image Tag : 20160825
Reference: http://ess-wiki.advantech.com.tw/view/IoTGateway/Docker
Source code
Getting Android source code (Android 6.0.1_2.1.0/kernel Yocto-2.0 /U-Boot Yocto-2.0)
$ mkdir myandroid $ mkdir bin
$ cd myandroid/
$ curl [https://storage.googleapis.com/git-repo-downloads/repo https://storage.googleapis.com/git-repo-downloads/repo] > ../bin/repo
$ chmod a+x ../bin/repo
$ ../bin/repo init -u [https://github.com/ADVANTECH-Corp/android-manifest.git https://github.com/ADVANTECH-Corp/android-manifest.git] -b m6.0.1_2.1.0-ga
$ ../bin/repo sync
$ find . -name .repo | xargs rm -rf
$ find . -name .git | xargs rm -rf
$ cd myandroid/bootable/bootloader/uboot-imx/
$ patch -p1 <../../../patches_android_6.0.1/6001-Uboot_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch
$ cd myandroid/kernel_imx/
$ patch -p1 <../patches_android_6.0.1/6001-Linux_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch
$ cd myandroid/
Build Android
Building Android 6.0.1_2.1.0 android image
[ For reference ]
If your product is RSB-4410A1, the product name is rsb_4410_a1
$PRODUCT = rsb_4410_a1
If your product is RSB-xxxx the product name is rsb_xxxx_a1
$PRODUCT = rsb_xxxx_a1
If your product is ROM-xxxx the product name is rom_xxxx_a1
$PRODUCT = rom_xxxx_a1
Build Instructions
Set the $JAVA_HOME environment variable
$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
To build android image
- Perform the following command in terminal console
- to do build systemimage
$ make -j4 systemimage
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.
$ 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
Build U-Boot and Kernel
To build u-boot
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
To build kernel
- Perform the following command in terminal console
- to do build bootimage
$ make -j4 bootimage
U-Boot Upgrade
# The script below can be used to upgrade u-boot reference: https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script
Flash SD Card
# The script below can be used to partition a SD card reference: https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script
Flash eMMC
# The script below can be used to flash to eMMC reference: https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script
Make OTA
Build OTA image
Build ota image
[ For reference ]
If your product is RSB-4410A1, the product name is rsb_4410_a1
$PRODUCT = rsb_4410_a1
If your product is RSB-xxxx the product name is rsb_xxxx_a1
$PRODUCT = rsb_xxxx_a1
If your product is ROM-xxxx the product name is rom_xxxx_a1
$PRODUCT = rom_xxxx_a1
Build Instructions
Set the $JAVA_HOME environment variable
$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
To build ota image
- Perform the following command in terminal console
- to do build ota image
$ make -j4 otapackage
The ota package update.zip, will be located in directory, ./out/target/product/product_name
Flash OTA image
copy the ota image file update.zip to corresponding vendor partition
Use ota image to upgrade android system
Click Settings / About tablet / Addition system updates:
Wait for one moment, system will reboot for updating.
It will take some time to update.
When the system startup next time,it runs the upgraded system!