# Ubuntu for Droid 2/D2G



## aceoyame

I am going to make my first Ubuntu image for the D2G (Should work for d2) later today, when/if all goes well I will post it here.

Note: This will NOT install directly over your android install, this basically makes the phone to use your kernel with loop back fs essentially for ubuntu. So you can run a script and boot ubuntu inside your terminal in android.


----------



## Dark Cricket

Awesome, tnks aceoyame.

Enviado desde mi DROID2 GLOBAL usando Tapatalk


----------



## sixstringedmatt

This sounds awesome. Ace you're the man.


----------



## aceoyame

First I gotta find my Ubuntu live boot disc lol... it's around here somewhere. I'm out of DVD's. Won't be too hard to make really... It's more of a matter of if moto let's us run loop back fs's on our kernel.


----------



## x13thangelx

aceoyame said:


> It's more of a matter of if moto let's us run loop back fs's on our kernel.


Rev's had gentoo on his d2 so I cant see why it wouldnt..... Think that was with the froyo kernel but still...


----------



## aceoyame

This is gonna be released tomorrow. My disc is apparently gone lol.... I will go to the store tomorrow and reburn ubuntu. But at least we know from 13th it will work (I doubt moto would have removed that considering they just patched froyo's kernel from the looks of it)


----------



## kevcube

We can just use the n1 image from that blog. What we REALLY need is dual-booting like the galaxy tab, I hated all that vnc bs on my og droid.


----------



## aceoyame

Pushing this to the backburner for a bit. GSM with our D2G is really frustrating me since most of my MIUI users are over seas and they will need it so I am trying to get that working properly again.


----------



## swirly

When is this coming  ??


----------



## aceoyame

swirly said:


> When is this coming  ??


Probably next week. I'm giving up on 1%, I got what I could get for the developers who know more and the disassemblers. The rest is out of my league lol.


----------



## oz0ne

Looking forward to this!


----------



## dbrown

Cool project! Cant wait to see another custom setup. In the mean time if any body wants to use a different image from the internet, these phones require different setup than the nexus one script you find all over the place.

The main problem: loop devices are found in /dev/block instead of /dev

I dont really have time right now to put together some links and scripts but to get started...

1.) Go find an image to use ,download and extract it(as root) to your second partition. There are a few Ubuntu ones that I've seen. Personally I'm using an arch linux rootfs(the one labeled oxnas as opposed to omap. cant figure out why the omap one doesnt work, but hey.) found at www.archlinuxarm.org/os/ but we'll get to that in a minute. For the sake of writing this down we'll call it linux.img

I havent been able to get this to work as a .img on the sdcard and the only way I've found is to partition the sdcard. I know quite a few people are adverse to that idea but I haven't fount a way around it yet. If you do, just make sure back up everything on your sd first as everything will be lost when you partition and make it fat32 with no label, and the second one(for linux) is ext2 or ext3( 2 gigs should be plenty).

The rest is an the terminal:

2.) mkdir /data/linux
3.) mknod /dev/block/loop8 b 7 8
4.) losetup /dev/block/loop8 /dev/block/mmcblk0p2
5.) mount -t ext3 -o loop /dev/block/loop8 /data/linux <--- if that doesnt work try ext2 instead of ext3
6.) cd /data/linux
7.) mount -o bind /dev/ /data/linux/dev
8.) chroot . /bin/bash

now you're running linux. go ahead and mount proc and sysfs
9.) mount -t proc proc /proc
10.) mount -t sysfs sysfs /sys

That should do it. Now you can setup VNC and play around with it.

For arch linux a couple more steps are required. Mount the partition as above with no .img extracted to it.(up to step 6)

Then you need to download the rootfs onto the partition.
1.) wget http://archlinuxarm.org/os/ArchLinuxARM-oxnas-latest.tar.gz
2.) tar -xzvf ArchLinuxArm-oxnas-latest.tar.gz
3.) rm ArchLinuxArm-oxnas-latest.tar.gz
Now you can follow steps 7-10 but type 'source /etc/profile' in between steps 8 and 9.
So now you have arch linux on your phone. Type 'pacman -Syu' to upgrade everything

*NOTE* I didnt really figure any of this out. I just pieced it together from various sources online so a big thanks goes to archlinuxarm.org where most of the commands came from. And a big thanks to c1phers blog about getting gentoo to run on a droidx for being the only place online to explain about where the loopfs' can be found on these motorolas.

That's about it. Sorry for kinda hijacking the thread but since you said yu were putting your project on the backburner so i thought i'd get the info out since there seems to be some confusion out there about how to do this with our droids.

On that note, again cant wait to see your custom mobile version whenever you get time to put it out.


----------



## akilvan

Trying to install archlinux with dbrowns steps...
When I try to run "mke2fs -f alarm.img" it just tells me "invalid fragment size - alarm.img".
Any suggestions?


----------



## x13thangelx

tried with -F instead of -f? Caps does matter on alot of things unfortunately


----------



## akilvan

When I use a capital I get the following error:
mke2fs 1.41.10 (10-Feb-2009)
mke2fs: No such file or directory while trying to determine filesystem size


----------



## dbrown

oh sorry bro, i kinda copied and pasted some of the commands and forgot to change alarm.img to linux.img for the purposes of the writeup. and also make sure you have at least 750mb free on the sd


----------



## akilvan

Alrighty thanks for that. Now all of the commands run flawlessly until step 5. When I try with ext3 I get an "invalid argument error", and when I try ext2, I get a "No such device" error.


----------



## dbrown

Damn. Yeah i'm running into the same error...
I've got it working on a separate partition but it looks like its not recognizing an img on the sdcard as its own device.
I've gotta get up to go to work in a couple hours but I'll definately try to figure out a work-around tomorrow. Maybe this was one of the issues aceoyame ran into.
I guess ill have to flex my meager(if any...) amature dev muscule on this one.
:tongue3:
Anyways I'll keep you posted...


----------



## bikedude880

Are you guys trying to mount these img files as loopback devices? If not, do try 

P.s. I'm not familiar with this install.


----------



## aceoyame

It is as a loopback device, I havent had too much time to put into this. especially with my computer down for a bit and now developing on a turd of a computer


----------



## x13thangelx

aceoyame said:


> and now developing on a turd of a computer


take windows off it and it would be less of a turd =P


----------



## Blunderbuss

other than the geek-factor, what use is there putting ubuntu on the d2g? Maybe this has an obvious answer, but I don't see what functionality it will add...


----------



## dbrown

Well for me, I love having gcc and every intepreter out there so I can write and test code while away from home, which is most of the time. That pretty much all I use it for.


----------



## hgrimberg

Any news?


----------



## twistedumbrella

Realized I never brought this over from XDA, but I actually had a whole setup that allows choosing between loop and ext2 modes, with a special mode just for the Droid 2.

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

Might provide some help in how to get everything up and running and work as an alternative.



Blunderbuss said:


> other than the geek-factor, what use is there putting ubuntu on the d2g? Maybe this has an obvious answer, but I don't see what functionality it will add...


I use mine to do script beautifier, batch upload to dropbox, and run a lot of stuff just not available for Android yet. I even use Eclipse to fix apps when I can't get back to the computer and I need something ASAP.


----------



## aceoyame

I will have to look at that, this has been dead for awhile and if anyone wants to take over they can... I've been too busy with Life,MIUI and that MS2 rom (which is being a major pita)


----------



## twistedumbrella

aceoyame said:


> I will have to look at that, this has been dead for awhile and if anyone wants to take over they can... I've been too busy with Life,MIUI and that MS2 rom (which is being a major pita)


Well the link isn't a work in progress, it is a complete working project with all necessary components and additional instructions on how to customize or alter it. It was released as a stable, completed project a few months ago.

Edit: everything was documented, and you wouldn't have to fix what was already done before being able to change it. It is very generalized, though, so a device-specific install is usually a better option.

Sent from my ADR6400L using Tapatalk


----------



## aceoyame

Well you beat me to it then lol. I will update OP and give you credit then


----------



## twistedumbrella

aceoyame said:


> Well you beat me to it then lol. I will update OP and give you credit then


I just meant if you want to use it as a base it is there. the Droid 2 support is included, but not a focus. It would at least give you all the images, and a general layout for the run script and the install. The method used for the Droid 2 uses the internal "card" as a fake ext2 to prevent issues with loop devices and kernel compatibility. By stable, I meant that nothing needed to be updated for it to run in its current state. I didn't intend to prevent you from making one, just point out a lot of info and references are there to save a lot of work.

Sent from my ADR6400L using Tapatalk


----------



## JBirdVegas

Can't try this till mid next week but I just wanted to say thanks for all the effort y'all have put forth.

I'll let you know how it goes


----------



## bitojoe

Hey guys, i just created a new account on this site to ask about this thread, always have been impressed with the work you devs have done...

Anyways im very confused as how this works. I noticed that there is a link going to xda about unbuntu on android but are those the instructions i need to follow? Thanks for the help even though this is a developer thread


----------



## juv3

aceoyame said:


> I am going to make my first Ubuntu image for the D2G (Should work for d2) later today, when/if all goes well I will post it here.
> 
> Note: This will NOT install directly over your android install, this basically makes the phone to use your kernel with loop back fs essentially for ubuntu. So you can run a script and boot ubuntu inside your terminal in android.


so I can use backtrack/aircrack on it?

Sent from D2G Rocked by ApeX RC4 using TapaTaLk


----------



## bikedude880

juv3 said:


> so I can use backtrack/aircrack on it?
> 
> Sent from D2G Rocked by ApeX RC4 using TapaTaLk


If backtrack has an arm port. Aircrack can if the card supports monitor (?) Mode.


----------

