Android Video Run From SD Tutorial

From OMAPpedia

Jump to: navigation, search

Contents

[edit] 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.

[edit] 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

[edit] Install Compilers

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

[edit] Configure Git Proxy (optional)

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

$ 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 /corkscrew   $*
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 '/git-proxy'
$ git config --global core.gitproxy '/home/user/bin/git-proxy'

[edit] 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
//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  to select specific branches.
//e.g.:
// repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b myBranch)
$ repo init -u git://git.omapzoom.org/platform/omapmanifest.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

[edit] Build

//BUILD U-BOOT
$ cd /home/user/l25.7/mydroid/bootloader/u-boot/
$ make CROSS_COMPILE=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=arm-none-linux-gnueabi- omap3430zoom2_config
$ make CROSS_COMPILE=arm-none-linux-gnueabi-
$ make CROSS_COMPILE=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 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
//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

[edit] 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
// [[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)
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

[edit] 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 mem=256M init=/init
$ setenv bootcmd 'mmcinit; fatload mmc 0 0x80c00000 uImage; bootm 0x80c00000'
$ saveenv
$ boot
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox