Android Video Run From SD Tutorial

From OMAPpedia

Revision as of 02:46, 24 August 2009 by Omapwiki (Talk | contribs)
Jump to: navigation, search

Contents

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.

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-java6-jdk libc6-dev g++ gcc

Install Compilers

$ firefox http://www.codesourcery.com/sgpp/lite/arm/releases/2007q3
//(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
#PATH
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)


$ firefox http://www.agroman.net/corkscrew/
//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
#!/bin/sh
# exec <path to corkscrew>/corkscrew <proxy name> <proxy port> $*
exec /home/user/bin/corkscrew-2.0/corkscrew wwwgate.ti.com 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 http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
//INSTALL SOURCE
//check manifest comments for latest release id
firefox http://git.omapzoom.org/?p=platform/omapmanifest.git;a=summary
//in this case we see 25.7
$ mkdir /home/user/l25.7
$ mkdir /home/user/l25.7/mydroid
$ cd /home/user/l25.7/mydroid
$ repo init -u git://git.omapzoom.org/repo/android/platform/omapmanifest.git
// enter name and password
// user tiomapvideos@gmail.com
// now sync, this will download the source and will take a while about 1hour
$ repo sync


Build

//BUILD U-BOOT
$ cd /home/user/l25.7/mydroid/bootloader/u-boot/
//make CROSS_COMPILE=/<path>/arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=/home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi- omap3430zoom2_config
$ make
//BUILD X-LOADER (NAND)
$ cd /home/user/l25.7/mydroid/bootloader/x-loader
$ make distclean
$ make CROSS_COMPILE=/home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=/home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi-
$ make CROSS_COMPILE=/home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi- ift
//BUILD KERNEL
// 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 /home/user/l25.7/mydroid/kernel
$ make CROSS_COMPILE=/home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi- distclean
$ make CROSS_COMPILE=/home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi- omap_zoom2_android_defconfig
$ make CROSS_COMPILE=/home/user/bin/arm-2007q3/bin/arm-none-linux-gnueabi- uImage
//BUILD FILESYSTEM
$ cp /home/user/l25.7/mydroid/vendor/ti/zoom2/buildspec.mk.default /home/user/l25.7/mydroid/buildspec.mk
$ cd /home/user/l25.7/mydroid
$ make -j2


Copy files to SD Card

# COPY FILESYSTEM TO MYFS DIRECTORY
$ 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
//FORMAT SD CARD
// ref:https://www.omapzoom.org/gf/project/omapzoom/wiki/?pagename=BootingAndFlashing
// 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)
p
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)
p
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
//umount
$ sudo umount /media/BOOT
$ sudo umount /media/disk
//format
$ sudo mkfs.vfat -F 32 -n boot /dev/sdc1
$ sudo mkfs.ext3 /dev/sdc2
//copy
$ 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/*
 
//umount
$ sudo umount /tmp/mmc1
$ sudo umount /tmp/mmc2

Boot

// Plug SD card into Zoom2 and power up. USB should be connected to left most usb on debug board.
//SETUP ENVIROMENT VARIABLES
// 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 em=256M init=/init
$ setenv bootcmd 'mmcinit; fatload mmc 0 0x80c00000 uImage; bootm 0x80c00000'
$ saveenv
$ boot
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox