[DEV] Dual Booting Project [Android - Ubuntu Phone OS] (HELP NEEDED)

Search This thread

beidl

Senior Member
Apr 30, 2009
467
217
Vienna
fredl.me
I didn't have time to play around with the proprietary blobs yet, but what I have tried so far on the go:

Completely reflashed Ubuntu Touch ontop of working CM 10.1 install WITHOUT WIPE -> No issues
Reflashed CM 10.1 and booted into it -> No issues, no files or settings gone
Reflashed Ubuntu Touch (quantal-preinstalled-armel+maguro.zip) -> No issues, no files or settings gone

So it is not a "real" dual-boot but it gets the job done.
That will continue to work as long as Canonical doesn't require us to completely wipe our devices.

Oh, and if we want to make Ubuntu Touch run flawlessly we should start contributing to the upstream project
instead of doing our own custom ROMs and not contributing back. That way everybody benefits.
 
Last edited:

urko95

Senior Member
May 7, 2010
375
196
I didn't have time to play around with the proprietary blobs yet, but what I have tried so far on the go:

Completely reflashed Ubuntu Touch ontop of working CM 10.1 install WITHOUT WIPE -> No issues
Reflashed CM 10.1 and booted into it -> No issues, no files or settings gone
Reflashed Ubuntu Touch (quantal-preinstalled-armel+maguro.zip) -> No issues, no files or settings gone

So it is not a "real" dual-boot but it gets the job done.
That will continue to work as long as Canonical doesn't require us to completely wipe our devices.

Oh, and if we want to make Ubuntu Touch run flawlessly we should start contributing to the upstream project
instead of doing our own custom ROMs and not contributing back. That way everybody benefits.

Great work beidl, I will post a guide in General giving you all credits.

Thank you

Enviado desde mi Galaxy Nexus usando Tapatalk 2
 

ak

Senior Member
Feb 19, 2011
14,848
69,619
Ak Land Valley
ak.hiddenbytes.org
Reporting semi-success
So i diffed the system directories of CM 10.1 and Ubuntu Touch and found the new files.


I pushed those files to my working CM 10.1 installation on the GNex.
Since I did not wipe my GNex when I went back from Ubuntu Touch to CM 10.1, the folder structure
of Ubuntu stayed at /data/ubuntu/.

Then, I rebooted into the bootloader and flashed the boot.img of Ubuntu Touch to the GNex.
After rebooting, the device was stuck at the Google boot logo but the kernel did actually boot, so I was able to adb shell into the device.
dmesg returned:

Code:
<6>[   15.739807] PVR_K:(Error): BridgedDispatchKM: Initialisation failed.  Driver unusable. [4783, /home/ubuntu/jenkins/workspace/phablet-image/kernel/samsung/tuna/drivers/gpu/pvr/bridged_pvr_bridge.c]
That means Canonical still uses the kernel from before a week, this kernel doesn't play nicely with the new proprietary GPU driver.
I'll try pushing the old GPU blobs now...

There is a source of ubuntu kernel?
 

sgt. meow

Senior Member
Dec 21, 2011
4,423
2,973
25
Dhaka
I am not from around here, but isn't it possible to just bind /system to system.img in any directory, and then boot it from there after the same has been done for /data and /cache?
 

MikeCriggs

Recognized Dev / Inactive Recognized Contributor
Dec 24, 2010
2,750
5,838
Catskills, NY
twitter.com
I am not from around here, but isn't it possible to just bind /system to system.img in any directory, and then boot it from there after the same has been done for /data and /cache?

It would be counter productive because you would need to uncompress the images to gain access to the partitions.

Sent from my Galaxy Nexus using Tapatalk 2
 

sp3dev

Senior Member
Jul 11, 2006
554
675
Kaluga/Moscow
Check out our u-boot port. It can be loaded instead of the linux kernel and chainloaded from the Samsung's SBL bootloader
https://github.com/Ksys-labs/uboot-tuna

You can edit the [include/configs/omap4_tuna] and comment the CONFIG_SPL_BUILD line and flash the u-boot.bin instead of the kernel.
Then, you can put the android boot.img to /system/boot/vmlinux.img
You can put the custom image in the u-boot mkimage or the android image format to /sdcard/boot/vmlinux.uimg and the boot script to /sdcard/boot/boot.scr.uimg, and you can boot that image by holding the volume down button.


----
And if you really wonder about the CONFIG_SPL_BUILD. Just stop reading here.


Yes, you can enable it and replace the Samsung's SBL with u-boot. Be careful. It only works with old xloader's (PRIMEKK14 and older). Display does not work, so you'll have to rebuild the kernel and disable omap framebuffer bootloader init check. If you brick the device, use "OMAPFlash_tuna.zip" to recover.
 

beidl

Senior Member
Apr 30, 2009
467
217
Vienna
fredl.me
AW: [DEV] Dual Booting Project [Android - Ubuntu Phone OS] (HELP NEEDED)

Awesome, didn't know somebody ported u-boot over to the GNex.
I'll take a look at it today, play around with it and maybe improve my C skills a bit.
(I can read C code pretty easily but I have not written anything in C in years).
Now multibooting has some real potential!

Sent from my Galaxy Nexus using xda premium
 
  • Like
Reactions: 5pace

sert00

Senior Member
May 28, 2011
1,091
496
cesena,IT
Check out our u-boot port. It can be loaded instead of the linux kernel and chainloaded from the Samsung's SBL bootloader
https://github.com/Ksys-labs/uboot-tuna

You can edit the [include/configs/omap4_tuna] and comment the CONFIG_SPL_BUILD line and flash the u-boot.bin instead of the kernel.
Then, you can put the android boot.img to /system/boot/vmlinux.img
You can put the custom image in the u-boot mkimage or the android image format to /sdcard/boot/vmlinux.uimg and the boot script to /sdcard/boot/boot.scr.uimg, and you can boot that image by holding the volume down button.


----
And if you really wonder about the CONFIG_SPL_BUILD. Just stop reading here.


Yes, you can enable it and replace the Samsung's SBL with u-boot. Be careful. It only works with old xloader's (PRIMEKK14 and older). Display does not work, so you'll have to rebuild the kernel and disable omap framebuffer bootloader init check. If you brick the device, use "OMAPFlash_tuna.zip" to recover.

interesting...i think it's the best way with uboot.definately follow this 3ad from now on..
 

ugothakd

Senior Member
Jun 12, 2011
1,491
409
O 'Fallon, MO
I think you're all going about this wrong.. kexec is definitely the way to go. Prepare your /system with both the android and ubuntu files. Then install a modified recovery.img to where you would install the normal boot.img. The recovery image would be modified with a menu to launch two commands, run ubuntu and run android. When run ubuntu is selected, kexec runs the ubuntu kernel, and vice versa. You wouldn't need to patch the android or ubuntu kernel only the recovery kernel.
 

dlhxr

Senior Member
May 26, 2011
562
511
New York City
OnePlus One
OnePlus 3
Since I just switched from Moto Defy to Galaxy Nexus, some new way to boot another rom is well developed in defy thread.
Firstly, some korean dev managed to develope the BOOTMENU for defy to allow custom rom to run and Defyers have had CM7\Miui\CM9\CM10 since then.
Secondly, someone found a way to unload current kernel and load another custom kernel to make CM10 faster, which means the android devices with locked bootloader can boot into custom kernel.
In my opinion, we can use that way for dual boot and it is not a very difficult task.
I tried to find some original thread for bootmenu and loading custom kernel (called 2ndboot) and listed here. Hope it is helpful.

1.Bootmenu
http://xdaforums.com/showthread.php?t=1026853 Original thread
http://xdaforums.com/showthread.php?t=1028427 Another one
2.2ndboot
http://xdaforums.com/showthread.php?p=32097547 Original thread
3.Roms now using Bootmenu
http://xdaforums.com/showthread.php?t=1033654 CM7
All defy's third-party roms are using this way to boot. (miui,etc...)
3.Roms now using both bootmenu and 2ndboot
http://xdaforums.com/showthread.php?t=1768702 CM10
http://xdaforums.com/showthread.php?t=1353003 CM9

Devs like Quarx (http://xdaforums.com/member.php?u=513620) and Epsylon3 (http://xdaforums.com/member.php?u=803131) know well about this method. You can contact them for help~:laugh:

Hope someone can make it ture!
 
  • Like
Reactions: savantist

franciscofranco

Recognized Developer
Dec 9, 2010
24,724
136,400
Carcavelos
Very good stuff here. This u-boot actually works in the GN? I have some experience with u-boot for the imx53 reference board. Using KEXEC like Tassadar does on the Nexus 7 and the old Optimus P500 works pretty well. Did anyone here tried something similar? Might involve some hacks though.
 
  • Like
Reactions: seriousia

beidl

Senior Member
Apr 30, 2009
467
217
Vienna
fredl.me
Very good stuff here. This u-boot actually works in the GN? I have some experience with u-boot for the imx53 reference board. Using KEXEC like Tassadar does on the Nexus 7 and the old Optimus P500 works pretty well. Did anyone here tried something similar? Might involve some hacks though.

I've played with it a little bit and yes, it does work, but I needed the right toolchain (CodeSourcery 2010q1-188), else this little f*cker would throw nasty errors at runtime.
Much thanks to sp3dev for helping me out on this and releasing a usable U-Boot implementation!
The nice thing about this is that it works by just raw-flashing the uboot binary to the boot partition.

My idea of how multiboot and flashing ROMs should work includes:
* A custom recovery
* U-Boot flashed to the boot partition

When entering the recovery, you are presented with 2 options: Flash an Android ROM or flash Ubuntu (because I wanted to have a way to dualboot those instead of 2 Android ROMs)
Executing recovery commands from /cache should be done after selecting the respective mode, for example when updating CM from within its updater app.
1) Choosing Android as an option: Symlink ..../by-name/boot to /cache/boot1.img
2) Choosing Ubuntu as an option: Symlink ..../by-name/boot to /cache/boot2.img, ..../by-name/system to /cache/system2, ..../by-name/data to /data/data2

As those ..../by-name/* files are just basically symlinks to the right block device partitions anyway, it would work seamlessly with the current way of unpacking ROM files to the respective partitions.
Just formatting would have to be blocked/changed to a simple rm -rf in Ubuntu mode.
Also, when a kernel is being "flashed" (or moved to the right place thanks to the symlink), we would have to repackage it with the correct fstab for (probably bind?) mounting the right folders.

THEN you can choose whatever ROM you would want to flash and the files would get unpacked in the right places.

In U-Boot you can either wait a second or two to boot into your Android ROM or keep VolDown pressed to boot into Ubuntu.
Sadly, I just don't have enough time doing this project, as it's a pretty sophisticated project and very hacky (but still much prefered to special dual-boot-kernels+modifying zip files by hand).
This ROM mode setting idea can surely accomplished with easy flashable zip files which just set up the symlinks followed by a zip which repackages the Ubuntu kernel.
This however would be reeeaally cumbersome for mere mortals, so why not just do everything in recovery without any manual interaction whatsoever?
I hope someone might pick up this design choice so that this specific-dual-boot-kernel-madness finally takes an end.

EDIT: I've just noticed that dlhxr started a thread which basically covers the same basic principle of how this should work.
Is someone working on a custom recovery similar to the idea that I had?
 
Last edited:

MikeCriggs

Recognized Dev / Inactive Recognized Contributor
Dec 24, 2010
2,750
5,838
Catskills, NY
twitter.com
I've played with it a little bit and yes, it does work, but I needed the right toolchain (CodeSourcery 2010q1-188), else this little f*cker would throw nasty errors at runtime.
Much thanks to sp3dev for helping me out on this and releasing a usable U-Boot implementation!
The nice thing about this is that it works by just raw-flashing the uboot binary to the boot partition.

My idea of how multiboot and flashing ROMs should work includes:
* A custom recovery
* U-Boot flashed to the boot partition

When entering the recovery, you are presented with 2 options: Flash an Android ROM or flash Ubuntu (because I wanted to have a way to dualboot those instead of 2 Android ROMs)
Executing recovery commands from /cache should be done after selecting the respective mode, for example when updating CM from within its updater app.
1) Choosing Android as an option: Symlink ..../by-name/boot to /cache/boot1.img
2) Choosing Ubuntu as an option: Symlink ..../by-name/boot to /cache/boot2.img, ..../by-name/system to /cache/system2, ..../by-name/data to /data/data2

As those ..../by-name/* files are just basically symlinks to the right block device partitions anyway, it would work seamlessly with the current way of unpacking ROM files to the respective partitions.
Just formatting would have to be blocked/changed to a simple rm -rf in Ubuntu mode.
Also, when a kernel is being "flashed" (or moved to the right place thanks to the symlink), we would have to repackage it with the correct fstab for (probably bind?) mounting the right folders.

THEN you can choose whatever ROM you would want to flash and the files would get unpacked in the right places.

In U-Boot you can either wait a second or two to boot into your Android ROM or keep VolDown pressed to boot into Ubuntu.
Sadly, I just don't have enough time doing this project, as it's a pretty sophisticated project and very hacky (but still much prefered to special dual-boot-kernels+modifying zip files by hand).
This ROM mode setting idea can surely accomplished with easy flashable zip files which just set up the symlinks followed by a zip which repackages the Ubuntu kernel.
This however would be reeeaally cumbersome for mere mortals, so why not just do everything in recovery without any manual interaction whatsoever?
I hope someone might pick up this design choice so that this specific-dual-boot-kernel-madness finally takes an end.

EDIT: I've just noticed that dlhxr started a thread which basically covers the same basic principle of how this should work.
Is someone working on a custom recovery similar to the idea that I had?

That's awesome! Can anyone provide a link to dlhxr's thread?

Also a custom TWRP Recovery should be very easy to compile. I'd do it right now if my Google Music app on Ubuntu wasn't taking up all of my bandwidth for the next 9274937 hours, haha.

Sent from my Galaxy Nexus using Tapatalk 2
 

Vikram Menon

Senior Member
Jun 18, 2011
95
4
Bangalore
How to install Ubuntu Phone OS

NOTE: This files doesn't include the option to make a dual boot yet

-I'm not responable of any damage could have your GNex after flashing Ubuntu Phone OS this way-

Steps:
  1. Download files quantal-preinstalled-armel+maguro.zip (4,6 MB) and quantal-preinstalled-phablet-armhf.zip (481 MB), and copy them to your GNex.

    NOTE: You can use a modified file without all sample photos, videos and messages modified by me. Donwload it here: edited-quantal-preinstalled-phablet-armhf-v1.zip

  2. Make a Nandroid Backup (to be able to restore Android later)
  3. Make a Factory Reset
  4. Flash them in CWM or TWRP (1-.quantal-preinstalled-armel+maguro.zip and 2-.quantal-preinstalled-phablet-armhf.zip)
  5. Reboot (In a few seconds Ubuntu will boot up)
  6. If you want to restore Android, make a backup of Ubuntu first if you want to install Ubuntu again
*This guide was originally posted by eng.stk*

NOTE: Second file (quantal-preinstalled-phablet-armhf.zip) will take few minutes to flash so don't panic and relax until it's flashed but, if you use the file that it has been modified by me, it will be faster. This method doesn't wipe your internal storage (/sdcard)

This way you could have both system only restoring backups of both OS. It's a good to have both system while dual boot it's being developed.

When i click on the 4.6MB zip file, a .img file is getting downloaded. If i visit the site cdiubuntu, i can see a similar named file, but it is 48mb. What should i use?
 

dlhxr

Senior Member
May 26, 2011
562
511
New York City
OnePlus One
OnePlus 3

MikeCriggs

Recognized Dev / Inactive Recognized Contributor
Dec 24, 2010
2,750
5,838
Catskills, NY
twitter.com
haha. could you make such a recovery for us? my thread's link:http://xdaforums.com/showthread.php?t=2204705:cowboy:

I remember doing this with TWRP on the N7000 so I could dual-boot TouchWiz and AOSP+ ROMs.

I'll take a look at your source when I have time and see what I can do. I've been pretty busy doing theming for Ubuntu Touch. I'm more of a designer rather than a developer, even though I'm a computer programming major XD.

Sent from my Galaxy Nexus using Tapatalk 2
 
  • Like
Reactions: DanielSanchez

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Dual Booting Project
    Android OS - Ubuntu Phone OS


    As the title says, I think we can make posible dual booting Android and Ubuntu.

    1st post Experimental Methods, Useful Infromation and Help Needed
    2nd post News
    3rd post How to install Ubuntu Phone OS

    Experimental Methods

    1-. This method was originally posted by beidl

    The method that beidl suggested us is to make this steps:
    1. "Backup every Ubuntu Touch specific file that got installed to /system to the PC, like the chroot scripts and other stuff"
    2. "Flash CM back to the device"
    3. "Copy specific files back to /system"
    4. "By flashing either the boot.img of CM or Ubuntu Touch the desired system should boot up."

    NOTE: Nobody try it, be the first!​

    *Using these methods you could brick your GNex, the poster of each method and me aren't responsible of any damage on your GNex!*

    Useful Information

    Here is partition table:

    [...]

    Model: MMC VYL00M (sd/mmc)
    Disk /dev/block/mmcblk0: 15.8GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt

    Number Start End Size File system Name Flags
    1 131kB 262kB 131kB xloader
    2 524kB 4194kB 3670kB sbl
    3 4194kB 25.2MB 21.0MB ext4 efs
    4 25.2MB 33.6MB 8389kB param
    5 33.6MB 37.7MB 4194kB misc
    6 37.7MB 41.9MB 4194kB dgs
    7 41.9MB 50.3MB 8389kB boot
    8 50.3MB 62.8MB 12.5MB recovery
    13 62.8MB 62.9MB 65.5kB metadata
    9 62.9MB 79.7MB 16.8MB radio
    10 79.7MB 765MB 686MB ext4 system
    11 765MB 1218MB 453MB cache
    12 1218MB 15.8GB 14.5GB userdata

    [...]
    &
    lrwxrwxrwx root root 2012-07-01 01:03 boot -> /dev/block/mmcblk0p7
    lrwxrwxrwx root root 2012-07-01 01:03 cache -> /dev/block/mmcblk0p11
    lrwxrwxrwx root root 2012-07-01 01:03 dgs -> /dev/block/mmcblk0p6
    lrwxrwxrwx root root 2012-07-01 01:03 efs -> /dev/block/mmcblk0p3
    lrwxrwxrwx root root 2012-07-01 01:03 metadata -> /dev/block/mmcblk0p13
    lrwxrwxrwx root root 2012-07-01 01:03 misc -> /dev/block/mmcblk0p5
    lrwxrwxrwx root root 2012-07-01 01:03 param -> /dev/block/mmcblk0p4
    lrwxrwxrwx root root 2012-07-01 01:03 radio -> /dev/block/mmcblk0p9
    lrwxrwxrwx root root 2012-07-01 01:03 recovery -> /dev/block/mmcblk0p8
    lrwxrwxrwx root root 2012-07-01 01:03 sbl -> /dev/block/mmcblk0p2
    lrwxrwxrwx root root 2012-07-01 01:03 system -> /dev/block/mmcblk0p10
    lrwxrwxrwx root root 2012-07-01 01:03 userdata -> /dev/block/mmcblk0p12
    lrwxrwxrwx root root 2012-07-01 01:03 xloader -> /dev/block/mmcblk0p1
    Info about GRUB on ARM v7

    Help Needed

    I think we can modify partition table making more partitions and modifiying Ubuntu Phone OS kernel to boot in asigned partitions but I need help:

    • How much partition we have to add? (System, data..)
    • I think we have to edit bootloader + kernel, How to do it?
    • It will be posible?

    I don't know a lot about partition tables and editing bootloader & kernel but, I think I will be able to help.

    PD: If moderator or developers in this section think that it will be better to post this thread in general or in development, don't worry moving it.
    7
    I didn't have time to play around with the proprietary blobs yet, but what I have tried so far on the go:

    Completely reflashed Ubuntu Touch ontop of working CM 10.1 install WITHOUT WIPE -> No issues
    Reflashed CM 10.1 and booted into it -> No issues, no files or settings gone
    Reflashed Ubuntu Touch (quantal-preinstalled-armel+maguro.zip) -> No issues, no files or settings gone

    So it is not a "real" dual-boot but it gets the job done.
    That will continue to work as long as Canonical doesn't require us to completely wipe our devices.

    Oh, and if we want to make Ubuntu Touch run flawlessly we should start contributing to the upstream project
    instead of doing our own custom ROMs and not contributing back. That way everybody benefits.
    6
    Files & How to install Ubuntu Phone OS

    How to install Ubuntu Phone OS

    NOTE: This files doesn't include the option to make a dual boot yet

    -I'm not responable of any damage could have your GNex after flashing Ubuntu Phone OS this way-

    Steps:
    1. Download files quantal-preinstalled-armel+maguro.zip (4,6 MB) and quantal-preinstalled-phablet-armhf.zip (481 MB), and copy them to your GNex.

      NOTE: You can use a modified file without all sample photos, videos and messages modified by me. Donwload it here: edited-quantal-preinstalled-phablet-armhf-v1.zip

    2. Make a Nandroid Backup (to be able to restore Android later)
    3. Make a Factory Reset
    4. Flash them in CWM or TWRP (1-.quantal-preinstalled-armel+maguro.zip and 2-.quantal-preinstalled-phablet-armhf.zip)
    5. Reboot (In a few seconds Ubuntu will boot up)
    6. If you want to restore Android, make a backup of Ubuntu first if you want to install Ubuntu again
    *This guide was originally posted by eng.stk*

    NOTE: Second file (quantal-preinstalled-phablet-armhf.zip) will take few minutes to flash so don't panic and relax until it's flashed but, if you use the file that it has been modified by me, it will be faster. This method doesn't wipe your internal storage (/sdcard)

    This way you could have both system only restoring backups of both OS. It's a good to have both system while dual boot it's being developed.
    5
    Check out our u-boot port. It can be loaded instead of the linux kernel and chainloaded from the Samsung's SBL bootloader
    https://github.com/Ksys-labs/uboot-tuna

    You can edit the [include/configs/omap4_tuna] and comment the CONFIG_SPL_BUILD line and flash the u-boot.bin instead of the kernel.
    Then, you can put the android boot.img to /system/boot/vmlinux.img
    You can put the custom image in the u-boot mkimage or the android image format to /sdcard/boot/vmlinux.uimg and the boot script to /sdcard/boot/boot.scr.uimg, and you can boot that image by holding the volume down button.


    ----
    And if you really wonder about the CONFIG_SPL_BUILD. Just stop reading here.


    Yes, you can enable it and replace the Samsung's SBL with u-boot. Be careful. It only works with old xloader's (PRIMEKK14 and older). Display does not work, so you'll have to rebuild the kernel and disable omap framebuffer bootloader init check. If you brick the device, use "OMAPFlash_tuna.zip" to recover.
    3
    News

    News

    22/02/2013:Thanks to beidl, I think we have the posibility to boot CM 10.1 and Ubuntu Phone OS. Take a look at the 10th post:

    There is a script + binary in the Ubuntu package which basically set up the the Ubuntu environment inside of a working Android installation.
    The Ubuntu folder structure can be found in /data/ubuntu/.
    Booting up is just like on every Android ROM, except the mentioned script gets started and the Ubuntu environment is getting started up.

    The first proof of concept would be:
    Backup every Ubuntu Touch specific file that got installed to /system to the PC, like the chroot scripts and other stuff
    Flash CM back to the device
    Copy specific files back to /system
    By flashing either the boot.img of CM or Ubuntu Touch the desired system should boot up.

    23/02/2013: I'm working on a modified version, now fisrtly I will delet all videos & images that came as a sample. EDIT: I have edited it, to download it, go to the 3rd post!