Artigos‎ > ‎Android‎ > ‎Motorola Atrix WebTop‎ > ‎

Princípios do webtop2sd do Atrix


Primeiramente gostaria de salientar que não sou o autor principal do conteúdo deste artigo. A minha intenção é de mostrar o que outros autores tem realizado (referenciando links para o conteúdo original) neste blog até como um guia pessoal para uso próprio e ainda compartilhar minhas anotações e pequenas modificações que realizo no conteúdo, desejando que possa ajudar mais alguém em algum lugar.
First and foremost, I take no credit for any of this post’s content. I am really just taking what others have done (which I have links to bellow) and am putting it on my blog for a personal reference and hopefully the small changes that I made to their guides will help someone somewhere.

Referência para verificar com calma depois, caso o autor apague seu blog.


Script que cria o webtop2sd

#!/system/bin/sh

# Run mountosh.orig.
/system/bin/mountosh.orig "$@"

# Create the block device for the SD card.
/system/bin/busybox mknod -m 600 /dev/block/mmcblk1 b 179 32

# Determine which partition on the SD card, if any, is using ext2/3. We take
# the first one we find.
partname=`/sbin/fdisk -l /dev/block/mmcblk1 | /system/bin/grep Linux | /system/bin/awk '{print $1}' | /system/bin/head -1`

# If we can't find a valid partition, just exit.
if [ -z "$partname" ]; then
  exit 0
fi

# If we have a partition, find out what the specifics for it are.
partshortname=`echo $partname | /system/bin/busybox cut -d/ -f4`
partinfo=`/system/bin/cat /proc/partitions | /system/bin/grep $partshortname`
partmaj=`echo $partinfo | /system/bin/awk '{print $1}'`
partmin=`echo $partinfo | /system/bin/awk '{print $2}'`

# Then, create the block device for the partition.
/system/bin/busybox mknod -m 600 $partname b $partmaj $partmin

# Load the partition into a test location so that we can verify it. Try ext3
# before trying ext2 (since ext3 can be mounted as ext2, but not the other way
# around).
testfolder=/tmp/partcheck
/system/bin/mkdir $testfolder
if /system/bin/mount -t ext3 $partname $testfolder; then
  parttype=ext3
else
  if /system/bin/mount -t ext2 $partname $testfolder; then
    parttype=ext2
  else
    echo Unable to identify the partition type for $partname.
    exit 1
  fi
fi

# Make sure that the partition looks sane (in case the SD card is partitioned
# this way for a different reason). For now, use the questionably useful shell
# scripts in the root directory as the identification mechanism.
parttest=`/system/bin/ls $testfolder/apath.sh $testfolder/ubuntu.sh $testfolder/upath.sh | /system/bin/busybox wc -w`
/system/bin/umount $testfolder
/system/bin/rmdir $testfolder
if [ "$parttest" -ne "3" ]; then
  echo Unable to identify the partition.
  exit 1
fi

# If we get this far, mount the partition over the existing /osh mount.
/system/bin/mount -t $parttype $partname /osh


Link http://forum.xda-developers.com/showthread.php?t=1093790

Full Debian inside WebTop

Prerequisite for this method is:
On your computer: have a Debian installation or a Debian live cd or download this file (http://www.multiupload.com/403F0OQEDA -> 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.

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

[On your computer]
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 http://ftp.debian.org/debian)
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)

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

edit sudoers

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

Code:

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

Now we enter in a more complete and privileged bash

Code:

# /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

Code:

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:

Code:

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

Debootstrap! (second stage)

Code:

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

Disable X ACL (in WebTop)

Code:

# export DISPLAY=:0
# xhost +

Enter in the new system

Code:

# 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)

Code:

# export DISPLAY=:0

Add Debian main repository

Code:

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

Finish debian installation

Code:

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

Configure your locale

Code:

# dpkg-reconfigure locales

Install xterm

Code:

# apt-get install xterm

Run xterm!

Code:

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

Code:

# 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

USE: (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

Code:

# su

Now we enter in a more complete and privileged bash

Code:

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

Mount debian disk:

Code:

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

Disable X ACL (in WebTop)

Code:

# export DISPLAY=:0
# xhost +

Enter in the new system

Code:

# 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)

Code:

# export DISPLAY=:0

Run xterm!

Code:

# xterm

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

Code:

# 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



Neste link vemos algumas ideias de como surgiu o Webtop2sd


If you want to uninstall:
Using adb with root access:
  • adb shell
  • su
  • cd /system/bin
  • mv mountosh mountosh.new
  • mv mountosh.orig mountosh
  • cd /data
  • rm ubuntu.disk
  • cd /home/adas/.gconf/apps/avant-window-manager
  • rm -r window_navigator
  • reboot







O URL específico do gadget não foi encontrado



Comments