[Atrix 4G Android Development] SystemR89:
[size=+4]Take back WebTop![/size]​

Use anythings you can imagine! LibreOffice, Java, Firefox 4, ecc...

[size=+2]WHAT THIS MOD DOES:[/size]

Installing WebTopMOD your awm dock will be populated with 3 new icons: leafpad, lxterminal and a penguin.

Leafpad and lxterminal works inside WebTop but clicking on the penguin you get a Debian menu chrooted http://en.wikipedia.org/wiki/Chroot in a Debian enviroment. In xterm you can use synaptic and apt-get to install anything in this new enviroment.

For example I need gimp:

# apt-get update //refresh packages list from internet
# apt-get install gimp
# gimp //

Clicking another time on the penguin open another xterm IN THE SAME ENVIROMENT so I can start another program

# oo-writer //openoffice writer

NOTE: Debian disk contain a Debian stable (squeeze) release, some software could be "outdated", if you would live on the edge change stable to unstable in /etc/apt/sources.list IN CHROOT ENVIRONMENT. DO NOT TRY TO CHANGE REPOSITORY IN ORIGINAL WEBTOP ROOT

Look here (http://www.debian.org/releases/) to understand what differ between Debian branches

For example LibreOffice is not yet in stable branch, so you can install OpenOffice or switch repo to testing or unstable

Firefox is renamed Iceweasel and the latest version in unstable is 3.5 and from experimental 4.0.

REMEMBER THAT 0.x VERSION MEAN THAT THIS SOFTWARE CAN BE BUGGED AND I CONSIDER IT IN ALPHA TESTING

[size=+2]PREREQUISITES:[/size]

- A rooted Atrix

- At least 2GB free in internal memory (could be more or less with the customized installation)

- A little bit terminal knowledge and willpower

- Brain

- Liquorice mojito

[size=+2]INSTALLATION:[/size]

[size=+1][1st way - EASY METHOD][/size]

Prerequisite for this method is:

On your phone: CWM installed

0) Download Debian disk - http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z

1) Unpack in your internal or external storage (path should be /sdcard(-ext)/WebTopMOD/linuxdisk)

Please don't use "adb push" it corrupt big files

2) Download easy-signed.zip - http://www.multiupload.com/C5GEIHDEM0, MIRROR

3) Install using CWM, reboot and enter in WebTop!

Uninstaller for version >=0.2.7 http://www.multiupload.com/18H5OHND90, MIRROR

Uninstaller for version <= 0.2.2 http://www.multiupload.com/W37DT6HJ7X

Uninstaller for version 0.2.1 http://www.multiupload.com/TO6W9X7CBU

Uninstaller for version >= 0.2 http://www.multiupload.com/GLKUZA2KP9

[size=+1][2nd way - CUSTOM METHOD][/size]

Temporary deprecated

Prerequisite for this method is:
On your computer: have a Debian installation or a Debian live cd or download this file ([url]http://www.multiupload.com/403F0OQEDA[/url] -> 2GB disk in 66MB), unpack it and skip to step 8
On your phone: install a "complete" busybox thought any free market apps and be connected to internet with a wireless network.

[b][On your phone][/b]
0) Start WebTop and leave it opened

[b][On your computer][/b]
1) Create a file with the dimensions that fit your needs using dd (I used this command to create the 2GB file: dd bs=1024 count=1 seek=$((1024*1024*2-1)) if=/dev/zero of=debian)
2) Format the new "disk" using ext3 (mkfs.ext3 debian)
3) Create a folder to mount the disk (mkdir temp)
4) Mount the disk (sudo mount -t ext3 -o loop debian temp)
5) Debootstrap! (sudo debootstrap --foreign --arch armel stable temp [url]http://ftp.debian.org/debian[/url])
6) Wait...
7) Unmount disk (sudo umount temp) and remove temp directory (rmdir temp)
8) Copy debian in your internal storage inside a folder called "DEBIAN" (uppercase without quotes)

[b][On your computer if you are using adb (recommended) or on your phone using terminal emulator, connectbot, ecc)][/b]
9) Open a terminal and type:
Get superuser permissions
[code]
# su

edit sudoers

# vi /etc/sudoers

You should add "%admin ALL=NOPASSWD: ALL" after the line containing "%admin ALL=(ALL) ALL". You can try typing this:

Please note that if you are using a terminal emulator on your phone escape is bad interpreted by Android using a physical keyboard, you have to send the escape key in another way.

GkyyPjwwwld3wi
NOPASSWD: [with a space]
[Escape]
:wq!

Now we enter in a more complete and privileged bash

# /usr/bin/sudo -H -u adas bash

Enable AWM to launch anything

Search→Go To… line 1317

Take this line:

use_profile 3

and turn it into:

use_profile 2

sudo leafpad /etc/tomoyo/domain_policy.conf

Now you can add any launcher to your AWM, look in easy-signed.zip (/usr/share/applications and /home/michele/easy/home/adas/.gconf/apps/avant-window-navigator)

Mount debian disk:

# cd /sdcard/DEBIAN
# mkdir root
# sudo mount -t ext3 -o loop=/dev/block/loop7 debian root

Debootstrap! (second stage)

# sudo chroot root /debootstrap/debootstrap --second-stage

Disable X ACL (in WebTop)

# export DISPLAY=:0
# xhost +

Enter in the new system

# sudo cp /etc/hosts /sdcard/DEBIAN/root/etc/hosts
# sudo cp /etc/fstab /sdcard/DEBIAN/root/etc/fstab
# sudo cp /etc/resolv.conf /sdcard/DEBIAN/root/etc/resolv.conf
# sudo mount -o bind /proc /sdcard/DEBIAN/root/proc
# sudo mount -o bind /dev /sdcard/DEBIAN/root/dev
# sudo mount -o bind /dev/pts /sdcard/DEBIAN/root/dev/pts
# sudo mount -o bind /dev/shm /sdcard/DEBIAN/root/dev/shm
# sudo mount -o bind /sys /sdcard/DEBIAN/root/sys
# sudo mount -o bind /var/run/dbus/ /sdcard/DEBIAN/root/var/run/dbus/
# sudo chroot /sdcard/DEBIAN/root /bin/bash

Export X display (in chroot)

# export DISPLAY=:0

Add Debian main repository

# echo "deb http://ftp.debian.org/debian/ stable main non-free contrib" > /etc/apt/sources.list

Finish debian installation

# apt-get update ; apt-get install dbus dialog locales

Configure your locale

# dpkg-reconfigure locales

Install xterm

# apt-get install xterm

Run xterm!

# xterm

Now you can install anything simply using "apt-get install PROGRAM_NAME" or installing synaptic

Before unplug HDMI cable you should exit form chroot environment and unmount the chroot:

# exit
# sudo umount /sdcard/DEBIAN/root/proc
# sudo umount /sdcard/DEBIAN/root/dev
# sudo umount /sdcard/DEBIAN/root/dev/pts
# sudo umount /sdcard/DEBIAN/root/dev/shm
# sudo umount /sdcard/DEBIAN/root/sys
# sudo umount /sdcard/DEBIAN/root/var/run/dbus
# sudo umount /sdcard/DEBIAN/root

[size=+2]USE:[/size] (ONLY FOR CUSTOM METHOD)

[On your computer if you are using adb or on your phone using terminal emulator, connectbot, ecc)]

9) Open a terminal and type:

Get superuser permissions

# su

Now we enter in a more complete and privileged bash

# /usr/bin/sudo -H -u adas bash

Mount debian disk:

# cd /sdcard/DEBIAN
# sudo mount -t ext3 -o loop=/dev/block/loop7 debian root

Disable X ACL (in WebTop)

# export DISPLAY=:0
# xhost +

Enter in the new system

# sudo cp /etc/hosts /sdcard/DEBIAN/root/etc/hosts
# sudo cp /etc/fstab /sdcard/DEBIAN/root/etc/fstab
# sudo cp /etc/resolv.conf /sdcard/DEBIAN/root/etc/resolv.conf
# sudo mount -o bind /proc /sdcard/DEBIAN/root/proc
# sudo mount -o bind /dev /sdcard/DEBIAN/root/dev
# sudo mount -o bind /dev/pts /sdcard/DEBIAN/root/dev/pts
# sudo mount -o bind /dev/shm /sdcard/DEBIAN/root/dev/shm
# sudo mount -o bind /sys /sdcard/DEBIAN/root/sys
# sudo chroot /sdcard/DEBIAN/root /bin/bash

Export X display (in chroot)

# export DISPLAY=:0

Run xterm!

# xterm

Before unplug HDMI cable you should exit form chroot environment and unmount the chroot:

# exit
# sudo umount /sdcard/DEBIAN/root/proc
# sudo umount /sdcard/DEBIAN/root/dev
# sudo umount /sdcard/DEBIAN/root/dev/pts
# sudo umount /sdcard/DEBIAN/root/dev/shm
# sudo umount /sdcard/DEBIAN/root/sys
# sudo umount /sdcard/DEBIAN/root

[/code]

[size=+2]THANKS TO:[/size]

Sogarth - for http://xdaforums.com/showthread.php?t=983208

kennethpenn - for motoblur remove tool! many many thanks!

Chainfire - for Gingerbreak

makr8100 - for http://droid.makrit.net/ mirror

and many other users that works actively to hack this phone!

[size=+2]NOTE:[/size]

- exporting library you can start a lot of programs without starting chroot (obviously mounting the loop device), for example you can use xterm inside WebTop launching

# LD_LIBRARY_PATH=.:/sdcard/DEBIAN/root/usr/lib /sdcard/DEBIAN/root/usr/bin/xterm

- you can use sd-card replacing /sdcard/DEBIAN to /sdcard-ext/DEBIAN

If you would like to support my work click the this droid :)

[size=+2]MANY THANKS FOR CONTRIBUTOR:[/size]

Francisco Bravo

Robert Johnson