Skrulladams figured out a way to get Linux onto the Droid X, Droid 2 / Global, Droid Pro, and DEFY (Really any modern motoblur phone with a locked bootloader.) Supposedly the Atrix has it as well? Technically, according to wikipedia, motoblurexists on the CLIQ/DEXT, Backflip, Devour, Flipout, Charm, and Flipside as well. I can't tell you whether or not this method works for those phones, maybe somebody could verify. While I was researching methods to get this all to work I found different methods for the original Droid, I am assuming that the version of blur on any phone from the OG droid/milestone is different, because the installation method seems somewhat less locked-down.
First you will need a Linux image. I suggest getting yours from Ruan over at androidclone.com
Ubuntu Laika-Beta1.2a.rar
The commands have to be issued from Linux or a virtual machine of Linux as far as I know. I downloaded VirtualBox and used a copy of Ubuntu 10.10 that I had laying around. You could use the image you downloaded above with VirtualBox. PuTTYcyg seems like a better alternative, but I haven't used it.
When setting up your linux virtual machine you might want to make your username "noob" like I did, it will allow you to copy and paste my commands.
The first thing you will need is the android sdk.
Click here to get it
Using and installing it is a little confusing. I just extracted it to my desktop.
You will have to run /tools/android, I did this by dragging and dropping the icon into a terminal window and hitting enter. You have to install the platform-tools. ADB will be downloaded to the platform-tools folder inside the SDK folder.
VirtualBox allows you to capture a USB device inside your virtual machine inside the menu. Devices -> Motorola ####
Inside your virtual machine you will need to copy ubuntu.img from the Laika-Beta1.2a.rar you donloaded earlier to your home directory. While still in the home directory create a new folder simply called "ubuntu."
Your phone has to be rooted and you need a terminal emulator. Most custom ROMs have this by default, but there are many options.
Next, open up a terminal emulator on your phone and execute some commands:
Code:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
mkdir /data/local/mnt
Back on your virtual machine in a terminal:
Code:
sudo losetup /dev/loop0 /home/noob/ubuntu.img
sudo mount -t ext2 /dev/loop0 /home/noob/ubuntu
Dirty_Jerz has an alternate method, Click here for his thread. so it is now up to you whether you'd have everything on your internal storage or SD card. My method uses the internal storage, his uses the SD card. If you'd rather use his, stop here.
Here you will want to remove a symbolic link in /home/noob/ubuntu/usr/bin that screws this method. You can do this by:
Code:
sudo rm /home/noob/ubuntu/usr/bin/X11
Then I remove security stuff:
Code:
sudo chmod 777 /home/noob/ubuntu
sudo '/home/noob/Desktop/android-sdk-linux_x86/platform-tools/adb' shell
chmod 777 /data/local/mnt
exit
sudo '/home/noob/Desktop/android-sdk-linux_x86/platform-tools/adb' push /home/noob/ubuntu /data/local/mnt
This is going to take about 2 and a half hours so I suggest you find something else to do while it copies over.
When it's all done you will need to copy a script over in order to chroot (boot from inside android) into Ubuntu.
Download this script! (specific for this install method!)
Username: androidclone.com
Password: androidclone.com
Click to expand...
Click to collapse
This script belongs in /system/bin so you will have to put it there. The easiest way to do that would be to copy it to your sdcard and then use your terminal emulator to move it.
Code:
su
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /sdcard
cp bootubuntu /system/bin
cd /system/bin
chmod 777 bootubuntu
Now you can boot into Ubuntu from any directory as long as your terminal emulator has superuser.
Code:
su
bootubuntu
Once inside there are some commands that need to be run in order to get a functional UI.
I got these from this site He seems to have a lot of extra configuration instructions which may or may not help you.
Code:
mount -t devpts devpts /dev/pts
mount -t proc proc /proc
mount -t sysfs sysfs /sys
-Xvnc commands-
Code:
export DISPLAY=localhost:0.0
Xvnc -localhost -geometry 854x480 -depth 24 -deferupdate 0
-start your gui-
Code:
startlxde
I prefer xfce though, personally.
--------problems----------
"/bin/sh can't access tty: job control turned off" upon chrooting
Terminal emulators from within the UI don't work.
*DRIVERS*
Touch screen support/UI enhancements for touch screen.
androidVNC
Might not be an ideal solution. I still noticed what seemed to be some graphical lag. There could be a setting that can get it running better, but an app optimized for high speed localhost operation
Chrooting a prebuild image causes all kinds of problems because the proper post-installation scripts are not run. Some programs ignore these errors, and for others they error out. I have yet to find a good solution for this but I have found hints:
Check out this page
Seems a little outdated, but maybe somebody will find a way to make a method like this work.
What we really seem to need is a custom kernel/ROM/distro team that can work on these issues.
-----other alternatives?-------
First I tried kubuntu mobile. It was very buggy so I gave up on it.
Ubuntu netbook edition has been slammed by some for being bloated, but it's ARM port should be lightweight. From screenshots it looks like it has a great UI. The problem is getting gnome to start, it encounters some error and doesn't load.
fedora has a mobile edition that looked good, I think they are somehow involved with Meego which now seems doomed. I'm not sure how similar to android it is or if it is worth the effort.
Check this out
Many of you may already know about the QEMU for android app, but we should be able to cross-compile it to use within our chroot.
I looked into wine, it should be a dead-end since we aren't on x86 architecture and it doesn't do any emulation.
VMware will be releasing a version for android.
Also while playing around I thought about porting iOS on to an android phone. It should be possible.
Pics!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
This could potentialy be used to get truly custom ROMs on the D2/DX/Motoblur ridden phones. Honeycomb here I come!
Sir, if you could use this to port newer versions of android and other operating systems such as meego and maybe even webos, you are truly the savior of our locked phones :O
Sent from my BLAZING FAST Droid 2 Global using the XDA app
From my understanding (not a coder or even a regular linux user), a chroot environment is just running an OS within your OS. Meego (maybe I'm thinking of Maemo?) should definitely be possible, I think there is an ARM build somewhere. Fedora was involved with them in some way, and I think might have an ARM build of one of their older releases.
Truly custom ROMs? Not sure, maybe Linux on the phone will be of help to devs?
I was hoping maybe Droid 2 bootstrapper could be modified to fastboot into the install. That still wouldn't be a true bootloader unlock and we still have drivers to worry about and might not even be possible, just an idea.
Well, we might be able to hijack to boot to maybe run CyanogenMod(at last!) . I can for sure, that would rule. I used CM on my old phone(the ultra moddable Droid Eris(HTC FTW!)), and it was the greatest rom I've ever seen
Sent from my DROID2 using XDA Premium App
It is possible to port it to Milestone 2?
Sent from my T-Mobile G1 using Tapatalk
This is a sweet little tutorial that I've been following and I'm excited to get Ubuntu up and running... if I do get it up and running. Problematic mentions a problem where '/bin/sh can't access tty; job control turned off' and I also hit this. I'm pretty new too linux, I've only really got into it upon the purchase and rooting of my Droid 2 and I haven't been able to find anything that can help me fix this problem. Has anyone else gotten past this and had ubuntu running on the Droid 2? Or could someone point me in the right direction? Any help is appreciated.
Can u mirror Ubuntu Laika-Beta1.2a ?. I can't download at filefactory now. Or can I use another ubuntu image ?
Can someone answer? Is it possible to run it on Milestone 2?
It is possible to port it to Milestone 2?
Click to expand...
Click to collapse
Should be. There shouldn't be enough differences between the two for this to not work. I have a hard time thinking of a scenario where this wouldn't work for an andrioid phone. I think the main requirement is having a fairly recent version of busybox installed.
Can u mirror Ubuntu Laika-Beta1.2a ?. I can't download at filefactory now. Or can I use another ubuntu image ?
Click to expand...
Click to collapse
You can use any armel image of Linux. Currently I think this mainly applies to Ubuntu, there should be ARM builds for other distros out there, but these are tough to find. A skilled enough developer should be able to port any distro they wish.
Problematic mentions a problem where '/bin/sh can't access tty; job control turned off' and I also hit this.
Click to expand...
Click to collapse
This seems to be a bug from chrooting a preinstall image without any kind of real setup. I found you can do a lot of this manually, (If you're interested try googling the MAKEDEV command, I think that generated ttys for me.) but I'm still searching for a real solution. Currently I'm considering trying the debootstrap method, the "ubuntu-netbook-10.10-preinstalled-netbook-armel+omap.img" image could be the ticket as well.
thanks, i'll try with Ubuntu-Netbook 10.10
Please Help
hello i am trying this and am getting hung up on the
"sudo mount -t ext2 /dev/loop0 /home/noob/ubuntu" am getting this
wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
looking at dmesg i see this
EXT2-fs (loop0): error: couldn't mount because of unsupported optional features (4)
any ideas?
bootubuntu script
hello. it seems i'm unable to log into androidclone.com are you able to post the bootubuntu script?
link
I think this could be the script you looking for, gonna try this out on my flipout when i get home
https://www.ebower.com/docs/droidx-hacking/
Related
How can i take a cooked desire ROM, and port it to the htc hd2? (or use it as a base?)
I understand how to make a system.ext2 (make the image, not how to put anything in it) and i understand how to mount it -- but how can we make the build??? there are no tutorials on this at all, and i wish there was.
Any help would be extremely helpful! Thanks in advance!
------------
Oh and i noticed that nobody has ported any Evo 4G roms (even though the devices are pretty similar). why is that? Because it is CDMA?
------------
Update: What I KNOW
ThaDeanesta said:
(From my post #8)
Well, from what i can see:
You can create a system.ext2 image from a folder in ubuntu (in terminal) using
Code:
[B][I]First, you need to change directory to your desktop:[/I][/B]
cd /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop
[B][I]Then, make an image of a folder on your desktop:[/I][/B]
sudo genext2fs -d /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop/[COLOR="Magenta"][FOLDER][/COLOR] 307200 system.ext2
Where [USERNAME] = your short ubuntu username, and [FOLDER] is the folder of which you want to make an image of. (the contents of the folder will be put into the root of your image).
This will make a 300MB image. If you want to change that, change the "307200" to the value that you want.
------------------------------If you extract an update.zip, there is a system folder,a data folder, and a boot.img.
I'm pretty sure that you can take the contents of the system folder, and put them in system.img. I'm not 100% sure on what to do with the data folder, but i think you can put the contents into data.img. As for the boot.img, i think that it may be rootfs.img but am not 100% sure.
------------------------------
Now, if you want to look at an exsisting system.ext2 or a data.img, just open up terminal and tipe in:
Code:
sudo mount -o loop /home/[COLOR="Red"][username][/COLOR]/Desktop/system.ext2 /mnt
This is just an example for if your file is on the desktop, and will be mounted in /mnt.
Change the username to your username before entering this into terminal ;). The same
process works for data.img (just change system.ext2 to data.img).
------------------------------I know the way to create an image is correct, and i know the way to mount an image is correct, but i'd like to know exactly how to do the process from the start.
Click to expand...
Click to collapse
Useful!
I would love to know if there is a way or instructions on how to do this. The desire has many great roms/modded apps I would like on my phone.
I would love to know too. But I'm pretty happy with what the devs are doing so far with these roms.
Sent From My Htc-Hd2 With Froyostone V.2 Using XDA App
Go look in the android dev subforum. you might find something there
Sent from my Nexus One using XDA App
search on COFFEESHOP
Yea, I too would LOVE to know more about this...
^^^That coffee shop is OLD and hasn't been updated in a long time...I wouldn't bother...
There is a good kitchen in the Android main dev thread, but it's currently not for WM devices running Android...
PLEASE someone share the secret!
i want know too. who can share tool kitchen and to lead please! thanks
What I Know....
Well, from what i can see:
You can create a system.ext2 image from a folder in ubuntu (in terminal) using
Code:
[B][I]First, you need to change directory to your desktop:[/I][/B]
cd /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop
[B][I]Then, make an image of a folder on your desktop:[/I][/B]
sudo genext2fs -d /home/[COLOR="Red"][USERNAME][/COLOR]/Desktop/[COLOR="Magenta"][FOLDER][/COLOR] 307200 system.ext2
Where [USERNAME] = your short ubuntu username, and [FOLDER] is the folder of which you want to make an image of. (the contents of the folder will be put into the root of your image).
This will make a 300MB image. If you want to change that, change the "307200" to the value that you want.
------------------------------If you extract an update.zip, there is a system folder,a data folder, and a boot.img.
I'm pretty sure that you can take the contents of the system folder, and put them in system.img. I'm not 100% sure on what to do with the data folder, but i think you can put the contents into data.img. As for the boot.img, i think that it may be rootfs.img but am not 100% sure.
------------------------------
Now, if you want to look at an exsisting system.ext2 or a data.img, just open up terminal and tipe in:
Code:
sudo mount -o loop /home/[COLOR="Red"][username][/COLOR]/Desktop/system.ext2 /mnt
This is just an example for if your file is on the desktop, and will be mounted in /mnt.
Change the username to your username before entering this into terminal ;). The same
process works for data.img (just change system.ext2 to data.img).
------------------------------I know the way to create an image is correct, and i know the way to mount an image is correct, but i'd like to know exactly how to do the process from the start.
?????????????????
Thanks for the info! Should help a lot
i used : sudo genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] 307200 system.ext2
but erro :
[email protected]:~/Desktop$ sudo genext2fs -d /home/hoang/Desktop/folder1 307200 system.ext2
genext2fs: Too many arguments. Try --help or else see the man page.
i use : sudo mount -o loop /home/hoang/Desktop/system.ext2 /mnt
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
and modifed it and now i want create to ext2 file
how to create a system.ext2 , please help me ! thanks
hoangan12 said:
i used : sudo genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] 307200 system.ext2
but erro :
[email protected]:~/Desktop$ sudo genext2fs -d /home/hoang/Desktop/folder1 307200 system.ext2
genext2fs: Too many arguments. Try --help or else see the man page.
i use : sudo mount -o loop /home/hoang/Desktop/system.ext2 /mnt
and modifed it and now i want create to ext2 file
how to create a system.ext2 , please help me ! thanks
Click to expand...
Click to collapse
try using
genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] -b 307200 system.ext2
also dont use the sudo command for this. If you use sudo then this will create it with root only permissions and makes it more annoying to edit.
Thats should help.
So looking at a Desire build the system folder in this is the same as our system.ext2 file and can see were some of the files fit but there are others in the desire build that look to belong in the kernel.
I am not bothered about building a new kernel as there are several fine people already working on excellent ones but i think we need a break down for rootfs and the intird.gz to find out a little more of what goes were when taking a working nexus/desire build apart to recompile for us.
Still not helping
i cant move lost+found folder
smjfosho said:
i cant move lost+found folder
Click to expand...
Click to collapse
From where.....
Ok Lets assume that you have mounted the system.ext2 to /mnt
from terminal type chmod 777 /mnt/lost+found
see if this helps. You might need to preface the command with sudo if it does not work
David Balfour said:
try using
genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] -b 307200 system.ext2
also dont use the sudo command for this. If you use sudo then this will create it with root only permissions and makes it more annoying to edit.
Thats should help.
So looking at a Desire build the system folder in this is the same as our system.ext2 file and can see were some of the files fit but there are others in the desire build that look to belong in the kernel.
I am not bothered about building a new kernel as there are several fine people already working on excellent ones but i think we need a break down for rootfs and the intird.gz to find out a little more of what goes were when taking a working nexus/desire build apart to recompile for us.
Click to expand...
Click to collapse
This is pretty much what I was wondering too. Like, where do I put all of these Kernal and Module files and make them play nice with Android and then port it all so I can use it on my HD2.
Noob Question:
When you say mount the img, what exactly do you mean? Is it the same is being able to open the file and add/remove the files that make up the img?
Is there anywhere I can find like a cheat sheet of sorts for terminal commands?
Sorry for the noob questions, I have never used Linux before.
I was able to though within about 3.5 hours create 2 custom ROMS, flash my wifes G1 without bricking it, and use coffeeshop to create a System.ex2 file from a CM6 Desire rom I modified and added FRG33 radio too To bad I have no idea WTH to do with it
Sooo... I'm learning if anything!
I have managed to create the system.ext2 file haret loads and then starts to boot android but gets to cant find ipv6 and then loops with the battery percentage. I think I am not using the right image.
I downloaded a desire image from shippedroms.com Im wondering is there another source for downloading roms? I am looking for a rom compatable with the HD2 that has sense.
GhostXSeries said:
I have managed to create the system.ext2 file haret loads and then starts to boot android but gets to cant find ipv6 and then loops with the battery percentage. I think I am not using the right image.
I downloaded a desire image from shippedroms.com Im wondering is there another source for downloading roms? I am looking for a rom compatable with the HD2 that has sense.
Click to expand...
Click to collapse
you cant just take a desire build and make an ext2 and hope it will work. You need to port all the correct drivers,firmware other modules. Dont ask me what though i dont know and no one seems to be sharing.
Also @Hatefly http://ss64.com/bash/
hope that helps
Yes I have tried the desire build and sofar it does not boot. I am getting furhter and getting android to load.
I am using kitchen to extract the image file and then using the genext2fs -d /home/[USERNAME]/Desktop/[FOLDER] -b 307200 system.ext2 to create the ext2 file its self. I will play arround with the desire build and see if I can get it working. If I can I will be sure to share the procedure
i chmod 777 the complete set of folders and build prop prior to making it a ext2. see if it helps everyone else
The actual creation of an arm linux chroot image is probably out here on teh internetz somewhere, but I can assist with my mounting shell script (which works).
My image is of a debian arm chroot, and the image filesystem is ext2 (a good idea for fewer writes. ie innately non-journaling), has been used extensively on fw DE .17 and I'm currently trying it out on WW .29 (thank you, miloj).
I would upload my debian img somewhere, but I've actually broken it somewhat (it works for my needs, but it's nonetheless a bit too hacked up to be reliable).
I've modified it somewhat for generalization, some of it is probably wrong and/or redundant, and it IS hackish and ugly, but it works for me (tm).
* the chroot image only need a root account (and probably bash installed, but it usually is)
* You need busybox installed.
* You need to upload your chroot image named linux.img to the internal sdcard in a folder named linux
A shell script to set things up is attached.
What you need to do:
push the install script and run it:
Code:
adb push installlinuxstuff.sh /data/local/
adb shell sh /data/local/installlinuxstuff.sh
Now you can (from adb shell or terminal emulator on device):
Code:
su -
/data/local/mnt/linux.sh
/data/local/mnt/notlinux.sh
Feel free to remove the install script at
/data/local/installlinuxstuff.sh
when you've got it up and running.
Alternative way to run the scripts from adb shell:
Code:
adb shell su -c /data/local/mnt/linux.sh
adb shell su -c /data/local/mnt/notlinux.sh
I usually symlink start and stop (in my case deb and undeb) shell scripts placed in /data/local/mnt in /system/bin (ie shell scripts with 'su -c /data/local/mnt/whatever.sh' in them) for easy start an stop from terminal emulator, and if you've gotten this far you may welcome the small advice. (in other words - don't do this unless you _really_ know what you're doing)
Debian ARMHF or ARMEL?
If you would uploaded it (good place is google drive , sharing as public, as there are no ads or bull**** and the download is extremely fast) I would love to try your image - after modifying your script so it can work on a UHS-1 class MicroSD I want to try running this off of (should give it a little more speed).
zamaditix said:
Debian ARMHF or ARMEL?
If you would uploaded it (good place is google drive , sharing as public, as there are no ads or bull**** and the download is extremely fast) I would love to try your image - after modifying your script so it can work on a UHS-1 class MicroSD I want to try running this off of (should give it a little more speed).
Click to expand...
Click to collapse
Armel (I use the same chroot installation on my phone in a smaller image file (with less stuff installed)). I've got loads of personal stuff all over it and besides - it's somewhat broken. I really don't want to try to fix it.
So I'm working on retracing my steps, creating a clean armhf ext2 image (debian wheezy base installation for now) and redo the mount script, but I can't make any promises on a release date.
Anyhu - there are loads of images (armel, at least) on teh internetz (BT5 and too many ubuntu, for instance).
Just check so our kernel can mount the filesystem.
Edit: if not you can just create a new image file with a filsystem that's mountable and copy the chroot files to it.
So the ideal image for this tablet is armhf? If I wanted to create a Gentoo image, I would go with armv7? I'm just not sure exactly which ARM architecture this tablet is.
EndlessDissent said:
So the ideal image for this tablet is armhf? If I wanted to create a Gentoo image, I would go with armv7? I'm just not sure exactly which ARM architecture this tablet is.
Click to expand...
Click to collapse
The CPU is the Tegra 3 if you want to google it and it is an ARMv7 w/ NEON extensions chip. ARMv7 specification requires hardware fp so naturally it is ARMhf.
Nice to hear, keep us updated on your progress. I'm currently running an armel copy of Ubuntu 12.04 but it has problems with some packages and others are armhf only.
When I run linux.sh, I get an error that /sdcard can't be mounted because it doesn't exist.
Code:
mount: mounting /sdcard on /data/local/mnt/linux/sdcard failed: No such file or directory
I also tried changing the script to mount /mnt/sdcard, but that didn't work either.
EndlessDissent said:
When I run linux.sh, I get an error that /sdcard can't be mounted because it doesn't exist.
Code:
mount: mounting /sdcard on /data/local/mnt/linux/sdcard failed: No such file or directory
I also tried changing the script to mount /mnt/sdcard, but that didn't work either.
Click to expand...
Click to collapse
Yes, it is somewhat hackish, like I wrote. My image has got an sdcard folder (/sdcard) inside of it where I mount /sdcard from android. (Ie chroot and mkdir /sdcard)
followed this:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-rooted-transformer-prime/
make sure you have busybox installed der. Or at least the cp command in /system/bin
works well on my TF300T, Yea its not native but im currently configuring it for kernel building ;-D
FlyingPoo said:
followed this:
http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-rooted-transformer-prime/
make sure you have busybox installed der. Or at least the cp command in /system/bin
works well on my TF300T, Yea its not native but im currently configuring it for kernel building ;-D
Click to expand...
Click to collapse
Why does the mount script remount a non-existing block device with an ancient (according to android) filesystem?
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Edit: I read all the scripts, and they all mount that crap. It's not made for transformers, and on the android device it's made for it leaves /system mounted rw after you've run it, and WHEN run (installed) it modifies too much in /system/bin
Code:
# At first it copies loads of crap to /system/bin, and then:
cd /system/bin/
chmod 4777 *
It's not even "hackish" - it's just... wrong...
Will loop1 work every mount?
Code:
mknod /dev/loop1 b 7 0
losetup /dev/block/loop1
I'm almost only asking, since this thread was supposed to be about scripts?
gasingvar said:
Yes, it is somewhat hackish, like I wrote. My image has got an sdcard folder (/sdcard) inside of it where I mount /sdcard from android. (Ie chroot and mkdir /sdcard)
Click to expand...
Click to collapse
Thanks. I created /sdcard, and it works almost perfectly now. However, mounting devpts at /dev/pts doesn't seem to work. I replaced that line with
Code:
mount --bind /dev $mnt/dev
and it seems to work fine. Is there anything wrong with my method?
/dev/void said:
Why does the mount script remount a non-existing block device with an ancient (according to android) filesystem?
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
Edit: I read all the scripts, and they all mount that crap. It's not made for transformers, and on the android device it's made for it leaves /system mounted rw after you've run it, and WHEN run (installed) it modifies too much in /system/bin
Code:
# At first it copies loads of crap to /system/bin, and then:
cd /system/bin/
chmod 4777 *
It's not even "hackish" - it's just... wrong...
Will loop1 work every mount?
Code:
mknod /dev/loop1 b 7 0
losetup /dev/block/loop1
I'm almost only asking, since this thread was supposed to be about scripts?
Click to expand...
Click to collapse
I'm assuming you're talking about the link in the post you quoted, even though you seem to be referencing the OP's use of the word "hackish". The script in the OP doesn't do any of that stuff. It just creates a few directories in /data/local/mnt/ and writes the mount/unmount scripts, which themselves only un/mount appropriate directories for the tablet. As for your question, I'm not nearly experienced enough to answer it. Sorry.
EndlessDissent said:
Thanks. I created /sdcard, and it works almost perfectly now. However, mounting devpts at /dev/pts doesn't seem to work. I replaced that line with
Code:
mount --bind /dev $mnt/dev
and it seems to work fine. Is there anything wrong with my method?
Click to expand...
Click to collapse
AFAIK your mount seems to be more complete, ie more android hardware goodies accessable from the chroot environment. However - that means more things possibly going wrong (like writing to a device who's critical to the android environment).
Personally I'd try to find what "hardware goodies" and whatnot I'd need to get the chroot environment working optimally, and not mount ALL of /dev.
EndlessDissent said:
I'm assuming you're talking about the link in the post you quoted, even though you seem to be referencing the OP's use of the word "hackish". The script in the OP doesn't do any of that stuff. It just creates a few directories in /data/local/mnt/ and writes the mount/unmount scripts, which themselves only un/mount appropriate directories for the tablet. As for your question, I'm not nearly experienced enough to answer it. Sorry.
Click to expand...
Click to collapse
Yes, and the OP is very honest about his script(s) being "hackish", which I interpret to mean 'not optimal, possibly redundant but working', all of which it is (and I applaud the early release, since for instance I could get things rolling), but the ubuntu image installation and mounting scripts from the other poster ( whom I was addressing ) are plain faulty.
I am looking for a armhf build of ubuntu or debian that I can chroot (newer the better), if anyone knows of such a build that would be fantastic but if not does anyone know of an easy to follow guide to compile such a thing?
I found two pretty good guides. I mostly followed THIS ONE, but I found that it doesn't mount enough before "first boot", so what I did was follow the guide until the point where you move the image to the tablet. Then I ran the OP's installlinux.sh script, and then the mount script. However, the mount/unmount scripts need to be edited before using them. Comment out the sdcard line and probably the devpts line (mounting devpts didn't work; Bash complained that devpts didn't exist; I had to replace it with the line I mentioned a few posts above, but as /dev/void says, it could be problematic, so be careful). Mount the image, make the /sdcard directory, exit, unmount, and edit the scripts again to mount/unmount /sdcard.
Next time you enter the chroot, feel free to run the
Code:
sh /debootstrap/debootstrap --second-stage
command to build the image, and follow the linked guide until the next time it tells you to exit the session (NOTE: The second echo "whatever" > sources.list command is wrong; it should be echo "whatever" >> sources.list; Also, remember to replace "squeeze" with the appropriate Debian version, in my case, "testing"). Instead of exiting right after the apt-get update, I'd recommend playing around with the chroot and configuring whatever apps you install. You can just use the OP's scripts now and ignore the script in the linked guide.
When the guide I linked above gets to this line:
Code:
sudo debootstrap --verbose --arch armel --foreign squeeze /mnt/squeeze/ http://ftp.debian.org/debian
just replace armel with armhf, and if you want a testing image, replace squeeze with testing.
Sorry I'm not attaching my image. I made it gigantic (5GB), so I don't really have anywhere to store it, and you probably wouldn't want to download a file that big. Plus, it already has Openbox and a bunch of other things you probably don't want installed. I'm assuming you'd want GNOME or KDE instead.
Hi guys, I made a little screen-cast of the routine used to root an android emulator.
Here's the video version, but I wrote the text version under it too.
Prerequisities
su binary : http://d-h.st/qZ2
busybox binary : http://d-h.st/IIv
Superuser apk : http://d-h.st/Et5
(These instructions are assuming you're on ubuntu or an other debian-based linux distro, but it should be pretty easy to adapt to batch if you're on windows.)
Instructions
1) First, create a new AVD in Eclipse or in terminal
Here's the manpage for the emulator :
Code:
Android Emulator usage: emulator [options] [-qemu args]
options:
-sysdir <dir> search for system disk images in <dir>
-system <file> read initial system image from <file>
-datadir <dir> write user data into <dir>
-kernel <file> use specific emulated kernel
-ramdisk <file> ramdisk image (default <system>/ramdisk.img
-image <file> obsolete, use -system <file> instead
-initdata <file> same as '-init-data <file>'
-data <file> data image (default <datadir>/userdata-qemu.img
-partition-size <size> system/data partition size in MBs
-cache <file> cache partition image (default is temporary file)
-cache-size <size> cache partition size in MBs
-no-cache disable the cache partition
-nocache same as -no-cache
-sdcard <file> SD card image (default <system>/sdcard.img
-snapstorage <file> file that contains all state snapshots (default <datadir>/snapshots.img)
-no-snapstorage do not mount a snapshot storage file (this disables all snapshot functionality)
-snapshot <name> name of snapshot within storage file for auto-start and auto-save (default 'default-boot')
-no-snapshot perform a full boot and do not do not auto-save, but qemu vmload and vmsave operate on snapstorage
-no-snapshot-save do not auto-save to snapshot on exit: abandon changed state
-no-snapshot-load do not auto-start from snapshot: perform a full boot
-snapshot-list show a list of available snapshots
-no-snapshot-update-time do not do try to correct snapshot time on restore
-wipe-data reset the user data image (copy it from initdata)
-avd <name> use a specific android virtual device
-skindir <dir> search skins in <dir> (default <system>/skins)
-skin <name> select a given skin
-no-skin don't use any emulator skin
-noskin same as -no-skin
-dynamic-skin dynamically construct a skin of given size, requires -skin WxH option
-memory <size> physical RAM size in MBs
-netspeed <speed> maximum network download/upload speeds
-netdelay <delay> network latency emulation
-netfast disable network shaping
-trace <name> enable code profiling (F9 to start)
-show-kernel display kernel messages
-shell enable root shell on current terminal
-no-jni disable JNI checks in the Dalvik runtime
-nojni same as -no-jni
-logcat <tags> enable logcat output with given tags
-no-audio disable audio support
-noaudio same as -no-audio
-audio <backend> use specific audio backend
-raw-keys disable Unicode keyboard reverse-mapping
-radio <device> redirect radio modem interface to character device
-port <port> TCP port that will be used for the console
-ports <consoleport>,<adbport> TCP ports used for the console and adb bridge
-onion <image> use overlay PNG image over screen
-onion-alpha <%age> specify onion-skin translucency
-onion-rotation 0|1|2|3 specify onion-skin rotation
-scale <scale> scale emulator window
-dpi-device <dpi> specify device's resolution in dpi (default 165)
-http-proxy <proxy> make TCP connections through a HTTP/HTTPS proxy
-timezone <timezone> use this timezone instead of the host's default
-dns-server <servers> use this DNS server(s) in the emulated system
-cpu-delay <cpudelay> throttle CPU emulation
-no-boot-anim disable animation for faster boot
-no-window disable graphical window display
-version display emulator version number
-report-console <socket> report console port to remote socket
-gps <device> redirect NMEA GPS to character device
-keyset <name> specify keyset file name
-shell-serial <device> specific character device for root shell
-tcpdump <file> capture network packets to file
-bootchart <timeout> enable bootcharting
-charmap <file> use specific key character map
-prop <name>=<value> set system property on boot
-shared-net-id <number> join the shared network, using IP address 10.1.2.<number>
-nand-limits <nlimits> enforce NAND/Flash read/write thresholds
-memcheck <flags> enable memory access checking
-gpu <mode> set hardware OpenGLES emulation mode
-camera-back <mode> set emulation mode for a camera facing back
-camera-front <mode> set emulation mode for a camera facing front
-webcam-list lists web cameras available for emulation
-screen <mode> set emulated screen mode
-force-32bit always use 32-bit emulator
-qemu args... pass arguments to qemu
-qemu -h display qemu help
-verbose same as '-debug-init'
-debug <tags> enable/disable debug messages
-debug-<tag> enable specific debug messages
-debug-no-<tag> disable specific debug messages
-help print this help
-help-<option> print option-specific help
-help-disk-images about disk images
-help-keys supported key bindings
-help-debug-tags debug tags for -debug <tags>
-help-char-devices character <device> specification
-help-environment environment variables
-help-keyset-file key bindings configuration file
-help-virtual-device virtual device management
-help-sdk-images about disk images when using the SDK
-help-build-images about disk images when building Android
-help-all prints all help content
2) Then, open a terminal (ctrl+alt+T) and type the following command in order to start you freshly created emulator with a bigger /system partition so we can push the su & busybox binaries :
Code:
emulator -avd yourNewAvdName -partition-size 256 -no-snapshot-load
Wait for the emulator to boot.
3) Now, cd to the directory where you put the binaries and the apk you downloaded in the prerequisities, and issue the following comands in your terminal :
Code:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
adb push su /system/xbin/su
adb push busybox /system/xbin/busybox
adb install Superuser.apk
adb shell
chmod 06755 /system/xbin/su
chmod 06755 /system/xbin/busybox
4) Enjoy your Rooted emulator
However, you might need to go through these steps every time you start this emulator, to avoid this hassle, here's a script containing those commands : rootavd.sh
Simply put it where you put the binaries, cd to this location and enter the following command to execute it :
Code:
bash rootavd.sh
...since many thanked you apparently it worked to many but why didn't it to me?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Why's this so? I've tried many similar guides, and it makes sense for this to work but it always shows the above (permision denied) and there's absolutely no other way to test applications that require root, for better or worse :/
Obviously I've followed the step it's not that it is hard to do so gave the right permissions but still no root?
Sth's on with the chmod commands?
Thanks for the guide and attention...
PS: It probably doesn't work in JellyBean'd AVD? :/
Stevethegreat said:
...since many thanked you apparently it worked to many but why didn't it to me?
Why's this so? I've tried many similar guides, and it makes sense for this to work but it always shows the above (permision denied) and there's absolutely no other way to test applications that require root, for better or worse :/
Obviously I've followed the step it's not that it is hard to do so gave the right permissions but still no root?
Sth's on with the chmod commands?
Thanks for the guide and attention...
PS: It probably doesn't work in JellyBean'd AVD? :/
Click to expand...
Click to collapse
Yeah, I believe it's been patched in jellybean.
However, you can use Jar of Beans, which is a community-built pre-rooted jb emulator.
Sadly it seems to be windows only. I'll post a guide if I manage to run it on linux through WINE
I know this is a little old of a post but i wanted to point out that i noticed a lot of people (when i was searching for a solution) having a hard time trying to get,
emulator -avd youravdhere -partition-size 256 -no-snapshot-load, to work correctly or not popup at all.
After a little research i noticed that you should add
./emulator to the first part instead of just "emulator"
hope this helps anyone. (credits goes to another person on another site i take no credit just spreading the knowledge)
kamakazidreamer said:
I know this is a little old of a post but i wanted to point out that i noticed a lot of people (when i was searching for a solution) having a hard time trying to get,
emulator -avd youravdhere -partition-size 256 -no-snapshot-load, to work correctly or not popup at all.
After a little research i noticed that you should add
./emulator to the first part instead of just "emulator"
hope this helps anyone. (credits goes to another person on another site i take no credit just spreading the knowledge)
Click to expand...
Click to collapse
You don't necessarily need that. As far as I know the only situation in which you might need this is on a Linux system. (Not sure about Mac)
And even in this case it depends. You can also add the tools directory to your PATH variable. Then you won't need it.
So not all people will need this but some definitely will. So thanks for that.
nikwen said:
You don't necessarily need that. As far as I know the only situation in which you might need this is on a Linux system. (Not sure about Mac)
And even in this case it depends. You can also add the tools directory to your PATH variable. Then you won't need it.
So not all people will need this but some definitely will. So thanks for that.
Click to expand...
Click to collapse
guess i should have pointed out i was using xubuntu to do all this haha.
Hello
Can you redownload files for rooting emulator?
I downloaded files from another source, but it doesn't work with it.
kolia2221 said:
Hello
Can you redownload files for rooting emulator?
I downloaded files from another source, but it doesn't work with it.
Click to expand...
Click to collapse
Can anyone help me?
Android L
Will this work on an Android L avd
i have nand backup generated from galaxy s2 . can i restore this backup on rooted avd s2
or virtual machine??
akhilnarang said:
Will this work on an Android L avd
Click to expand...
Click to collapse
I've had no luck so far, followed the guide but SuperSU tells me that "su is not present" and that "he cannot install it".
Anyone succeded in rooting a 5.0 AVD?
I am trying to get xposed framework going in remix os to get xprivacy. I am running remix os in virtualbox and I am having trouble getting adb set up. Remix os is similar to android x86 so has anyone been able to get xposed working in either remix os or android x86 marshmallow?
After rooting my S4 I was checking around online for any way to boot into ubuntu on it as I think it would look awesome on the S4 and it would run smoother than it did on my dead Note. While snooping around google I was suprised that no one even mentioned trying to run ubuntu on the new Galaxy S4 so I took it upon myself to try to run it through the terminal into vnc.
Sadly after a lot of attempts I keep getting the script to boot I started looking online for a similar ubuntu.sh script and found one for the S3 herehttp://www.redmondpie.com/how-to-run-ubuntu-linux-on-galaxy-s-iii/. So I got it and changed the /sdacrd that most phones have and changed it to /storage/extSdCard as this is where the external sdcard on the S4 is and now get this error in the terminal.
.../storage/extSdCard/ubuntu # sh ubuntu.sh
ubuntu.sh[17]: syntax error: "if" unmatched
I know this is an error in line 17 which is:
if [ -b /dev/block/loop255 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop255 b 7 255
fi
I'm not really familiar with loops and would be happy for some help with this as others might find it useful too.
I have attached the original ubuntu.sh by zacthespack with only the directories changed.
NOTE: I have an ubuntu.sh that I got to boot last night at home, but all I got is a white screen in vnc. zacthespack says it might be a vnc issue but I doubt it as I have tried multiple different vnc's. I will upload the ubuntu.sh when I get home (if zac allows me )
Sorry...first time posting. Anyway to move it?
Sent from my SAMSUNG-SGH-I337 using Tapatalk 2
Couple of things...
1. You need to boot or chroot into an Ubuntu image (Complete Linux Installer does this)
2. Running Ubuntu natively is pointless and very difficult since you need a working Freedreno setup and the means to hijack the screen
3. What are you trying to do again?
To boot into ubuntu. I have complete ubuntu installer and it still doesn't work.
To be more specific it says "cannot attach image to loop device"
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my SAMSUNG-SGH-I337 using Tapatalk 2
Ubuntu is nice but would like to see backtrack5 . Nothing like a full (well mostly full if chroot) pentest suite in your pocket.
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Bender B. Rodgriguez said:
Ubuntu is nice but would like to see backtrack5 . Nothing like a full (well mostly full if chroot) pentest suite in your pocket.
Click to expand...
Click to collapse
Yeah that would be pretty cool too. Im going to look into it on my free time.
Sent from my SAMSUNG-SGH-I337 using Tapatalk 2
Bender B. Rodgriguez said:
Ubuntu is nice but would like to see backtrack5 . Nothing like a full (well mostly full if chroot) pentest suite in your pocket.
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
fwiw dsploit does ~80% of what BT5 does
http://www.dsploit.net/
jbe4 said:
fwiw dsploit does ~80% of what BT5 does
http://www.dsploit.net/
Click to expand...
Click to collapse
Yeah I agree, Ive used it before. Still like to have the full bt5 suite tho.
Only so much can be done with MITM , session hijacking stuff. I also like to have dirbuster, and the webapp tools as well.
I also prefer not to use tools that any monkey can pick up on. Not that BT is uber-hard and only for the dedicated pentester, but the linux learning curve is enough to keep it out of the hands of the truly unworthy.
greenzone560 said:
To boot into ubuntu. I have complete ubuntu installer and it still doesn't work.
To be more specific it says "cannot attach image to loop device"
Sent from my SAMSUNG-SGH-I337 using Tapatalk 2
Click to expand...
Click to collapse
Are you 100% positive that is the correct mount point?
I ask because with Android 4.2.2 they have emulated mount points for the internal SD card but not 100% sure about the external.
Can you browse to the image using an app like ES file Explorer. If so what is the path you used?
Do an 'ls' command from the prompt you showed and see whats there?
jbe4 said:
fwiw dsploit does ~80% of what BT5 does
http://www.dsploit.net/
Click to expand...
Click to collapse
if you truly know your way around BT5, or the newer Kali Linux, no, dsploit does not do ~80% of what they do, but a mere 5% at most.
scrosler said:
Are you 100% positive that is the correct mount point?
I ask because with Android 4.2.2 they have emulated mount points for the internal SD card but not 100% sure about the external.
Can you browse to the image using an app like ES file Explorer. If so what is the path you used?
Do an 'ls' command from the prompt you showed and see whats there?
Click to expand...
Click to collapse
Im not 100% sure that the external SD has emulated points but, it sure seems like it. Yes I can browse it with Root Browser (personal preference). The mount point for ext. sd card is /storage/extSdCard...Im 100% sure of that.
I used motochoppers exploit to root, so I don't know if that makes a difference. As far as I know it should not affect the emulation process since we are at the root level anyways. Vnc and rdp apps work, so emulation on the internal sd is fine. Its just that it doesn't want to bind internal and external into one process...so to speak.
greenzone560 said:
Im not 100% sure that the external SD has emulated points but, it sure seems like it. Yes I can browse it with Root Browser (personal preference). The mount point for ext. sd card is /storage/extSdCard...Im 100% sure of that.
Click to expand...
Click to collapse
yep, that's the correct mount for the external. I had seen this article previously too for bt5, idk if it'll actually help though
Just reread this post. I see you are making good progress here.
As for the vnc issue. When I did a backtrack chroot on my skyrocket there were similar issues. The fix was basically to edit the vnc ui file and set it to the correct screen dimensions of the phone.
Read this and try the sed command to change them accordingly. The path to the vnc files may be different in ubuntu as well.
Sorry if way off base here , just figured I would offer a suggestion
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
---------- Post added at 01:39 AM ---------- Previous post was at 01:38 AM ----------
greenzone560 said:
After rooting my S4 I was checking around online for any way to boot into ubuntu on it as I think it would look awesome on the S4 and it would run smoother than it did on my dead Note. While snooping around google I was suprised that no one even mentioned trying to run ubuntu on the new Galaxy S4 so I took it upon myself to try to run it through the terminal into vnc.
Sadly after a lot of attempts I keep getting the script to boot I started looking online for a similar ubuntu.sh script and found one for the S3 herehttp://www.redmondpie.com/how-to-run-ubuntu-linux-on-galaxy-s-iii/. So I got it and changed the /sdacrd that most phones have and changed it to /storage/extSdCard as this is where the external sdcard on the S4 is and now get this error in the terminal.
.../storage/extSdCard/ubuntu # sh ubuntu.sh
ubuntu.sh[17]: syntax error: "if" unmatched
I know this is an error in line 17 which is:
if [ -b /dev/block/loop255 ]; then
echo "Loop device exists"
else
busybox mknod /dev/block/loop255 b 7 255
fi
I'm not really familiar with loops and would be happy for some help with this as others might find it useful too.
I have attached the original ubuntu.sh by zacthespack with only the directories changed.
NOTE: I have an ubuntu.sh that I got to boot last night at home, but all I got is a white screen in vnc. zacthespack says it might be a vnc issue but I doubt it as I have tried multiple different vnc's. I will upload the ubuntu.sh when I get home (if zac allows me )
Click to expand...
Click to collapse
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Bender B. Rodgriguez said:
Just reread this post. I see you are making good progress here.
As for the vnc issue. When I did a backtrack chroot on my skyrocket there were similar issues. The fix was basically to edit the vnc ui file and set it to the correct screen dimensions of the phone.
Read this and try the sed command to change them accordingly. The path to the vnc files may be different in ubuntu as well.
Sorry if way off base here , just figured I would offer a suggestion
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
---------- Post added at 01:39 AM ---------- Previous post was at 01:38 AM ----------
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
Nope, not off topic at all. I will look into the .img file and see if anything is different there. Which I'm assuming I will need to change from sdcard to extSdCard for it to let through to the vnc.
I have finally found a solution to the "if" unmatched problem. The ubuntu.sh needs to edited in a linux enviorment because it breaks if you edit it in windows. I will post the ubuntu.sh later today. Also I think I have backtrack 5 down too
EDIT: Okay, I'm stumped...I have no idea why it can't see "system/bin/sh"
Here is the error:
[email protected]:/storage/extSdCard/bt5 # sh bootbt
BACKTRACK 5 IS STARTING PLEASE WAIT...
loop device exists!
net.ipv4.ip_forward = 1
chroot: can't execute '/bin/bash': No such file or directory
....
unmount: can't unmount /data/local/mnt/dev/proc: invalid argument
unmount: can't unmount /data/local/mnt/sys: invalid argument
etc...
losetup: /dev/block/loop255: No such device or address
And here is the script I used:
echo "BACKTRACK 5 IS STARTING PLEASE WAIT..."
perm=$(id|cut -b 5)
if [ "$perm" != "0" ];
then echo "This Script Needs Root! Type : su";exit;fi
chmod 755 /data/local
mount -o remount,rw /dev/block/mmcblk0p5 /system
export bin=/system/bin/
####Sometimes people have busybox installed in /xbin##########
export bin=/system/xbin/
export kit=/storage/extSdCard/bt5
export mnt=/data/local/mnt
mkdir -p $mnt
export PATH=$bin:/usr/bin:/usr/local/bin:/usr/sbin:/bin:/usr/local/sbin:/usr/games:$PATH
export TERM=linux
export HOME=/root
if [ -b /dev/block/loop255 ]; then
echo "loop device exists!"
else
busybox mknod /dev/block/loop255 b 7 255
fi
busybox mkdir /data/local/mnt > /dev/null 2>&1
busybox mkdir /data/local/mnt/proc > /dev/null 2>&1
busybox mkdir /data/local/mnt/sys > /dev/null 2>&1
busybox mkdir /data/local/mnt/dev > /dev/null 2>&1
busybox mkdir /data/local/mnt/dev/pts > /dev/null 2>&1
busybox mkdir /data/local/mnt/sdcard > /dev/null 2>&1
busybox mkdir /data/local/mnt/extSdCard > /dev/null 2>&1
busybox mkdir /data/local/bin/bash > /dev/null 2>&1
if
[ ! -d "/data/local/mnt/sdcard" ]; then
mkdir /data/local/mnt/sdcard
fi
busybox mount -o bind /sdcard /data/local/mnt/sdcard
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 bt5" > $mnt/etc/hosts
echo "Back Track is configured with SSH and VNC servers that can be accessed from the IP:"
if
config wlan0
echo " "
busybox chroot $mnt /bin/bash
echo "Shutting down BackTrack ARM"
umount /sdcard
umount /storage/extSdCard
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
losetup -d /dev/block/loop255
If anyone can help, then please do Thanks in advance...
Bump. Anyone?
Sent from my GALAXY [S4] SGH-I337 using xda app-developers app
greenzone560 said:
Bump. Anyone?
Sent from my GALAXY [S4] SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
Hey greenzone,
I had a few minutes tonight so I took the scripts that worked for the sgs2 and made a few minor changes to them. I got BT5 to boot! VNC only shows the grey screen though. I will have to take a look at it a little closer. Here are the scripts that used.
Drop files in sdcard/bt
image needs to be named bt.img
Busybox needs to be installed in /system/xbin
Bender B. Rodgriguez said:
Hey greenzone,
I had a few minutes tonight so I took the scripts that worked for the sgs2 and made a few minor changes to them. I got BT5 to boot! VNC only shows the grey screen though. I will have to take a look at it a little closer. Here are the scripts that used.
Drop files in sdcard/bt
image needs to be named bt.img
Busybox needs to be installed in /system/xbin
Click to expand...
Click to collapse
Wont boot on mine..I get system/xbin/busybox not found error. I tried changing it to /bin still no go. What can cause that? I tried reinstalling in both of those directories so dont even go there lol
EDIT: here is a screen.
http://s24.postimg.org/nqoclmal1/Screenshot_2013_05_18_21_54_13.png
Sent from my GALAXY [S4] SGH-I337 using xda app-developers app
greenzone560 said:
Wont boot on mine..I get system/xbin/busybox not found error. I tried changing it to /bin still no go. What can cause that? I tried reinstalling in both of those directories so dont even go there lol
EDIT: here is a screen.
http://s24.postimg.org/nqoclmal1/Screenshot_2013_05_18_21_54_13.png
Sent from my GALAXY [S4] SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
Hrmm..
It definitely looks like busybox is not in /system/xbin from your output. I know you said not go to there but just verify the busybox binary is there. ( ls /system/xbin/busybox).
You can also change the "busybox path" variable in all the scripts to point to where you have busybox installed.
Also all the files and the bt image need to be in /sdcard/bt or the script will not work anyways. Or you can edit the path in the "kit" variable in the scripts to point to the folder you are using on your external sd card.
also run in order
installbt.sh
startbt
bt
Hey guys,
I was looking for a way to install some Linux applications on the FireTV. After trying out optware (which installs a package manager to android systems) with little success, I ended up installing a Debian Chroot on the external USB. The following is a list of apps which now run almost natively on the firetv:
- Transmission 2.82/couchpotato/sickbeard
- openssh
- nano
- x11 environment
- vnc server
- ftp server
I hope these instructions will be useful for some people. Your firetv needs to be rooted for this to work. The process is relatively quick and as easy as it can get. The tricky part is to let The Debian environment boot when the FireTV boots. Here we go:
1. First, get DebKit from Google Play
2. Sideload DebKit onto the FireTV and start it up
3. Grant DebKit Root Permissions
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
4. Push the Menu Button on your FireTV remote and go to settings
5. Select the image Location. I created a folder called debian on the external USB device. The USB works natively through the new FireTV firmware.
6. For the image size I decided to make it 2GB. At first I had a 1GB image but I quickly ran out of space installing the x11 environment
7. Under Debian Distribution I would recommend installing Jessie since it gives you the latest Transmission version. With wheezy you get v 2.6 which does not let you choose folders through the web ui.
8. Go back to the main menu and choose "Install". Follow the onscreen instructions.
At this point you should have a working Debian installation on your FireTV.
9. The first thing we want to do is install openssh to create a login into the chroot. To log into your new Debian installation use
"adb connect 192.168.1.x" (firetv ip) and "adb shell"
10. Once you are logged into the firetv shell, execute "debkit mount" , then "debkit chroot".
11. Inside the chroot execute "apt-get update && apt-get install openssh". You will see a few error messages which are caused by the environment variables of the android shell. When using nano for example you'll notice that the enter key doesn't work. On a full size keyboard you can use the other enter key to confirm though.
12. Now try logging in to your debian chroot with ssh [email protected]" (firetv ip)
AUTOSTART
In order to autostart your debian chroot I created the following script.
1. Go to the android shell and remount /system in rw ( mount -o remount,rw /system )
2. Create or edit /system/etc/install-recovery-2.sh which will autostart (vi /system/etc/install-recovery-2.sh, then chmod 755 /system/etc/install-recovery-2.sh)
3. Here is my complete autostart script. I have all my media connected to my router which has a NFS server running:
Code:
#!/system/bin/sh
sleep 20
busybox mount -o remount,rw /
busybox mkdir -p /mnt/nfs.TV
busybox mkdir -p /mnt/nfs.Movies
busybox chmod 777 /mnt/nfs.TV
busybox chmod 777 /mnt/nfs.Movies
busybox remount,ro /
su --mount-master -c "busybox mount -o nolock,hard,intr,rw -t nfs 192.168.10.1:/mnt/TV /mnt/nfs.TV"
su --mount-master -c "busybox mount -o nolock,hard,intr,rw -t nfs 192.168.10.1:/mnt/Movies /mnt/nfs.Movies"
/data/data/com.mizusoft.debkit/files/debkit mount
sleep 5
busybox mount --bind /mnt/nfs.TV /data/data/com.mizusoft.debkit/files/mnt/mnt/TV
busybox mount --bind /mnt/nfs.Movies /data/data/com.mizusoft.debkit/files/mnt/mnt/Movies
busybox mount --bind /mnt/nfs.Movies/Music /sdcard/MPD/music
sleep 5
/data/data/com.mizusoft.debkit/files/bin/chroot /data/data/com.mizusoft.debkit/files/mnt/ /bin/bash -c "/home/ssh.sh"
4. I mount my nfs shares to the FireTV and then bind them inside the chroot.
5. Here are the contents of /home/ssh.sh which is a script to start the chroot ssh
Code:
/usr/sbin/sshd
sleep 10
/usr/bin/ssh [email protected] "/home/startup.sh"
6. and the contents of /home/startup.sh
Code:
/etc/init.d/transmission-daemon start
/etc/init.d/couchpotato start
/etc/init.d/cron start
7. What you end up with is a FireTV which runs Debian on the side. I've had this setup for the last two months and can say that so far the performance of Kodi does not seem to suffer of having the Debian Chroot running at the same time.
I hope this tutorial will be helpful for people who are looking for ways to extend the use of their FireTV.
Cheers,
Chris
mrchrister said:
Hey guys,
I was looking for a way to install some Linux applications on the FireTV. After trying out optware (which installs a package manager to android systems) with little success, I ended up installing a Debian Chroot on the external USB. The following is a list of apps which now run almost natively on the firetv:
- Transmission 2.82/couchpotato/sickbeard
- openssh
- nano
- x11 environment
- vnc server
- ftp server
I hope these instructions will be useful for some people. Your firetv needs to be rooted for this to work. The process is relatively quick and as easy as it can get. The tricky part is to let The Debian environment boot when the FireTV boots. Here we go:
1. First, get DebKit from Google Play
2. Sideload DebKit onto the FireTV and start it up
3. Grant DebKit Root Permissions
4. Push the Menu Button on your FireTV remote and go to settings
5. Select the image Location. I created a folder called debian on the external USB device. The USB works natively through the new FireTV firmware.
6. For the image size I decided to make it 2GB. At first I had a 1GB image but I quickly ran out of space installing the x11 environment
7. Under Debian Distribution I would recommend installing Jessie since it gives you the latest Transmission version. With wheezy you get v 2.6 which does not let you choose folders through the web ui.
8. Go back to the main menu and choose "Install". Follow the onscreen instructions.
At this point you should have a working Debian installation on your FireTV.
9. The first thing we want to do is install openssh to create a login into the chroot. To log into your new Debian installation use
"adb connect 192.168.1.x" (firetv ip) and "adb shell"
10. Once you are logged into the firetv shell, execute "debkit mount" , then "debkit chroot".
11. Inside the chroot execute "apt-get update && apt-get install openssh". You will see a few error messages which are caused by the environment variables of the android shell. When using nano for example you'll notice that the enter key doesn't work. On a full size keyboard you can use the other enter key to confirm though.
12. Now try logging in to your debian chroot with ssh [email protected]" (firetv ip)
AUTOSTART
In order to autostart your debian chroot I created the following script.
1. Go to the android shell and remount /system in rw ( mount -o remount,rw /system )
2. Create or edit /system/etc/install-recovery-2.sh which will autostart (vi /system/etc/install-recovery-2.sh, then chmod 755 /system/etc/install-recovery-2.sh)
3. Here is my complete autostart script. I have all my media connected to my router which has a NFS server running:
Code:
#!/system/bin/sh
sleep 20
busybox mount -o remount,rw /
busybox mkdir -p /mnt/nfs.TV
busybox mkdir -p /mnt/nfs.Movies
busybox chmod 777 /mnt/nfs.TV
busybox chmod 777 /mnt/nfs.Movies
busybox remount,ro /
su --mount-master -c "busybox mount -o nolock,hard,intr,rw -t nfs 192.168.10.1:/mnt/TV /mnt/nfs.TV"
su --mount-master -c "busybox mount -o nolock,hard,intr,rw -t nfs 192.168.10.1:/mnt/Movies /mnt/nfs.Movies"
/data/data/com.mizusoft.debkit/files/debkit mount
sleep 5
busybox mount --bind /mnt/nfs.TV /data/data/com.mizusoft.debkit/files/mnt/mnt/TV
busybox mount --bind /mnt/nfs.Movies /data/data/com.mizusoft.debkit/files/mnt/mnt/Movies
busybox mount --bind /mnt/nfs.Movies/Music /sdcard/MPD/music
sleep 5
/data/data/com.mizusoft.debkit/files/bin/chroot /data/data/com.mizusoft.debkit/files/mnt/ /bin/bash -c "/home/ssh.sh"
4. I mount my nfs shares to the FireTV and then bind them inside the chroot.
5. Here are the contents of /home/ssh.sh which is a script to start the chroot ssh
Code:
/usr/sbin/sshd
sleep 10
/usr/bin/ssh [email protected] "/home/startup.sh"
6. and the contents of /home/startup.sh
Code:
/etc/init.d/transmission-daemon start
/etc/init.d/couchpotato start
/etc/init.d/cron start
7. What you end up with is a FireTV which runs Debian on the side. I've had this setup for the last two months and can say that so far the performance of Kodi does not seem to suffer of having the Debian Chroot running at the same time.
I hope this tutorial will be helpful for people who are looking for ways to extend the use of their FireTV.
Cheers,
Chris
Click to expand...
Click to collapse
Definitely Cool! Are you strictly using it for the apps you've mentioned or have you found other uses? More screenshots would be awesome--video would be the best. But don't want you to go through too much trouble. I'm very curious to see how it runs in real time, but I'm not likely to have a chance to try it in the foreseeable future. Thanks a lot for sharing though!
BTW--whats the boot time like? It'd be nice to run sickbeard on it if I'm able to switch back and forth fire os/ debian.
Hey Klit,
when I have a bit more time on my hands I might add a video tutorial , it's definately a pretty straight forwarded process if you don't fear using the terminal. the debian environment is only accessible through a terminal so you cant switch between fire os and a debian window manager . The boot time is not affected by loading the debian chroot since the debian stuff loads after fire os is loaded. Sickbeard works great btw!
What mode is Debian running in and is it a visual UI desktop?
While I am here,I must ask,can someone attempt to get a full Linux running using Xserver for maximum performance and make some detailed instructions afterward,I couldn't figure it out myself.
I had a version of Linux running with a UI desktop and a few browsers that worked decent.
Though this done with a slower method and made visible using a VNC app.
It's been so long since I ran it,and I forgot how to start it,and haven't used it since.
It would be nice to have a full Linux OS running via Xserver at high performance,enough to run several cool things smoothly without the framedrops and jitters that VNC gets.
This tutorial is based on Debootstrap, so it installs Debian into a "subdirectory" of fire os. In this case it mounts a 2GB image from the external USB to the Firetv. When you ssh into this environment it will feel like a debian server and you can do most things you can do in debian. you can read more about this over here:
https://wiki.debian.org/Debootstrap
I have a vncserver running on the firetv with fluxbox as my window manager. it runs great but this is not a dual boot setup with debian coexisting on the firetv.
Thanks for the detailed instructions, OP! I wonder if this would work as a Terraria server... TShock is simply too much for the Raspberry Pi.
I would like to install Debian and remove fire OS completely. Does any one have instructions or a link? Thank you.
https://github.com/freedreno/freedreno/wiki/FireTV
Fire TV Stick?
Great work! I can't wait to get the time to try it out myself.
It sounds like you did this on the Fire TV installing Debian on an external USB drive. Did I get that correct? Can this be done on a Fire TV Stick which has no external USB option?
Also, it looks like both Debian and Android run simultaneously based on your comments, is that correct? Does anyone know if there is a way to set it so Android launches when HDMI is plugged in and Debian launches when HDMI is not plugged in and not both simultaneously?