FORUMS
Remove All Ads from XDA

DEVELOPMENT : Ubuntu Lucid CHROOT: updated scripts

687 posts
Thanks Meter: 321
 
Post Reply Email Thread
************************************************** *******
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:
  1. Rooted and busybox installed phone.
  2. Android terminal software would be needed for commands.
  3. 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.
  1. Ubuntu.sh <- setup script required to be run once in whole lifecycle.
  2. starttux <- chroot setup script required to be run after every reboot.
  3. tuxcmd <- script to get console based access to ubuntu
  4. stoptux <- script to stop linux.
Besides these 4 files two important commands are available when you login to tuxcmd.
  1. `ui` <- used to start the vnc server
  2. `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
Code:
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

Code:
#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
Code:
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
Code:
#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

Code:
if [ `pgrep Xtightvnc` ]
then
    echo "VNC SERVER Already running"
else
    vncserver -geometry 850x480
fi
KILLUI
Code:
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
Code:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
"$VNCDESKTOP Desktop" &
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
for LXDE same startup file becomes
Code:
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
for netbook i am using this xstartup
Code:
#!/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 *****************
The Following 29 Users Say Thank You to anantshri For This Useful Post: [ View ] Gift anantshri Ad-Free
9th April 2011, 12:46 PM |#3  
Senior Member
Thanks Meter: 242
 
More
would love to see a video
9th April 2011, 12:49 PM |#4  
tremendouz's Avatar
Senior Member
Flag Saarbrücken
Thanks Meter: 142
 
More
or maybe screenshots,

this sounds very well
The Following User Says Thank You to tremendouz For This Useful Post: [ View ] Gift tremendouz Ad-Free
9th April 2011, 01:08 PM |#5  
OP Senior Member
Flag Bangalore
Thanks Meter: 321
 
Donate to Me
More
Quote:
Originally Posted by PlayGunsta

nice done mate

Thanks

Quote:
Originally Posted by fiscidtox

would love to see a video

I am weak at video's so that might take some time.

Quote:
Originally Posted by tremendouz

or maybe screenshots,

this sounds very well

Screenshots I will keep adding here

Standard Command prompt


LXDE running


a bonus which i am working on right now
Metasploit unleashed on Xperia


Netbook Launcher
The Following 5 Users Say Thank You to anantshri For This Useful Post: [ View ] Gift anantshri Ad-Free
9th April 2011, 01:14 PM |#6  
kozxmartt's Avatar
Senior Member
Thanks Meter: 60
 
More
Cool!
How's it running... smooth ?
9th April 2011, 01:19 PM |#7  
OP Senior Member
Flag Bangalore
Thanks Meter: 321
 
Donate to Me
More
Quote:
Originally Posted by kozxmartt

Cool!
How's it running... smooth ?

Running Smothly.

However i prefer using console more then gui so for me CLI is smooth.
9th April 2011, 01:28 PM |#8  
Yperion's Avatar
Senior Member
Flag Agrinio
Thanks Meter: 24
 
More
Quote:
Originally Posted by anantshri


a bonus which i am working on right now
Metasploit unleashed on Xperia

Thats all what we need
Great work mate....
9th April 2011, 01:29 PM |#9  
Adolf1994's Avatar
Senior Member
Flag Fertőrákos
Thanks Meter: 66
 
More
pretty cool, well done mate
however, the X10's screen is 854x480, not 850x480 (in the UI script)
9th April 2011, 01:40 PM |#10  
OP Senior Member
Flag Bangalore
Thanks Meter: 321
 
Donate to Me
More
Quote:
Originally Posted by Adolf1994

pretty cool, well done mate
however, the X10's screen is 854x480, not 850x480 (in the UI script)

Thanks

I did tried 854x480 however the VNC Server every time was showing me resolution as 856x480 and 2 pixels where floating off the screen

that's why i prefered 850 and fixed value.
9th April 2011, 02:06 PM |#11  
DooMLoRD's Avatar
Inactive Recognized Developer
Flag Pune
Thanks Meter: 39,785
 
Donate to Me
More
try running them before the OS boots...

u can test this by adding the commands to the file /system/bin/chargemon

*** this is a major system modification and can break recovery/OS booting ***
The Following User Says Thank You to DooMLoRD For This Useful Post: [ View ] Gift DooMLoRD Ad-Free
Post Reply Subscribe to Thread

Tags
chroot, lucid, ubuntu

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes