[XPERIA X10 Android Development] anantshri:
*********************************************************

For LXDE : check Update 12 April 2011

For netbook launcher : Check update 13 April 2011

for Dropbox Links : check Below. : UPDATE : DROPBOX LINKS MIGHT BE BLOCKED

Screenshots : POST no 5

*********************************************************

Hi All

I am a linux user and have been trying to get my phone to run linux too... so finally after a lot of messing around i got Ubuntu 10.04 aka Lucid runing on my phone.

I used a stack image provided by https://code.google.com/p/android-cruft/ This image is a stripped down version of the Ubuntu img file and hence a good setup for customization.

However the problems i had with this as well as other images so far was following.

1) 2GB is very small when you want and LXDE to run : good for showoff not good for actual working conditions.

2) bootubuntu or bootdebian scripts won't let me keep the system mounted.. as soon as i exit the shell my ubuntu gets unmounted.

3) All the scripts wont play well with APP2SD or simmilar applications.

REQUIRED:

Rooted and busybox installed phone.

Android terminal software would be needed for commands.

Android VNC Viewer.

Alternate Download link (mirror provided by husseinb )

LXDE.7z.001 http://glycogen.net/download/3/

LXDE.7z.002 http://glycogen.net/download/4/

NETBOOK_parts.7z.001 http://glycogen.net/download/5/

NETBOOK_parts.7z.002 http://glycogen.net/download/6/

NETBOOK_parts.7z.003 http://glycogen.net/download/7/

NETBOOK_parts.7z.004 http://glycogen.net/download/8/

DROPBOX Links as alternate download option

NOTE : please use them for alternate download only I have already got one warning for excessive usage.

LXDE

LXDE part 1 : MD5 : 82af57faf360b3f1921b6def4acfe466

LXDE part 2 : MD5 : a59025db138780db79d69f417c4e9f91

NETBOOK

NETBOOK part 1 : MD5 : 08818edcb1b3fff293557d8e56a65bc4

NETBOOK part 2 : MD5 : 58f0561ed74f0f815f045b9014895313

NETBOOK part 3 : MD5 : 4dd9da548d04d7dece03468959a6993a

NETBOOK part 4 : MD5 : 345804d086054bd446397384245ac2db

UPDATE : 13 April 2011

first Post cleared with all old data and only new updated images kept now.

NETBOOK LAUNCHER PRECONFIGURED IMAGES : http://www.megaupload.com/?d=I3V10B4I

UPDATE : 12 April 2011

LXDE preinstalled package : http://www.megaupload.com/?d=657SPCB5

These file contains all the stuff you need.

GUIDE FOLLOWS BELOW

************* USER PORTION START HERE ******************

******STEPS TO FOLLOW ****************

1) extract the content and copy then to /sdcard/ubuntu

2) run 'sh ubuntu.sh' only once.

3) run 'starttux' (is now made to work without userinput so if needed you can place it is startup using gscripts.)

4) run 'tuxcmd'

a) 'ui' inside tuxcmd to start vnc server

to use GUI use any vncviwer and connect to localhost:5901

NOTE : VNCPASSWORD : 12345678

b) to kill vnc server : use 'killui'

5) when you want to stop ubuntu 'stoptux'

********** STEPS END HERE ************

********** THINGS TO KNOW ************

The whole script portion visible is divided into 4 scripts.

Ubuntu.sh <- setup script required to be run once in whole lifecycle.

starttux <- chroot setup script required to be run after every reboot.

tuxcmd <- script to get console based access to ubuntu

stoptux <- script to stop linux.

Besides these 4 files two important commands are available when you login to tuxcmd.

`ui` <- used to start the vnc server

`killui` <- used to stop the vnc server

once you have the image inside tuxcmd you can run vncpasswd to change password.

to use GUI use any vncviwer available in android market.

point it to localhost:5901.

NOTE : VNC PASSWORD : 12345678

******************* USER PORTION END HERE ***************

******************* DEVELOPER SECTION ********************

below i have provided code for all the files mentioned above

Note : I will keep updating the code as and when i do the updation.

UBUNTU.SH

echo " "
echo "Ubuntu Chroot v0.2-anant-netbook"
echo "This process does NOT damage Android OS!"
echo " "
echo "Original Script by Charan Singh"
echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net"
echo "Xperia Customized by Anant shrivastava http://anantshri.info "
echo " "
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
echo "Cleaning up old Chunks . . ."
rm /system/bin/tuxcmd
rm /system/bin/starttux
rm /system/bin/stoptux
echo "Creating necessary directories"
if [ ! -d /data/local/mnt ]
then
mkdir /data/local/mnt
fi
#copy the files to places
echo "Setting up files"
cp -f starttux /system/bin
cp -f stoptux /system/bin
cp -f tuxcmd /system/bin
echo "Ubuntu is now configure!"
echo " "
echo "to Start ubuntu type 'starttux'"
echo "once ubuntu started use tuxcmd to gain shell"
echo "when you want to shutdown type 'stoptux'"

STARTTUX

#Mount SYSTEM RW
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
#exporting useful variables
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
# Mounting Image to the farthest loop point
# FIXME : check if mount sucessfull otherwise abort whole process.
mknod /dev/block/loop255 b 7 255
busybox losetup /dev/block/loop255 $kit/ubuntu.img
busybox mount -t ext2 /dev/block/loop255 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
# Mounting SD Card inside the CHROOT
busybox mount -o bind /sdcard /data/local/mnt/sdcard
#seting environment
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 "Brought to you by NexusOneHacks.net and the open source community! "
echo "Customized by Anant shrivastava http://anantshri.info"
echo "Ubuntu configured to use it just type 'tuxcmd'"

TUXCMD

mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo "Customized by Anant shrivastava http://anantshri.info"
echo " "
busybox chroot $mnt /bin/bash

STOPTUX

#Cleanup
#After exit command is executed clear it all up
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
echo "Cleaning the Ubuntu leftover and returning back the memory to Android."
echo "by Anant Shrivastava http://anantshri.info "
echo "Shutting down Ubuntu"
sync
busybox umount -l $mnt/sdcard
busybox umount -l $mnt/dev/pts
busybox umount -l $mnt/proc
busybox umount -l $mnt/sys
busybox umount -l $mnt
busybox losetup -d /dev/block/loop255
mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
echo " "
echo "Please reboot to properly unmount Ubuntu"
echo "Specially If you recieved an error before this line"

UI <- available inside chroot

if [ `pgrep Xtightvnc` ]
then
echo "VNC SERVER Already running"
else
vncserver -geometry 850x480
fi

KILLUI

kill -KILL `pidof Xtightvnc`
rm /tmp/.X11-unix/X1
rm -rf /tmp/.X1-lock

These launcher Settings are obtained using VNC xstartup file

so posting some sample xstartup files

for default GNOME UI

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
"$VNCDESKTOP Desktop" &
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession

for LXDE same startup file becomes

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession

for netbook i am using this xstartup

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
"$VNCDESKTOP Desktop" &
x-window-manager &
export XKL_XMODMAP_DISABLE=1
maximus &
netbook-launcher-efl &

**************** DEVELOPER SECTION END *****************