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

Search This thread

urko95

Senior Member
May 7, 2010
375
196
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.
 
Last edited:

urko95

Senior Member
May 7, 2010
375
196
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!
 
Last edited:

urko95

Senior Member
May 7, 2010
375
196
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.
 
Last edited:

beidl

Senior Member
Apr 30, 2009
467
217
Vienna
fredl.me
It's a very bad idea to screw around with the bootloader and partition table.
kexec would be the way to go, but it requires kernel patches for both the Android ROM and the Ubuntu ROM.
Also, since Ubuntu Touch is just chrooted inside CM, I guess it would be possible to make some CM specific tricks,
like creating a file on the filesystem, check for it on bootup, if it exists, boot into the chrooted Ubuntu environment.
I still have to take a look at the source though, basically finding out at which stage the ways of Android and Ubuntu seperate.
 
Last edited:
  • Like
Reactions: urko95

urko95

Senior Member
May 7, 2010
375
196
It's a very bad idea to screw around with the bootloader and partition table.
kexec would be the way to go, but it requires kernel patches for both the Android ROM and the Ubuntu ROM.
Also, since Ubuntu Touch is just chrooted inside CM, I guess it would be possible to make some CM specific tricks,
like creating a file on the filesystem, check for it on bootup, if it exists, boot into the chrooted Ubuntu environment.
I still have to take a look at the source though, basically finding out at which stage the ways of Android and Ubuntu seperate.

Do you think we will be able to run Ubuntu and CM? My idea was to modify partition table to add more partition and then, if you wanna run Android OS, flash its kernel to boot it in Android OS or flash Ubuntu Phone OS kernel (edited to boot specific partions) to boot Ubuntu Phone OS. Do you really think that it's a bad idea? I think it is the best option (and it's the only I know). Could you give me more details of that "Specific tricks" to do with CM?

BTW, I NEED MORE HELP! :mad:
 

beidl

Senior Member
Apr 30, 2009
467
217
Vienna
fredl.me
Do you think we will be able to run Ubuntu and CM? My idea was to modify partition table to add more partition and then, if you wanna run Android OS, flash its kernel to boot it in Android OS or flash Ubuntu Phone OS kernel (edited to boot specific partions) to boot Ubuntu Phone OS. Do you really think that it's a bad idea? I think it is the best option (and it's the only I know). Could you give me more details of that "Specific tricks" to do with CM?

BTW, I NEED MORE HELP! :mad:

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.
 
  • Like
Reactions: urko95

urko95

Senior Member
May 7, 2010
375
196
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.

I will give it a try later!

Thanks for your help!
 

ak

Senior Member
Feb 19, 2011
14,848
69,619
Ak Land Valley
ak.hiddenbytes.org
In my opinion to have a dual booting you will need:
- A ramdisk that will prepare the partitions according to the choice of which OS
- A kernel that supports two versions of OS
- Two separate SD with the respective folders drivers etc. ... (This Is not possible on GNEX)

For the rest I do not know ubuntu for phone, it would take some expert.
 
  • Like
Reactions: urko95

urko95

Senior Member
May 7, 2010
375
196
In my opinion to have a dual booting you will need:
- A ramdisk that will prepare the partitions according to the choice of which OS
- A kernel that supports two versions of OS
- Two separate SD with the respective folders drivers etc. ... (This Is not possible on GNEX)

For the rest I do not know ubuntu for phone, it would take some expert.

Anarkia, What do you think about beidl's method?

NOTE: Thread organized and updated
 

LucaZPF

Senior Member
Oct 3, 2007
106
5
luca.sh
Excuse me,
can i flash these flies with CWM recovery?

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 (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.
 

beidl

Senior Member
Apr 30, 2009
467
217
Vienna
fredl.me
Reporting semi-success
So i diffed the system directories of CM 10.1 and Ubuntu Touch and found the new files.

/system/bin/modelid_cfg.sh
/system/bin/ubuntuappmanager
/system/bin/ubuntu_chroot
/system/bin/uchroot
/system/usr/idc/autopilot-finger.idc
/system/quantal-ubuntu_stamp
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...
 
  • Like
Reactions: 5pace

urko95

Senior Member
May 7, 2010
375
196
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...

Waiting to your results, great job beidl!
 

capychimp

Retired Recognized Developer
Sep 18, 2009
8,718
7,345
At home
Sv: [DEV] Dual Booting Project [Android - Ubuntu Phone OS] (HELP NEEDED)

First zip to flash is linked wrong it links to the IMG ;)
Ubuntu phone os is nice but laggy buggy power eating just tried it. Maybe we should focus on it running good before dual boot
Did anyone try using it ? Gsm and all that did not work on my gnex. Did you guys have luck?
Sent from my Galaxy Nexus using xda premium
 
Last edited:

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!