Android Video Run From SD Tutorial

From OMAPpedia

Revision as of 21:48, 24 May 2010 by Hari s (Talk | contribs)
Jump to: navigation, search


Tutorial #1 - Android running from SD card

This is a step by step video tutorial with all the commands to go from Ubuntu installation through Zoom2 Android boot up. The text for this installation is located at the bottom of the page.

Note: If you are planning to build new releases (L25.10 and above) please also follow the text guide as there are changes at few places. This guide is for L25.7 release.

Install Applications

# sudo apt-get install git-core flex bison gperf libesd0-dev 
# sudo apt-get install libwxgtk2.6-dev zlib1g-dev build-essential
# sudo apt-get install libstdc++5 tofrodos libsdl-dev zip curl x-dev 
# sudo apt-get install libx11-dev libncurses5-dev sun-java5-jdk libc6-dev g++ gcc

Install Compilers

$ firefox
This would also work with version 2008q3; which is a newer version.
//(Select ARM GNU/Linux and IA32 GNU/Linux options)
$ mkdir /home/user/bin
//copy download zip to /home/user/bin and unzip here
$ cp /home/user/Desktop/arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2 /home/user/bin/
$ cd /home/user/bin
$ tar -xjvf arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
//Edit .bashrc shell setup
$ cd /home/user
$ gedit .bashrc
//add following to the end
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
export PATH=$PATH:/home/user/bin/arm-2007q3/bin
//save and exit
//apply the path changes
$ source .bashrc
//verify path is ok for tools
$ which arm-none-linux-gnueabi-gcc
// should see /home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi-gcc

Configure Git Proxy (optional)

Use this only if you need to work with a proxy.

$ firefox
//download tar package to Desktop
$ cp /home/user/Desktop/corkscrew-2.0.tar.gz /home/user/bin
$ cd /home/user/bin
$ tar -zxvf corkscrew-2.0.tar.gz
$ cd corkscrew-2.0
$ ./configure
$ make
//add path to .bashrc
$ cd /home/user
$ gedit .bashrc
// add path
export PATH=$PATH:/home/user/bin/corkscrew-2.0 #for corkscrew
$ source .bashrc
$ cd /home/user/bin
$ gedit git-proxy
// add the following 3 lines
# exec <path to corkscrew>/corkscrew <proxy name> <proxy port> $*
exec /home/user/bin/corkscrew-2.0/corkscrew 80 $*
//save and exit
$ chmod a+x ~/bin/git-proxy
//now tell git you want to use a proxy.
//git config --global core.gitproxy '<path to proxy>/git-proxy'
$ git config --global core.gitproxy '/home/user/bin/git-proxy'

Getting the Source

// verify the directory /home/user/bin exist from COMPILER step above
$ curl >~/bin/repo
$ chmod a+x ~/bin/repo
//check manifest comments for latest release id
//in this case we see 25.7
$ mkdir /home/user/l25.7
$ mkdir /home/user/l25.7/mydroid
$ cd /home/user/l25.7/mydroid
//The following command is to instruct to download the manifests for
//the project. The manifests are documents used to select between different
//source versions. You can add a -b <branch name> to select specific branches.
// repo init -u git:// -b myBranch)
$ repo init -u git://

// enter name and password
// user
// now sync, this will download the source and will take a while about 1hour
// repo sync uses the manifest documents to select between the different source versions
$ repo sync


$ cd /home/user/l25.7/mydroid/bootloader/u-boot/
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3430zoom2_config
$ make
$ cd /home/user/l25.7/mydroid/bootloader/x-loader
$ make distclean
$ make CROSS_COMPILE=arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi-
$ make CROSS_COMPILE=arm-none-linux-gnueabi- ift
// add /home/user/l25.7/mydroid/bootloader/u-boot/tools to PATH
$ gedit /home/user/.bashrc
export PATH=$PATH:/home/user/l25.7/mydroid/bootloader/u-boot/tools # for mkimage
// save and exit
$ source /home/user/.bashrc
// cd kernel's path 
//(In some branches the kernel's project is currently not in the manifests 
//and will not download along with the rest of the code from the branch):
//e.g. cd KernelProject2/omap
$ make CROSS_COMPILE=arm-none-linux-gnueabi- distclean
//The following instruction sets the configuration target to build and it
//changes, depending on the kernel you want to build.
//For a list of available targets, list the configurations in arch/arm/configs
$ make CROSS_COMPILE=arm-none-linux-gnueabi- zoom3_defconfig
$ make CROSS_COMPILE=arm-none-linux-gnueabi- uImage
$ cp /home/user/l25.7/mydroid/vendor/ti/zoom2/ /home/user/l25.7/mydroid/
$ cd /home/user/l25.7/mydroid
$ make -j2

Copy files to SD Card

$ mkdir /home/user/l25.7/myfs
$ cd /home/user/l25.7/myfs
$ cp -Rfp /home/user/l25.7/mydroid/out/target/product/zoom2/root/* .
$ cp -Rfp /home/user/l25.7/mydroid/out/target/product/zoom2/system/ .
$ cp -Rfp /home/user/l25.7/mydroid/out/target/product/zoom2/data/ .
$ mv init.rc init.rc.bak
$ cp -Rfp init.omapzoom2.rc init.rc
// ref:
// [[Bootloader Project|Bootloader Project]]
// Required SD card reader and 2GB card
// It is a good idea to format whole card in windows to get to known state.
$ sudo fdisk -l
//this should list your mmc drive something like /dev/sdc
//Disk /dev/sdc: 1977 MB, 1977614336 bytes
$ sudo fdisk /dev/sdc
Command (m for help): d
Command (m for help): x
Expert command (m for help): h
Number of heads (1-256, default 30): 255
Expert command (m for help): s
Number of sectors (1-63, default 29): 63
Warning: setting sector offset for DOS compatiblity
Expert command (m for help): c
// calculate 1977614336/8225280 = 240.43
Number of cylinders (1-1048576, default 2286): 240
Expert command (m for help): r
Command (m for help): n
Command action
e extended
p primary partition (1-4)
Partition number (1-4): 1
First cylinder (1-123, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-123, default 123): +64M
Command (m for help): n
Command action
e extended
p primary partition (1-4)
Partition number (1-4): 2
First cylinder (10-123, default 10):
Using default value 10
Last cylinder or +size or +sizeM or +sizeK (10-123, default 123):
Using default value 123
Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): c
Command (m for help): a
Partition number (1-4): 1
Command (m for help): p
Command (m for help): w
$ sudo umount /media/BOOT
$ sudo umount /media/disk
$ sudo mkfs.vfat -F 32 -n boot /dev/sdc1
$ sudo mkfs.ext3 /dev/sdc2
$ mkdir /tmp/mmc1
$ mkdir /tmp/mmc2
$ sudo mount /dev/sdc1 /tmp/mmc1
$ sudo mount /dev/sdc2 /tmp/mmc2
$ sudo cp /home/user/l25.7/mydroid/bootloader/x-loader/MLO /tmp/mmc1
$ sudo cp /home/user/l25.7/mydroid/bootloader/u-boot/u-boot.bin /tmp/mmc1
$ sudo cp /home/user/l25.7/mydroid/kernel/arch/arm/boot/uImage /tmp/mmc1
$ sudo cp -Rfp /home/user/l25.7/myfs/* /tmp/mmc2
$ chmod -R 777 /tmp/mmc2/*
$ sudo umount /tmp/mmc1
$ sudo umount /tmp/mmc2


// Plug SD card into Zoom2 and power up. USB should be connected to left most usb on debug board.
// The following commands are entered in hyper term terminal
$ nand unlock
$ nand ecc sw
$ setenv bootargs console=ttyS3,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1 mem=256M init=/init
$ setenv bootcmd 'mmcinit; fatload mmc 0 0x80c00000 uImage; bootm 0x80c00000'
$ saveenv
$ boot
Personal tools