[EVO 4G Android Development] Homefix:
UPDATE GO HERE: http://xdaforums.com/showthread.php?t=932754

Revised Ubuntu Installation Created By Homefix and RooferDave

I just put this together today, gotta get back to work, the snowstorms over (im from western NY) might be errors will edit and update as time permits

all scripts contain original authors and credits where aplicable.
​

This tutorial will show you how to create a Debian Image, Emulate that image using The Qemu Emulator in Ubuntu.And finally setup that image on your EVO

I cannot be held responsible if your foolish enough to do, what is outlined below!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I will take the time to post the credits soon.

However the scripts speak for themselves and the creators have left there info in them.

Thanks really goes out to them.

Most of this came from here: https://wiki.edubuntu.org/ARM/BuildArmPackages

Things you need:

# I hope you have the EVO (last i heard radio shack may have 1 left. DRIVE CAREFULLY, theres snow everywere).

# Computer BestBuy ? I prefer to build my own (Brite Computers Fishers NY).
​

and a small note, you need ubuntu ruuning do do any of the image creation-manipulation.

​

I wasnt able to get VBOX to emulate the Image so... UPDATE yes i was able to get it working i was having a router issue.So give VBOX a try http://www.virtualbox.org/wiki/Downloads

you can either try to get it to work with VBOX,(goodluck), or dust off one of your old computers and get Ubuntu up.

But you may have to do what i did, i yanked out the family computer from the living room and fit in my literally 4' x 7' office to get this done.

i dont worry to much, i know they love me for spending the last 2 weeks with my face attached to the monitor.

# Rom: CyanogenMod-6. You could try others. (i tell my daughter who always copies her sister "you are your own nucklehead").
​

(good luck finding these links) http://wiki.cyanogenmod.com/index.php?title=Latest_Version#HTC_Evo_4G

Nightlies here: (i prefer this addiction over others). http://mirror.teamdouche.net/?type=nightly
​

# PLENTY OF PATIENCE

Get your phone ready: http://xdaforums.com/wiki/index.php?title=HTC_Supersonic/Guides_%26_Tutorials#Guides_For_Root

Root: http://xdaforums.com/wiki/index.php?title=HTC_Supersonic/Guides_&_Tutorials#Guides_For_Root

Setup ADB: http://xdaforums.com/showthread.php?t=694250

Setup Ubuntu http://www.ubuntu.com/desktop/get-ubuntu/download

My 3G Karmic Rootstock Image http://www.megaupload.com/?d=SJY6ZB58

login dad

passwd f

root passwd not set

then go to line 1000

let me know if i have the right one posted.

Setup Rootstock
​

IN THE BEGINING

In your Ubuntu terminal type: "mkdir /<your home directory>/qemuArm"

(dont includ the < >'s or the ""'s) your home directory usually is /home/<your user name>/

then: cd /<your home directory>/qemuArm

then: sudo apt-get install qemu qemu-kvm-extras

then: sudo apt-get install debootstrap (if you dont have it already)

then: sudo apt-get install fakeroot (if you dont have it already)

then: sudo apt-get install bzr (if you dont have it already)

then: (download rootstock bzr branch)

sudo bzr branch lp:roject-rootstock

then: (download kernel to /<your home directory>/qemuArm) just

make sure you dont leave the, /<your home directory>/qemuArm directory
​

CREATION

then: (create your image)

​

sudo project-rootstock/rootstock --fqdn ubuntu --login ubuntu --password ubuntu --notarball --imagesize 3G --seed nano

or: custimize your image with the info in the readme file, in the /<your home directory>/qemuArm/project-rootstockfolder
​

(when your image is complete)

then: (make a copy)

cp qemu-armel-<replace with your #>.img <whatever you name it>.img (remove the <>'s)
​

EMULATION

Download the http://ports.ubuntu.com/ubuntu-ports/dists/lucid/main/installer-armel/current/images/versatile/netboot/ to ~/qemuArm

USE THIS WEBPAGE AND FIND THE LINK FOR YOUR KERNEL VERSATILE

https://wiki.edubuntu.org/ARM/BuildArmPackages

Then: (start your emulation) -----> dont forget to remove the <>'s <------

sudo qemu-system-arm -M versatilepb -cpu cortex-a8 -kernel ./vmlinuz -hda <whatever you name it>.img -m 256 -append "root=/dev/sda mem=256M devtmpfs.mount=0 rw"

then: (hopefully you will see a blank screen)

press alt-F1 if you do not see a login prompt go back to the begining
​

SO LET THER BE LIGHT

then: log in

then: (to change password)

sudo tmppwd ubuntu and to change login name never do "usermod -l newname -m -d /home/newname oldname" pic the right name at creation.

then: sudo tmppwd root (if you want to set root password)
​

THEN THERE WERE TWO

In the Emulated terminal:

(configure network connections)
​

sudo nano /etc/network/interfaces

add: (under existing entries of the file):

auto eth0

iface eth0 inet dhcp
​

then cntrl-X, confirm save, and exit.

then sudo ifconfig eth0 up

then sudo dhclient eth0

then sudo apt-get update (if it aint broke dont fix it) otherwise go back to the beginning
​

BORN AGAIN

On the Host System make sure Qemu is not running.

then: (install some more stuff)

sudo apt-get install bridge-utils

This assumes if you have a basic networking system with eht0 as interface

then: (configure network bridge)
​

sudo nano /etc/network/interfaces

add: (under existing entries of the file)

auto br0

iface br0 inet dhcp

bridge_ports eth0

bridge_maxwait 0
​

then: cntrl-X, confirm save, and exit.

then: sudo ifconfig eth0 0.0.0.0

then: sudo ifup br0

then: (Load the tun module (you can add tun to /etc/modules if you want it to load on boot)

sudo modprobe tun

then: set permissions

sudo chmod 0666 /dev/net/tun

then: (change Qemu Script)

sudo nano /etc/qemu-ifup

add: a "#" symbol to all existing entries except the first line (got it?)

add: (under existing entries of the file):

echo "Executing /etc/qemu-ifup"

echo "Bringing up $1 for bridged mode..."

sudo /sbin/ifconfig $1 0.0.0.0 promisc up

echo "Adding $1 to br0..."

sudo /usr/sbin/brctl addif br0 $1

sleep 2

​

then: set permissions

sudo chmod +x /etc/qemu-ifup

then: start emulation

sudo qemu-system-arm -M versatilepb -cpu cortex-a8 -kernel ./vmlinuz -hda <whatever you name it>.img -m 256 -append "root=/dev/sda mem=256M devtmpfs.mount=0 rw" -net nic -net tap
​

then: login

then: sudo apt-get install openssh-server

if: that goes well, your home free (we'll discuss errors later)
​

LEARN TO TALK

Now: you can ssh into or scp to your ARM VM from the host.

get ip address to ssh into or scp to, by simply running ifconfig in the ARM terminal.

install your applications

Or just get right to it and see what this is all about
​

LEARN TO WALK

Now: we will setup the chroot

Change your imagename to ubuntu.img

Using file manager, Create a folder (on your phone) /sdcard/ubuntu,

and transfer ubuntu.img to your sdcard folder, ubuntu.
​

Copy the following text including the (#) and paste into notepad++
​

(get it http://notepad-plus-plus.org/download) or in linux gedit or Eqvlnt.
​

Save as sdcard/ubuntu/bootubuntu (no extension)nothing more.
​

#modprobe ext2

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

export kit=/sdcard/ubuntu

export bin=/system/bin

if [ ! -d /data/local/ubuntu ]

then

mkdir /data/local/ubuntu

fi

export mnt=/data/local/ubuntu

export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH

export TERM=linux

export HOME=/root

mknod /dev/loop1 b 7 0

losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img

mount -t ext2 /dev/block/loop1 /data/local/ubuntu

#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt

mount -t devpts devpts $mnt/dev/pts

mount -t proc proc $mnt/proc

mount -t sysfs sysfs $mnt/sys

sysctl -w net.ipv4.ip_forward=1

echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"

echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf

echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf

echo "Setting localhost on /etc/hosts "

echo "127.0.0.1 localhost" > $mnt/etc/hosts

echo "READY TO ROCK AND ROLL BABY! "

echo "Brought to you by NexusOneHacks.net and the open source community! "

echo " "

chroot $mnt /bin/bash

#After exit command is executed clear it all up

echo " "

echo "Shutting down Ubuntu"

umount $mnt/dev/pts

umount $mnt/proc

umount $mnt/sys

umount $mnt

losetup -d /dev/loop1

AND DO THE SAME FOR THE NEXT 4 FILES AND NAME THEM CORRECTLY AND USE THE RIGHT TEXT EDITOR

This next file is called sdcard/ubuntu/unionfs (remember no file ext.)

busybox insmod unionfs

mount -t unionfs -o dirs=$mnt/etc=rw:/etc=ro unionfs /etc

mount -o remount,rw /

ln -s $mnt/lib /

for x in \

bin boot home media mnt \

opt selinux srv usr var

do

ln -s $mnt/$x /

done

rmdir /root

ln -s $mnt/root /

mount -o remount,ro /

mount -t unionfs -o dirs=$mnt/sbin=rw:/sbin=ro unionfs /sbin

mount -t unionfs -o dirs=$mnt/dev=rw:/dev=rw unionfs /dev

mount -t devpts devpts /dev/pts

This next file is called sdcard/ubuntu/fsrw (remember no file ext.)

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

echo "Filesytem remounted as read/write"

This next file is called sdcard/ubuntu/mountonly (remember no file ext.)

# Based on Saurik's remount.sh - modified by Mark Walker of http://www.androidfanatic.com

# Email admin@androidfanatic.com

modprobe ext2

clear

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

export kit=/sdcard/debian

export bin=/data/local/bin

export mnt=/data/local/mnt

export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH

export TERM=linux

export HOME=/root

busybox insmod ext2

clear

echo " "

mount -o loop,noatime $kit/debian.img $mnt

mount -t devpts devpts $mnt/dev/pts

mount -t proc proc $mnt/proc

mount -t sysfs sysfs $mnt/sys

echo "Custom Linux IMG Mounter V1.0 - by Mark Walker"

echo "WEB: http://www.androidfanatic.com"

echo "EML: admin@androidfanatic.com"

sleep 1

echo "AutoMounter started"

sleep 1

echo "REBOOT PHONE TO PROPERLY DISMOUNT"

echo " "

# chroot $mnt /bin/bash

This next file is called sdcard/ubuntu/ubuntu.sh (this one has .sh for file ext)

mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

modprobe ext2

clear

rm -f /data/local/bin/fsrw

rm -f /data/local/bin/bootubuntu

rm -f /data/local/bin/unionfs

rm -f /data/local/bin/installer.sh

rm -f /data/local/bin/mountonly

mkdir /data/local/mnt

clear

rm /system/bin/fsrw

rm /system/bin/bootubuntu

rm /system/bin/unionfs

rm -/system/bin/mountonly

cp -f fsrw /system/bin

cp -f bootubuntu /system/bin

cp -f unionfs /system/bin

cp -f mountonly /system/bin

cd /sdcard/ubuntu

chmod 4777 *

cd /system/bin/

chmod 4777 *

cd /

clear

echo " "

echo "Ubuntu Chroot Bootloader v0.1"

echo "Ubuntu Bootloader is now installed!"

echo "This process does NOT damage Android OS!"

echo " "

echo "Original Installer by Charan Singh"

echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net"

echo " "

echo "To enter the Debian Linux console just type 'bootubuntu'"

bootubuntu

After you have,

bootubuntu

fsrw

mountonly

unionfs

ubuntu.sh

ubuntu.img

in your /sdcard/ubuntu folder

Open adb shell

Enter: su

then: cd /sdcard/ubuntu

then: sh ./ubuntu.sh

then: apt-get update

then: apt-get install tightvncserver

then: apt-get install lxde

this is LINE 1000

then: export USER=root

then: vncserver :0 -geometry 1024x800

then: cat > front

then: export USER=root

then: cd /

then: rm -r -f /tmp

then: mkdir /tmp

then: cd /

then: vncserver :0 -geometry 1024x800

then: press "cntrl D", "cntrl D" again, then Enter)

then: cat front /root/.bashrc > temp

then: cp temp /root/.bashrc

then:

Get Android VNC for you phone (market)

open app

enter 5900 for port

enter password you setup for vncserver

enter (for nick) username you picked during creation

enter (for address) localhost

set graphics for 24 bit

Connect

let the fun begin

Next update: How to network with Hamachi

It does work