[GUIDE] Running ArchLinuxARM on Huawei Ascend P7 - Huawei Ascend P7

Prerequisites:
Rooted device
Busybox installed ( get it from Google Play )
Terminal emulator ( get it from Google Play )
An armv7h linux image ( see the download link below )
ArchLinuxARM images:
You can download any ArchLinuxARM image you want from this link sourceforge.net/projects/linuxonandroid/files/ArchLinux/
After downloading your image rename it to "arch.img".
Step 1:
Create the following directories on your EXTERNAL-SDcard ( works on internal too but you'll have to modify the paths in the arch.sh script ): archlinux/ and archlinux/mount/
Step 2:
Copy the arch.img file you downloaded from your computer to your EXTERNAL-SDcard and store it under archlinux/
Step 3:
Open a text editor on your computer and create a new file called arch.sh and paste the following text in it:
# path to the linux img
# change this in case it is different from your image's path
LINUX_IMG=/storage/sdcard1/archlinux/arch.img
# location where the linux image will be mounted (/storage/sdcard1/archlinux/mount/)
# change this if you want to mount it somewhere else
LINUX_DIR=/storage/sdcard1/archlinux/mount/
# create the directory where the linux image will be mounted in case it doesn't exist
mkdir -p $LINUX_DIR
# mount the image
busybox mount -o loop $LINUX_IMG $LINUX_DIR
# mount dev and proc directories
cd $LINUX_DIR
busybox mount -t proc proc proc/
busybox mount -o bind /dev/ dev/
# optionally mount sdcard and external sdcard (if you do not want to mount them simply comment the following 2 lines)
busybox mount -o bind /sdcard/ sdcard/
busybox mount -o bind /storage/sdcard1/ external_sd/
# copy resolv.conf from android environment to arch linux environment
cp /etc/resolv.conf etc/resolv.conf
# chroot into the arch linux environment
chroot $LINUX_DIR /bin/bash
Step 4:
Copy the arch.sh script from your computer to the root of your INTERNAL SDcard ( since we don't have execute permissions on the external SDcard we will store the script on the internal SDcard).
Step 5:
Unplug your AscendP7 from the computer and open the terminal emulator.
Once the terminal emulator opened type the following:
su
cd /storage/sdcard0/
./arch.sh
If you followed the above steps, after executing the above commands you should find yourself inside the ArchLinux environment.

problem with download file
MihaiChirculete said:
Prerequisites:
Rooted device
Busybox installed ( get it from Google Play )
Terminal emulator ( get it from Google Play )
An armv7h linux image ( see the download link below )
ArchLinuxARM images:
You can download any ArchLinuxARM image you want from this link nl.mirror.archlinuxarm.org/armv7h/alarm/
After downloading your image rename it to "arch.img".
Step 1:
Create the following directories on your EXTERNAL-SDcard ( works on internal too but you'll have to modify the paths in the arch.sh script ): archlinux/ and archlinux/mount/
Step 2:
Copy the arch.img file you downloaded from your computer to your EXTERNAL-SDcard and store it under archlinux/
Step 3:
Open a text editor on your computer and create a new file called arch.sh and paste the following text in it:
# path to the linux img
# change this in case it is different from your image's path
LINUX_IMG=/storage/sdcard1/archlinux/arch.img
# location where the linux image will be mounted (/storage/sdcard1/archlinux/mount/)
# change this if you want to mount it somewhere else
LINUX_DIR=/storage/sdcard1/archlinux/mount/
# create the directory where the linux image will be mounted in case it doesn't exist
mkdir -p $LINUX_DIR
# mount the image
busybox mount -o loop $LINUX_IMG $LINUX_DIR
# mount dev and proc directories
cd $LINUX_DIR
busybox mount -t proc proc proc/
busybox mount -o bind /dev/ dev/
# optionally mount sdcard and external sdcard (if you do not want to mount them simply comment the following 2 lines)
busybox mount -o bind /sdcard/ sdcard/
busybox mount -o bind /storage/sdcard1/ external_sd/
# copy resolv.conf from android environment to arch linux environment
cp /etc/resolv.conf etc/resolv.conf
# chroot into the arch linux environment
chroot $LINUX_DIR /bin/bash
Step 4:
Copy the arch.sh script from your computer to the root of your INTERNAL SDcard ( since we don't have execute permissions on the external SDcard we will store the script on the internal SDcard).
Step 5:
Unplug your AscendP7 from the computer and open the terminal emulator.
Once the terminal emulator opened type the following:
su
cd /storage/sdcard0/
./arch.sh
If you followed the above steps, after executing the above commands you should find yourself inside the ArchLinux environment.
Click to expand...
Click to collapse
which one must to download?

rahim1234 said:
which one must to download?
Click to expand...
Click to collapse
I changed the download link. Try this: sourceforge.net/projects/linuxonandroid/files/ArchLinux/

so, what is the advantage of this kernel?

Related

[MOD] Full Linux (Debian) inside WebTop! v0.2.7 [2012/01/18] [11.30 GMT+2:00]

[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:
Code:
# 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
Code:
# 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
Code:
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
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
[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
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
[/code]
[size=+2]THANKS TO:[/size]
Sogarth - for http://forum.xda-developers.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
Code:
# 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
[size=+2]CHANGELOG:[/size]
v0.2.7 [2012/01/18] [11.30 GMT+2:00]
easy-signed: http://www.multiupload.com/C5GEIHDEM0
uninstaller: http://www.multiupload.com/18H5OHND90
EASY:
- Disabled Tomoyo (no more firefox issues between different webtop versions)
- New uninstaller
v0.2.6 [2011/07/07] [14.15 GMT+2:00]
Debian disk: http://droid.makrit.net/WebTopMOD/WebTopMOD-20110707.7z
easy-signed: http://droid.makrit.net/software/atrix/easy_v0.2.6.zip-signed.zip
EASY:
- binded in chroot tmp folders
- correct typo in missing disk message
- changed umount function (should works fine now!)
- added linuxdisk check (0 size, is a file)
- 2.3.4 compatibility
- cleaned mount function
LINUXDISK:
- added pdmenu and menu
- added device etc mountpoint in /mnt/DEVICE/etc
- dynamic change of resolv.conf (thanks to krkeegan)
- linuxdisk now is ~4gb (4095MB)
- added device etc mountpoint in /mnt/DEVICE/usr
- added plugins folder symlink to use flash player or other plugins between browser (inside and outside chroot) (FLASH DOESN'T WORK YET)
v0.2.5.1b [2011/07/07] [10.15 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/ZAPZW2XX45
EASY:
- removed firmware check
- using a newer version of update-binary
v0.2.5 [2011/05/27] [9.30 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/F68D73KF26
EASY:
- fixed unmount function
- removed motorola links
- fixed leafpad icon
v0.2.4 [2011/05/26] [20.30 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/VI4JEFWLI6
EASY:
- corrected calls to loopdevice function (thanks Cryofix)
- check awm folders existence and fully reset permissions
- set different permissions to linux script, xmessage, lxterminal and WebTopMOD folder
v0.2.3 [2011/05/26] [15.45 GMT+2:00]
Debian disk: unmodified
easy-signed: http://www.multiupload.com/2JAO6F42Z4
EASY:
- corrected typo (remember..) in installation
- make new loop device (avoid conflict)
- renfoced unmount function
- fix permission for linux.desktop (awm launcher)
v0.2.2 [2011/05/25] [22.00 GMT+2:00]
Debian disk: http://www.multiupload.com/DVF6BJGJR3
easy-signed: http://www.multiupload.com/NKSFL81ODW
EASY:
- removed /mnt/androidroot (doesn't work)
- added /mnt/sdcard and /mnt/sdcard-ext
- code clean
- corrected lxterm policy
- replaced backup script
- corrected sudoers replace
- replaced debian with a more generic linux notation
- added check disk existence
- disk can be in sdcard or sdcard-ext
CUSTOM:
- Temporary deprecated (I've no time to update it today)
v0.2.1 [2011/05/25] [10.30]
DebianEnabler: http://www.multiupload.com/F8TMHY8VQA
Images: 2gb: http://www.multiupload.com/A1B6LG9YYF
easy-signed.zip: http://www.multiupload.com/HPA820KCKR
EASY:
- replaced xterm with native lxterminal
- introduced backup original files
- added uninstaller for version >= 0.2 http://www.multiupload.com/GLKUZA2KP9
- added uninstaller for version <= 0.2.1 http://www.multiupload.com/TO6W9X7CBU
v0.2 [2011/05/24] [17.30]
EASY:
DebianEnabler: http://www.multiupload.com/F8TMHY8VQA
Images: 2gb: http://www.multiupload.com/A1B6LG9YYF
easy-signed.zip: http://www.multiupload.com/NHJGJD7E3E
- easy method!
- symbolic link in /mnt/androidroot to real root
- added image already configured with dbus, locales and dialog
- added launcher for debian chroot and xterm in awm
CUSTOM:
- added instruction to make custom launcher in awm
- added instruction to configure locales, dbus and dialog
- corrected chroot adding /var/run/dbus
v0.1 [2011/05/24]
- initial release
Pro. This looks like the real deal (no compromises). I will be waiting for the noob version though
Sent from my MB860 using XDA Premium App
What versions does this work with? 1.8.3, 1.5.7, 1.2.6 ?
XxKILLx3RxX said:
What versions does this work with? 1.8.3, 1.5.7, 1.2.6 ?
Click to expand...
Click to collapse
I used an ATT Atrix with 1.8.3 firmware.
However this guide should be applicable to any atrix (att, bell, ecc) with any firmware...
Can i use ubuntu as the debian system on the pc to do the image, secondly how do i make a 4 or even 6 gb image, thirdly is this similar to the chroot modes?
crnkoj said:
Can i use ubuntu as the debian system on the pc to do the image, secondly how do i make a 4 or even 6 gb image, thirdly is this similar to the chroot modes?
Click to expand...
Click to collapse
6gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*6-1)) if=/dev/zero of=debian
5gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*5-1)) if=/dev/zero of=debian
4gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*4-1)) if=/dev/zero of=debian
3gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*3-1)) if=/dev/zero of=debian
1gb:
Code:
dd bs=1024 count=1 seek=$((1024*1024*1-1)) if=/dev/zero of=debian
debootstrap from ubuntu
Code:
sudo apt-get install debootstrap
sudo debootstrap --foreign --arch armel squeeze temp http://ftp.debian.org/debian
Thanks man, ill go and try it out within the next few hours. Btw i already have lxterminal working in the webtop, can i use that instead of adb/ terminal emulator to enter those commands?
crnkoj said:
Thanks man, ill go and try it out within the next few hours. Btw i already have lxterminal working in the webtop, can i use that instead of adb/ terminal emulator to enter those commands?
Click to expand...
Click to collapse
Sure! I assumed that on 1.8.3 terminal is not available...
SystemR89 said:
Sure! I assumed that on 1.8.3 terminal is not available...
Click to expand...
Click to collapse
ye thats true, i copied it over from an old /osh dump and it seems to work fine, if you want/need it i can send it to you (only the lxterminal or the whole /osh dump) just started the procedures to get it on.
SystemR89 said:
6gb:
Code:
dd if=/dev/zero of=/data/6GB.swap bs=1024 count=6144000
4gb:
Code:
dd if=/dev/zero of=/data/6GB.swap bs=1024 count=4096000
debootstrap from ubuntu
Code:
sudo apt-get install debootstrap
sudo debootstrap --foreign --arch armel squeeze temp http://ftp.debian.org/debian
Click to expand...
Click to collapse
those commands returned the error:
dd: opening '/data/6GB/swap': No such file or directory
hmm in your first post the one for dding a 2gb file is different as these two.
AWESOME!!
You beat me to it!! I just ordered a Atrix and it's enroute to me over here in Japan... I was thinking I would try to build Gentoo on the webtop somehow.
I have experience there doing the whole bootstrapping thing, but then it hit me-- "How will I compile the programs?" since everything gets made from source and not from RPMs or DEBs in that distro.
Now I am totally chomping at the bit for my Atrix to get here; I am going to experiment using it as my ONLY computer at work, and out and about. I tend to use cloud-based apps even when creating content (I'm a teacher/photographer/web developer) and I feel uneasy about taking my loaded-to-the-gills Macbook on crowded Tokyo trains with me everyday.
Now with your find, I can still manage to do some light graphics work at times in GIMP too maybe?
crnkoj said:
those commands returned the error:
dd: opening '/data/6GB/swap': No such file or directory
hmm in your first post the one for dding a 2gb file is different as these two.
Click to expand...
Click to collapse
ops.. you are right.. corrected!
starrwulfe said:
Now with your find, I can still manage to do some light graphics work at times in GIMP too maybe?
Click to expand...
Click to collapse
I've not tried gimp, but it should works, we have 1gB of ram!
I was thinking how great gentoo would be too. kholk said once he manages to get kexec and a custom kernel to work he will start work for on gentoo to replace the webtop, that ought to be awesome than
Cannot wait to give this a shot! I just need to order a blue tooth mouse and keyboard.
SystemR89 said:
ops.. you are right.. corrected!
Click to expand...
Click to collapse
ya thought so to just change to debian, btw why do you say if in ubuntu you use the squeeze tag and if just debian you use the stable tag when doing the debootstrap?
crnkoj said:
ya thought so to just change to debian, btw why do you say if in ubuntu you use the squeeze tag and if just debian you use the stable tag when doing the debootstrap?
Click to expand...
Click to collapse
I'm not sure that stable tag works with ubuntu..
Wow amazing I will try when I can, will be funny or nice if we can connect the display to a chinese tablet xD so we can get a portable display xD
.......................................................
Sent from my loved atrix ;D
update.zip, multiple size disk and terminal-less installation and usage will be ready in the next hours!
Stay tuned!

Ubuntu on Ideos X6

There are threads on this site and elsewhere showing the steps to boot ubuntu on android phones. Our Ideos X6 comes with a powerful hardware so i believe we can run ubuntu on it. But it seems that the kernel must support loop devices. Can anyone make a custom kernel supporting loop devices.
Or has anyone successful in running Ubuntu on Ideos X6.
Our kernel have support for loop device. Take this little instruction how install ubuntu oneiric, also the same process for debian just write distribution name and correct url in debootstrap.
1. this stage you must complete on your linux pc.
Code:
#debootstrap part on PC
sudo apt-get install debootstrap
sudo dd if=/dev/zero of=ubuntu.img seek=838860800 bs=1 count=1
sudo mke2fs -F ubuntu.img
sudo mkdir ubuntu
sudo mount -o loop ubuntu.img ubuntu/
sudo debootstrap --arch armel --foreign oneiric ubuntu http:/ports.ubuntu.com/ubuntu-ports/
sudo umount ubuntu
sudo rm -r ubuntu
2. push this ubuntu.img to sdcard on your phone.
Code:
adb push ubuntu.img /sdcard/ubuntu.img
3. create this script as ubuntu.sh on your sdcard too
Code:
echo "Setting some stuff up.."
export bin=/system/bin
export img=/mnt/sdcard/ubuntu.img
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
mkdir $mnt
echo "Mounting the Linux Image"
busybox losetup /dev/block/loop7 $img
mount -t ext2 -o noatime,nodiratime /dev/block/loop7 $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
echo "Setting Up Networking"
busybox sysctl -w net.ipv4.ip_forward=1
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "Mounting sdcard in /mnt"
mkdir $mnt/mnt/sdcard
busybox mount --bind /mnt/sdcard/ $mnt/mnt/sdcard
echo "Entering CHROOT "
echo " "
busybox chroot $mnt /bin/bash
echo " "
echo "Shutting down CHROOT"
umount $mnt/mnt/emmc
umount $mnt/mnt/sdcard
busybox sysctl -w net.ipv4.ip_forward=0
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
busybox losetup -d /dev/block/loop7
4. So now we connect to device, run superuser permission, and chroot to ubuntu
Code:
sudo adb shell
su
sh /sdcard/ubuntu.sh
5.run continue deboostrap
Code:
/debootstrap/debootsrap --second-stage
6. setup apt
Code:
echo 'deb http:/ports.ubuntu.com/ubuntu-ports/ oneiric main' >/etc/apt/sources.list
apt-get clean
apt-get update
7. add root password
Code:
passwd root
8. exit from ubuntu shell with 'exit' and run it again sh /sdcard/ubuntu.sh from terminal emulator on your device or via adb shell.
So, now ubuntu install successfully on your phone and you may install openssh and vnc server.
P.S. http:/ correct it with two //, I can't push correct link to forum. its denied post urls.
Error
I followed your steps exactly as given and changed / to // in http i am getting the following output when i ran ubuntu.sh. kindly help
# sh ubuntu.sh
Setting some stuff up..
mkdir failed for /data/local/ubuntu, File exists
Mounting the Linux Image
losetup: /dev/block/loop7
mount: Device or resource busy
mount: No such file or directory
mount: No such file or directory
mount: No such file or directory
Setting Up Networking
net.ipv4.ip_forward = 1
ubuntu.sh: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
ubuntu.sh: cannot create /data/local/ubuntu/etc/resolv.conf: directory nonexistent
ubuntu.sh: cannot create /data/local/ubuntu/etc/hosts: directory nonexistent
Mounting sdcard in /mnt
mkdir failed for /data/local/ubuntu/mnt/sdcard, No such file or directory
mount: mounting /mnt/sdcard/ on /data/local/ubuntu/mnt/sdcard failed: No such file or directory
Entering CHROOT
chroot: can't execute '/bin/bash': No such file or directory
Shutting down CHROOT
failed.
failed.
net.ipv4.ip_forward = 0
failed.
failed.
failed.
failed.
losetup: /dev/block/loop7: Device or resource busy
Possbile what loop7 device already busy on your phone.
ry this command to see it
Code:
busybox losetup
And try manual steps which in script to see which step is failed.
When I type
Code:
#busybox losetup
nothing happens
when i type
Code:
#busybox losetup /dev/block/loop7 /mnt/sdcard/ubuntu.img
losetup: /dev/block/loop7
Code:
#mount -t ext2 -o noatime,nodiratime /dev/block/loop7 /data/local/ubuntu
mount: Device or resource busy
the second line is the outputfrom the command.
Do you phone have block devices in /dev/block/ ?
just checked using root explorer. there are many loop# files in /dev/block folder
You may try with UC kernel, or try with ext3 file system. I suppose what your kernel without support ext2.
i tried with UC v5. It supports ext2,ext3 and ext4. Still getting same error.
Should i convert my android filesystem to ext2,3,0r 4. If yes how to do it?
No, you don't need do converting. Problem with loop device or mount, try to see busybox losetup after mount image to block device, it's must show what image mounted to block device. If it's ok, try different option for mount.
I don't have anymore ideas why it doesn't work.
This scenario successful work on my phone.
Can you tell me what ROM you are using
Sent from my CSL-MI410 using XDA App
Last rom from wellcom (2.3-V318E)
now it works. Installed ubuntu. But i am now unable to install any package. when i try to install tightvncserver i get error message
E: Unable to locate package tightvncserver
actally i am not able to install any package
i have checked the /etc/apt/sourcels.list and it contains the required entry and i also did
apt-get clean
apt-get update
and it updates without any error
You need add another repositories to /etc/sources.list such as universe, multiverse, restricted with the same path.

Linux installer

Trying to get Ubuntu chroot up and running with Linux installer from the market.
Followed the quick start guide to a "t", only changes I made from the default settings were distribution and version. This resulted in a /data/local/mnt/Linux directory with the Ubuntu file structure inside and a Linux.loop file in the root of my internal storage.
The part that is confusing of how to mount. The last step in the guide is to press the button that creates the linuxchroot script; when I press the button out says it's creating the file but the file isn't created.
I'm attempting to use the following commands to mount manually:
Code: ---------# mount loop.img directory ---------If for some reason that doesn't work use losetup.
Code: ---------# losetup /dev/block/loop7 loop.img # mount -t auto /dev/block/loop7 directory
But not sure how to use them because there isn't a .img file, just the previously mentioned /data/local/mnt/Linux directory and the Linux.loop file.
Anyone? Thanks in advance
Sent from my DROID3 using Tapatalk 2
Q9Nap said:
Trying to get Ubuntu chroot up and running with Linux installer from the market.
Followed the quick start guide to a "t", only changes I made from the default settings were distribution and version. This resulted in a /data/local/mnt/Linux directory with the Ubuntu file structure inside and a Linux.loop file in the root of my internal storage.
The part that is confusing of how to mount. The last step in the guide is to press the button that creates the linuxchroot script; when I press the button out says it's creating the file but the file isn't created.
I'm attempting to use the following commands to mount manually:
Code: ---------# mount loop.img directory ---------If for some reason that doesn't work use losetup.
Code: ---------# losetup /dev/block/loop7 loop.img # mount -t auto /dev/block/loop7 directory
But not sure how to use them because there isn't a .img file, just the previously mentioned /data/local/mnt/Linux directory and the Linux.loop file.
Anyone? Thanks in advance
Sent from my DROID3 using Tapatalk 2
Click to expand...
Click to collapse
If you see the directory structure in /data/local/mnt/Linux then it's already mounted.
Code:
chroot /data/local/mnt/Linux /bin/bash
Should work, but I have no idea why the script isn't being created.
To manually mount.
Code:
mount /sdcard/Linux.loop /data/local/mnt/Linux
and un-mount after exiting the chroot environment by a ctrl-d or typing "exit".
Code:
umount /data/local/mnt/Linux
if un-mounting causes a device is busy error, un-mount the lazy way
Code:
umount -l /data/local/mnt/Linux
Doing any of this manually might cause some errors because the script isn't doing whatever it is that it does.
Ok so I finally got Ubuntu up and running with vnc server and all, & realized there's no way to input text.
Anyone know if there's any possible way to be able to use the d3 keyboard while in chroot (other than in terminal of course) ?
*edit*
Seems to be working now...

Linking from /mnt/sdcard to /mnt/sdcard-ext - automatization

Found the solution, it's in the fifth post
Hey, first of all I'm Linux and Android newbie, so sorry if my question reveals it a bit
As my Internal Storage a.k.a. /mnt/sdcard is getting full and I hate to be reminded of it by notification I can't get rid of, I decided to put some effort into moving the largest files to the SD card. I have a 64GB SD an there still are several free gigs So after some googling I found out a way to link it. It works like this:
Code:
mount -o bind /origdir /newdir
where both /origdir and /newdir must exist, in my case as an example:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
where /mnt/sdcard-ext/sd/DictionariesNGHS is the data containing folder and /mnt/sdcard/sd/DictionariesNGHS is an empty folder for linking. It works like a charm, tried with several applications including some off-line navigations. The downside is that such links are forgotten after a reboot.
I didn't find out how to automatize that. I tried putting the line from second code to the end of /system/etc/init.goldfish.sh (I run Eclipse ICS 1.2) and it didn't get linked after a reboot (but works OK after mounting manually in terminal) - I suspect it runs before sdcard-ext is mounted. Any thoughts on how to make it run after reboot? Or maybe of an app that does this for me?
EDIT:
Put my links into /data/data/init.sh
Tried several not working apps:
ScriptMe by gilsken says Script run mount: No such file or directory
Script Manager - SManager by devworm says
Code:
exec sh '/data/data/init.sh'
[email protected]_maserati:/ # exec sh '/data/data/init.sh'
mount: No such file or directory
while interestingly when I write it by myself in its built-in console it works...
App that works: Tasker by Crafty Apps
I can have scripts run on boot and it works, but I can add only one line at time (or at least it's the only option I found) which is still kinda inconvenient plus it runs all the time consuming system resources. I'd like some less robust solution, preferably executed after boot and exiting after mounts proceed. Any ideas?
EDIT 2:
My "workaround" in Tasker: Profiles -> New -> Event -> System -> Device Boot -> OK -> New Task -> OK -> + -> Script -> Run Shell -> Command: /data/data/init.sh -> OK
Surprisingly enough it doesn't even need root permission...
In init.sh I have several lines with different mounts, it all works well. I'm still looking for less robust solution than Tasker is, or maybe a way to kill it after the init.sh is processed?
hey
can you please post the content of youre
Code:
/data/data/init.sh
---------- Post added at 04:35 PM ---------- Previous post was at 03:50 PM ----------
youre problem is, at the runtime form the mount command, the mount is not in youre path.
can you add to you script the command
Code:
env
and post the output?
I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
OK, after running it by SManager it looks like giving errors, but the folder gets mounted.
Also it seems apps get access to /mnt/sdcard faster after reboot then to /data/data (I wonder why...?) so I moved the script there.
Here you have the output with env at the end of init.sh, run by SManager as root (mounted OK):
Code:
exec sh '/mnt/sdcard/init.sh'
[email protected]_maserati:/ # exec sh '/mnt/sdcard/init.sh'
mount: No such file or directory
_=/system/xbin/env
ANDROID_BOOTLOGO=1
ANDROID_PROPERTY_WORKSPACE=8,69632
LOOP_MOUNTPOINT=/mnt/obb
SM_API=15
RANDOM=26725
ANDROID_ASSETS=/system/app
USER=root
EXTERNAL_STORAGE=/mnt/sdcard
ANDROID_DATA=/data
PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
SM_LAUNCHER=MANUAL
TERM=vt100
PS1=$(precmd)[email protected]$HOSTNAME:${PWD:-?} #
SM_VERSION=2.5.3.1
SM_GUIFD=3
LD_LIBRARY_PATH=/vendor/lib:/system/lib
SECONDARY_STORAGE=/mnt/sdcard-ext
SM_ALIAS=init.sh
ASEC_MOUNTPOINT=/mnt/asec
SM_HOME=/mnt/sdcard
HOSTNAME=cdma_maserati
HOME=/
SM_VERSIONCODE=77
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework-ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/filterfw.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar:/system/framework/com.motorola.frameworks.core.addon.jar:/system/framework/kafdex.jar:/system/framework/com.motorola.orange.simauth.jar
ANDROID_ROOT=/system
SHELL=/system/bin/sh
MKSH=/system/bin/sh
ANDROID_SOCKET_zygote=9
So it works after all with the SManager as I intended, I just don't understand why it gives that error when everything actually is OK...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...
LuH said:
I tried it with a file containing only this line:
Code:
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
...
Any ideas on how to make it run automatically after every mount of sdcard-ext instead of on reboot? Because when I connect it to the computer as Mass Storage, the directory mounts disappear and I have to run the script manually...
Click to expand...
Click to collapse
for the first, replace the mount with this:
Code:
/system/bin/mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
Found out that the "mount: No such file or directory" error was due to typo in folder path
So to wrap it up:
You need to be rooted first.
Create your init.sh script file, works fine when put to /mnt/sdcard/
Example file (also attached so you have a sample in UNIX formatting - don't open with Notepad under Windows, better edit it in your phone):
Code:
# mount -o bind /sourcedir /fakedir - both sourcedir and fakedir MUST exist!
mount -o bind /mnt/sdcard-ext/sd/DictionariesNGHS /mnt/sdcard/DictionariesNGHS
mount -o bind /mnt/sdcard-ext/sd/Android/obb /mnt/sdcard/Android/obb
Note: you should use a UNIX formatting of the file, not Windows (I'm not sure if it's necessary though).
As hinted in the beginning note, sourcedir and fakedir must exist and after successful mount the fakedir folder will appear to have the contents of the sourcedir folder. Any fakedir's contents are ignored ("disappear") after mount and reappear only after it gets unmounted.
It gets automatically unmounted after unmounting of either fakedir's or sourcedir's media (typically when connecting phone to a computer as mass storage) and I haven't found any workaround for running the script after remounting of media... Any suggestions?
Install SManager (free version here).
In SManager navigate to your script file, tap it and select Script/Executable and tap Su and Boot icons (see attached screenshot).
Done, your folders get mounted on reboot

swap on jb

OK I got swap to work on my bionic, first make a swap file:
dd if=/dev/zero of=/data/cache bs=1024 count=568924
Or how ever many bytes you want it 568924 is over 500mb then with busybox use mkswap
busybox mkswap /cache/swap
Now copy the uuid that busy box has generated from mkswap and paste that uuid in /etc/fstab like below with none swap defaults 0 0
UUID-dhd53bg-75fhvf-this-is-the-uuid none swap defaults 0 0
Now try swapon /cache/swap.
If that fails you will need to download a custom ubuntu.IMG from here: http://www.4shared.com/zip/NKq5ucvZ/ubuntu.html
And a mounting script from zip below copy contents of zip to system/xbin/linux and system/xbin/linux.sh
chmod 755 /system/xbin/linux
chmod 755 /system/xbin/linux.sh
Then if you have the Ubuntu.IMG on sdcard-ext run in your terminal
linux
you should then be at [email protected] host of your Linux chroot try the procedure from above inside your [email protected] host and copy the uuid into the chrooted /etc/fstab and in your system/etc/fstab then try swapon /cache/swap. fstab should be 0644 permissions
If you get the Ubuntu.IMG and the scripts from below you now have a full Ubuntu desktop you can vnc into just type in the terminal :
[email protected]#./root/init.sh
the root/init.sh will start vncserver and gdm gnome will have flash 10.1 and Firefox Ubuntu app center all of which work great
Vncserver is
localhost
User is
localhost
Domain is localdomain
password is ubuntu
vnc port is
5901
http://www.4shared.com/zip/SGolTsWZ/linuxmount.html
Here isthe link http://sourceforge.net/projects/droidbionic.motorola/files/droidbionic/9.8.2O-72_VZW-22/ to the bionic jellybean kernel source if someone wants to build it from source and add swap/zram support or overclocking to add swap edit the config.gz CONFIG_SWAP=y
CONFIG_SWAP_PREFETCH=y
You don't need to add prefetch just supposed to help speed like readahead on sdcard.
If you get and use the ubuntu.img the scripts provided mount rw and kexec your kernel so if you know what your doing you could modify the kernel from inside your chrooted ubuntu or create and use modules for that kernel. You would have to build from source and have the jellybean kernel compiled but it is possible to do all of that from inside your chroot you would also probably need a 64GB sdcard and formatted to ext3 and modify the mount script to mount the ext3 not the .IMG if you want help with this I will provide the mounting script to change from .IMG to ext3 partition just message me

Categories

Resources