Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,262 Members 50,596 Now Online
XDA Developers Android and Mobile Development Forum

[DEV] Booting Ubuntu nativ!!!

Tip us?
 
bergfex
Old
(Last edited by bergfex; 14th July 2011 at 04:22 PM.)
#1  
Senior Member - OP
Thanks Meter 105
Posts: 206
Join Date: Sep 2010
Location: Hagenberg

 
DONATE TO ME
Default [DEV] Booting Ubuntu nativ!!!

This is about booting Ubuntu natively on the DHD. (without chroot and without an Andriod running at the same time)

Based on the version for the HTC HD2



What works:
  • touchscreen (touchscreen works as touchpad) (thanks to Jhinta)
  • two finger scrolling (thanks to Jhinta)
  • Wifi
  • dragging windows (double click and holding second click)
  • right click (double two finger click) (thanks to dronf)
  • adb (thanks to torsrex)
  • incoming calls (thanks to liljom)
  • SMS (thanks to liljom)

What doesn't work:
  • sound
  • keys (hard and soft keys)
  • usb host
  • firefox (only as root)

Instructions:
  • Download ubuntu4dhd.zip
  • Download easy to use.zip
  • Put the linux folder from ubuntu4dhd.zip to the root of your sdcard
  • Put the easy to use folder to your windows PC
  • Bring your DHD into the bootloader
  • Connect DHD to the PC
  • Double click Start here.bat
  • Tip "fastboot boot boot.img"
    (without ")
  • after restarting your old rom will start

Change log:
  • Working touchpad driver
  • two finger scrolling
  • Wifi working out of the box

Modifing the rootfs on your PC or virtualBox:
  • mkdir /ubuntuDHD
  • sudo mount -t ext2 -o loop /path/to/rootfs /ubuntuDHD
  • rootfs is now mounted under /ubuntuDHD and can be modifyed as root
  • umount /ubuntuDHD

Dual boot option:
  1. Download two different cwm from Rom manager
  2. Open the clockworkmod folder on you sdcard an open the download folder.
  3. Search for the version number for the old recovery. You will find an image file, open the containing folder and copy the boot.img from the Ubuntu4DHD.rar into it.
  4. Now, rename the boot.img file to the recovery image filename and deleted the old recovery.
  5. Now, when you select the old recovery from Rom manager, it will flash the ubuntu boot image.
  6. Booting into Recovery will now boot Ubuntu
When you want to go back to cwm, just select/flash the newer cwm version with Rom Manager.


Download:

Ubuntu4DHD.rar (reuploaded as rar)
MD5 of image: 79a9faa2d49725fb6bfdc30d4c5fb885

easy to use.zip


appendix:
  • easy to use.zip
    with:
  • My boot.img
  • boot-usbhost.img (boot image with usb host support)

Tips:
Password: ubuntu
The Following 41 Users Say Thank You to bergfex For This Useful Post: [ Click to Expand ]
 
bergfex
Old
(Last edited by bergfex; 23rd February 2012 at 05:10 PM.)
#2  
Senior Member - OP
Thanks Meter 105
Posts: 206
Join Date: Sep 2010
Location: Hagenberg

 
DONATE TO ME
For porting to other devices

Quote:
Originally Posted by Chaosz-X
Hi,

I saw you got native Ubuntu up and running on the Desire HD, and I wanted to do the same with my Flyer. I know how to compile kernels and an Android build etc., but I can't figure out how to set the partitions, that the boot.img boots from a partition on the SD-card. So I was wondering if you could tell me, what modifications are made to your boot.img to make it boot from SD.

Thanks in advance!
Changes on the boot.img:
I guess you know how to extract a boot.img.
http://android-dls.com/wiki/index.ph...ck_Boot_Images

When you try split_bootimg with my boot.img you will find two things.
1) a special command line arguments
2) a complet other ramdisk image containing
2a) a busybox
2b) a init script

The commad line arguments refer to the init script in the ramdisk.
The init script mounts some partitions including the ubuntu "partition" (in this case a image file on the sd card".
For mounting the partitions the init script calls a other script called MAKEDEVS also based in the ramdisk image.
In this second script you need to change the major and minor numbers of the block devices to match your kernel/device.


Placing the ubuntu image on the sd card:

I use a image file on the sd card.
You could use following commands on a linux machine to edit the image.

mkdir /mnt/ubuntuimg
sudo mount -t ext2 -o loop,rw /pathToTheImage/rootfs.ext2 /mnt/ubuntuimg
Then you will see the content of the image in /mnt/ubuntuimg.
Don't forget to unmount.
umount /mnt/ubuntuimg

Edits on the kernel:
In the kernel the framebuffer must be activated to run ubuntu

make menuconfig
Device Driver->Character Devices-> Set Virtual Terminal
Device Driver->Graphics support->Console display driver support->Remove VGA Text console

Maybe same patches for the framebuffer are needed to use the framebuffer.
Some information can be found under:

http://forum.xda-developers.com/show...ghlight=ubuntu
The Following 2 Users Say Thank You to bergfex For This Useful Post: [ Click to Expand ]
 
twiztedvvv
Old
(Last edited by twiztedvvv; 24th May 2011 at 04:17 PM.)
#3  
Senior Member
Thanks Meter 25
Posts: 252
Join Date: Mar 2010
getting this working would be awesome, better than a working honeycomb possibly .
 
shree.cse
Old
#4  
shree.cse's Avatar
Senior Member
Thanks Meter 1549
Posts: 2,841
Join Date: Apr 2010
Location: Bangalore
If this would be possible. DesireHD Can Dual boot. Thank-you

Sent from my Desire HD

Kernel: Stock
My thread: Repacked Kernels for InsertCoin Evolution
HTC HD2===>HTC DESIRE HD===>HTC ONE X===>HTC ONE 64GB
Hit on if my post helps you!
The Following User Says Thank You to shree.cse For This Useful Post: [ Click to Expand ]
 
raze599
Old
#5  
raze599's Avatar
Senior Member
Thanks Meter 94
Posts: 674
Join Date: Nov 2010
Location: Birmingham

 
DONATE TO ME
If this ever works, is it possible to modify the normal Android system to allow a virtual environment within which you can run Ubuntu? That way you can have the benefits of both.
 
bergfex
Old
#6  
Senior Member - OP
Thanks Meter 105
Posts: 206
Join Date: Sep 2010
Location: Hagenberg

 
DONATE TO ME
I think, I must not start my init script directly. Instead I shloud start it from within the init.rc.

But how?
The Following User Says Thank You to bergfex For This Useful Post: [ Click to Expand ]
 
twiztedvvv
Old
#7  
Senior Member
Thanks Meter 25
Posts: 252
Join Date: Mar 2010
Quote:
Originally Posted by raze599 View Post
If this ever works, is it possible to modify the normal Android system to allow a virtual environment within which you can run Ubuntu? That way you can have the benefits of both.
See leedroids post on booting ubuntu through Android. A bit closer to what your looking for and working although a bit of experience would be needed.
But like another said. Dual boot Android and ubuntu should be possible if we can get this to boot.
 
Columbia
Old
#8  
Junior Member
Thanks Meter 1
Posts: 6
Join Date: Mar 2009
Man if you do it, it will be exciting! Even better than working sense 3.0 Good luck!
 
Jhinta
Old
#9  
Jhinta's Avatar
Senior Member
Thanks Meter 255
Posts: 620
Join Date: Dec 2010

 
DONATE TO ME
Quote:
Originally Posted by twiztedvvv View Post
See leedroids post on booting ubuntu through Android. A bit closer to what your looking for and working although a bit of experience would be needed.
But like another said. Dual boot Android and ubuntu should be possible if we can get this to boot.
Keep in mind this is native and not chroot !!!
 
adwinp
Old
#10  
adwinp's Avatar
Senior Member
Thanks Meter 136
Posts: 1,676
Join Date: Jun 2008
Location: urandom
1: Use the android init. It directly references init.rc
2: move your init script into init.rc
3: you have failed booting due to the system not knowing the executable paths;
you HAVE to export your paths. Either reference your binaries directly, for example:
/bin/mount, /bin/dosfsck
or
export PATH /bin:/sbin:/usr/bin:/usr/sbin
Furthermore, you need to diet your boot.img; 5Mb is not flashable on the DHD unless you move and resize the partition tables (risky). The stock max is 4Mb.

You can also force the kernel to execute the init script by referencing it in the kernel cmdline. Check this option in your kernel config and compile it with such support.

The Following 2 Users Say Thank You to adwinp For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes