Generate Android Image

In Android4SAM Project, two scripts are provided. One for generating an UBIFS image and the other for generating an SD card image.

Requirements

Compiled Android Package

  • We need a successfully compiled Android Package to create the ubifs image. If you don't have one, please refer to BuildAndroid to build the Android Package.
mkfs.ubifs

  • Make sure that you have installed the tools to make ubifs image. If not, the MTD utility must be installed:
        $ sudo apt-get install mtd-utils
    

genext2fs

  • Make sure that you have installed the tools to make SD card image. If not, genext2fs must be installed:
        $ sudo apt-get install genext2fs
    

Steps of Generating Android Root File System Image

Create UBIFS Image

To generate the image, enter your working directory:

  $ cd < ANDROID_WORKING_DIR >
Download Generate_ubifs_image.tar.gz from the following

Description Resource URL
Generate UBIFS image Generate_ubifs_image.tar.gz (~ 2 KB)

Type the commands below to make the ubifs image file:

  $ tar zxvf Generate_ubifs_image.tar.gz
  $ cd Generate_ubifs_image
  $ ./ubifs.sh -b sam9m10

You will see system_ubifs-SAM9M10-ANDROID-2.3.7_r1.img and userdata_ubifs-SAM9M10-ANDROID-2.3.7_r1.img in the current directory.

TIP For usage of ubifs.sh, execute it without parameters. It will print the usage information as following:

$ ./ubifs.sh 

Usage message
./ubifs.sh -b board_chip

-b Specify the board chip.We now support sam9x5 | sam9m10 | sam9g45.
-h This message

TIP For SAM9G45 MCU, please use the following command

$ ./ubifs.sh -b sam9g45
TIP For SAM9X5 MCU, please use the following command
$ ./ubifs.sh -b sam9x5

If anything wrong. please check the make_android_ubifs.log file.

Create SD Card Image

To generate the image, enter your working directory:

  $ cd < ANDROID_WORKING_DIR >
Download Generate_sdcard_image.tar.gz from the following

Description Resource URL
Generate SD Card Image Generate_sdcard_image.tar.gz (~ 8 MB)

Type the commands below to make the sdcard image file:
ALERT! Note that, the SD card device node depends on your Linux host, here takes /dev/sdb as an example.
Warning, important When execute sdimage.sh, it needs root privilege.

  $ tar zxvf Generate_sdcard_image.tar.gz
  $ cd Generate_sdcard_image
  $ sudo ./sdimage.sh -b sam9m10 -s /dev/sdb

Answer YES, if you make sure the sd card device node after the hints.

After finishing this step, the SD card is OK for booting up the Android system.

TIP For usage of sdimage.sh, execute it without parameters. It will print the usage information as following:

Usage message
-----------------------------
./sdimage.sh -b board_chip -s /dev/sdxx [-u uImage_dir] [-d xxxM]
-b Specify the board chip. We now support sam9g45, sam9m10, sam9x5
-s Specify the sdcard node. Like /dev/sdc. You should plugin in the sdcard first
-u Specify the dir of the uImage if you want update kernel image. It is not a must
-d Specify the userspace size on sd card.It is not a must,default is 200M
-h This message
TIP For SAM9G45 MCU, please use the following command
$ sudo ./sdimage.sh -b sam9g45 -s /dev/sdb
TIP For SAM9X5 MCU, please use the following command
$ sudo ./sdimage.sh -b sam9x5 -s /dev/sdb

If anything wrong you can check the make_android_sdcard.log file.

Steps of Load Image

Load UBIFS Image

After you have your own system_ubifs-SAM9M10-ANDROID-2.3.7_r1.img and userdata_ubifs-SAM9M10-ANDROID-2.3.7_r1.img file, you can
  • Replace the same name file in the NAND boot demo package, and run the script to flash into target board. Please refer here.
  • Or use SAM-BA software to flash
    the system_ubifs-SAM9M10-ANDROID-2.3.7_r1.img file into NAND flash at offset 0x00500000,
    while userdata_ubifs-SAM9M10-ANDROID-2.3.7_r1.img flash at offset 0x06400000
  • Then, reboot the board.

Load SD Card Image

After you flash image into the SD card
  • Disable NAND flash, NOR flash, Data flash
  • Insert your own SD card
  • Power on the board.


See also: BuildAndroid
r13 - 11 Apr 2013 - 03:23:10 - VoiceShen
 
Android4SAM

Copyright by the contributing authors. All material on the platform is the property of the contributing authors.

Android is a trademark of Google Inc. Use of this trademark is subject to Google Permissions

Atmel and others, are registered trademarks or trademarks of Atmel or its subsidiaries.This site is powered by the TWiki collaboration platform

ARM and others are registered trademarks or trademarks or ARM Ltd. Other terms and product names may be trademarks of others.

Under the terms of the Creative Commons Attribution License

Syndicate this siteRSS ATOM