Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
anantshri
Old
(Last edited by anantshri; 21st February 2012 at 01:16 PM.)
#1  
Senior Member - OP
Thanks Meter 310
Posts: 672
Join Date: Feb 2011
Location: Bangalore

 
DONATE TO ME
Smile DEVELOPMENT : Ubuntu Lucid CHROOT: updated scripts

************************************************** *******
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 27 Users Say Thank You to anantshri For This Useful Post: [ Click to Expand ]
 
xPlayGunZ
Old
#2  
xPlayGunZ's Avatar
Senior Member
Thanks Meter 545
Posts: 2,093
Join Date: Nov 2010

 
DONATE TO ME
nice done mate
Like a boss
 
fiscidtox
Old
#3  
Senior Member
Thanks Meter 242
Posts: 1,377
Join Date: Dec 2010
would love to see a video
If you like tech house or techno, check out my latest mix!

http://soundcloud.com/djdtox/dtox-never-come-down
 
tremendouz
Old
#4  
tremendouz's Avatar
Senior Member
Thanks Meter 89
Posts: 510
Join Date: Nov 2010
Location: Cologne
or maybe screenshots,

this sounds very well
The Following User Says Thank You to tremendouz For This Useful Post: [ Click to Expand ]
 
anantshri
Old
(Last edited by anantshri; 13th April 2011 at 07:16 AM.)
#5  
Senior Member - OP
Thanks Meter 310
Posts: 672
Join Date: Feb 2011
Location: Bangalore

 
DONATE TO ME
Quote:
Originally Posted by PlayGunsta View Post
nice done mate
Thanks

Quote:
Originally Posted by fiscidtox View Post
would love to see a video
I am weak at video's so that might take some time.

Quote:
Originally Posted by tremendouz View Post
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: [ Click to Expand ]
 
kozxmartt
Old
#6  
kozxmartt's Avatar
Senior Member
Thanks Meter 55
Posts: 239
Join Date: Feb 2011
Cool!
How's it running... smooth ?
 
anantshri
Old
#7  
Senior Member - OP
Thanks Meter 310
Posts: 672
Join Date: Feb 2011
Location: Bangalore

 
DONATE TO ME
Quote:
Originally Posted by kozxmartt View Post
Cool!
How's it running... smooth ?
Running Smothly.

However i prefer using console more then gui so for me CLI is smooth.
whoami : Technology Enthusiast : My Website | MY Blog

My Work
DROIDCAT : Information Security Application Collection
Whitepaper : Security Issues in android custom ROMs

My Threads :
DEVELOPMENT : Ubuntu Lucid CHROOT: updated scripts
[DEV] BACKTRACK 5 on Xperia X10 chroot

My Devices
Phone : Xperia X10i (Self customized 2.3.3)
Tablet : Kindle Fire 6.3 (Stock rooted)
Music Player : iPod Touch 4G (8GB) - Jailbroken(5.1.1)
 
Yperion
Old
#8  
Yperion's Avatar
Senior Member
Thanks Meter 20
Posts: 130
Join Date: Nov 2010
Location: Agrinio
Quote:
Originally Posted by anantshri View Post

a bonus which i am working on right now
Metasploit unleashed on Xperia
Thats all what we need
Great work mate....
 
Adolf1994
Old
#9  
Adolf1994's Avatar
Senior Member
Thanks Meter 66
Posts: 382
Join Date: Jun 2010
Location: Fertőrákos
pretty cool, well done mate
however, the X10's screen is 854x480, not 850x480 (in the UI script)
Mipony Download Manager - the ultimate download manager for crappy hosts, like hotfile... Spread the word to make downloading much easier


I just like the show

Am I the only one here with animated avatar?
 
anantshri
Old
#10  
Senior Member - OP
Thanks Meter 310
Posts: 672
Join Date: Feb 2011
Location: Bangalore

 
DONATE TO ME
Quote:
Originally Posted by Adolf1994 View Post
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.
whoami : Technology Enthusiast : My Website | MY Blog

My Work
DROIDCAT : Information Security Application Collection
Whitepaper : Security Issues in android custom ROMs

My Threads :
DEVELOPMENT : Ubuntu Lucid CHROOT: updated scripts
[DEV] BACKTRACK 5 on Xperia X10 chroot

My Devices
Phone : Xperia X10i (Self customized 2.3.3)
Tablet : Kindle Fire 6.3 (Stock rooted)
Music Player : iPod Touch 4G (8GB) - Jailbroken(5.1.1)

 
Post Reply+
Tags
chroot, lucid, ubuntu
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...