Gain more real users and user experience by supporting multi boot like EFIdroid with Android

  • When I switched to ubuntu in 2007, multiboot with my windows encouraged me a lot. After some weeks merging to ubuntu was done. Since then ubuntu (starting with 07.04) it is my daily desktop OS.

    Now I feel a similar situation and I think I am not the only one. For me personally it is currently very hard to use ubuntu as daily OS on my FP2 because this is my business phone and I am on the road regularly.
    But I would like to run ubuntu as often as possible, so if e.g. EFIdroid would work as multiboot system, one could switch to ubuntu as often as possible and gaining day to day user experience.

    There has already been some thoughts on that in the Fairphone community maybe we can follow up on this discussion here.

  • Hi Bastos,
    Dual / Multibooting also made me a linux user in the end. I also think it could gain more smart phone users to try UBports. There's already a Beta EFIDroid for Nexus 5 hammerhead:
    In the FAQ on the site of UBPorts is mentioned that multibooting may change with Halium project, but that’s not carved in stone yet and they won’t make any promises.
    Good to know that the Fairphone community is having their thoughts on this. Is it correct that you are already experimenting on this? It looks very promising.
    So I do hope some day the UBports community will also come to a point of thinking of multibooting someway.

  • But that thread in the Fairphone forum was now automatically closed after half a year of inactivity 😉

  • That is right. I tried a little bit half a year ago.
    For my fp2 no dual boot option is available, so I decided to have Ubuntu touch as my daily driver. Never really regret this decision since 7 month.

    But anyway a dual boot option is highly appreciated IMO.

  • Is there anyone actually using EFIdroid as a multiboot environment on the Nexus 5 with UBports as second OS?
    I'm tempted to give it a try but if anyone else already has any experience I would highly appreciate any hints 😉

  • afaik only multiboot is working atm. And only for few devices.

  • @elastic Same here. I own a Nexus 5 too as a daily driver looking for the right moment to give the Beta EFIdroid a try (to many ideas, to much to do and a lack of energy). If I can find the time I will post the results here,

  • @Bastos and @Ingo. Looking for more information of EFIdroid it made me glad to find this page where m11kkaa mentions (17 december 2017) he is completely rewriting the project. So the project is still going and hopefully this leads to new and more ports.

  • @jjurgen I installed EFIDroid on Lineage on the Nexus 5 - works flawlessly with custom roms on Android base - as there is no downloadable image for UBPorts - why actually? - I made a twrp backup from my lineage system and am going to install ubports through MDT (last time it failed to install OTA3 - seemed the pull server was still on OTA2 so I flashed back to Lineage immediately) make a twrp backup and then flashing back to Lineage and will try to get the ubports backup running with EFIDroid - at least that’s the plan. As my shower drain pump stopped working today I might fix that first 😉 so don’t await a report too soon 😉

  • @elastic So you already experimenting! That's great. Thank you for your reporting your results sofar! Take it easy. To be able to shower without floding your bathroom is more important.

  • @elastic Installed Beta EFIDroid on lineage on Nexus 5 to and indeed it installs flawlessly. Added a new slot in the EFIDroid Manager app for UBports. Next step is to intall a custom rom by rebooting and when EFIDroid comes up select TWRP, then select the newly created slot.
    Go to the "Wipe > Advanced Wipe" menu. Select "System", then swipe to wipe.
    Finally you can install all the zips you want on that slot. TWRP needs install zipfiles.
    The UBports server does not provide these zip files. That's were the process stalls.
    Maybe there is a way to manually create this install zip file for UBPorts?
    Any leads are appreciated. I'm no programmer or developer. Just trying by guessing and trail and error.

  • @jjurgen I tried a few things today but so far without success ..
    Installed UBPorts, flashed TWRP, created a backup of UBPorts, flashed Lineage with TWRP, installed EFIDroid, created a slot for UBPorts, made a recovery from the UBPorts backup with TWRP (as in the howto for Multirom migration) - reboot .... EFIDroid showed Lineage and UBPorts as options but it failed to boot UBPorts, Lineage is still booting fine though ...
    I might have missed something - will try it again - but not today 😉

  • @elastic Is your drainage pump working again?
    That's a clever attempt and thanks for posting. My wild guess is that the process could work in a situation where you have UBports installed as a second OS in Multirom. A few months ago I found a Multirom version for the Nexus 4 mako that can do this:
    It works pretty well but uses an old recovery and there is no maintenance so i dropped it. I couldn't find a similar Multirom version for Nexus 5 hammerhead. Maybe other readers may know if it exists and where to find it.
    Just to see if we can get UBports working in EFIDroid.
    I'm looking into the UBport tar-files trying to get a view and understanding how the flow of the proces of installing UBport might be.
    Updated LineageOS to latest version today. All went well. Had to reinstall Supersu (of course, duhh).

  • @jjurgen ordered a new one - should be here tomorrow...
    I tried my approach again with different settings but still no success... It worked with two other twrp backups (lineage and a custom rom) which both are booting as second rom without any problems - so it is possible to get a multiboot with EFIdroid by creating new slots and do a twrp recovery in this slots, but I can't boot to UBports - it always loops back to EFIdroid bootloader 😞

  • @elastic Well that's a pity UBports won't boot while other custom roms do. There must be something we are overlooking here.
    I tried replacing TWRP recovery with UBports recovery. First on my Nexus 4 mako with only LineageOS installed. No problems. LineageOS boots and UBports recovery shows up nicely after booting into recovery. I thought this could be a step forward.
    So replaced TWRP recovery on my Nexus 5 with UBports recovery from Version 3 and started LineageOS and EFIDroid. Chose install/update in the menu of EFIDroid. It showed a big Repair button. Tapped it and it reported that the recovery only has an ESP backup. Repair completed and then i tried to reboot into recovery. That gave an error: 'Previous boot failed' and another error: 'init returned'. Played around a bit in EFI bootloader but it keeps loping back to EFIdroid bootloader just as in your method.
    Reinstalled TWRP and I'm back to where started.
    Maybe I have to try this from a clean install (without replacing TWRP) and also as a comparison trying to multiboot Canonicals Ubuntu Touch.
    My guess is that UBports needs its own recovery and there is something special with the boot process.

  • @jjurgen well as far as I understand EFIDroid doesn't touch the base system but as a 'second bootloader' it links every slot to its own recovery (thats why you have to choose a system when you opt recovery in the bootloader) - so the target should be how to get the UBPorts recovery in the UBPorts slot instead of twrp while leaving twrp for the base system - seems we have to dig deeper in how EFIDroid works ...
    not sure if I'll find time for that before the next weekend ...

  • @elastic Thank you for your explanation. I think I'm beginning to understand this but still find it a bit confusing.
    Reflashed UBports recovery on my Nexus 5 and rebooted from power down directly in boot loader and into recovery. Ubports recovery show up apparently fully functional. Then I choose 'reboot system'. Now EFIDroid bootloader shows up and I can select TWRP recovery. Selected it an pushed power button to confirm. TWRP starts apparently fully functional. So now I'm having two recoveries and just one OS (LineageOS).
    This I find confusing. Didn't expect this to happen. Does this mean that in this case UBports recovery is in 1st stage boot loader and TWRP in second stage boot loader (EFIDroid)?
    I don't think this is of additional value to get UPports working in EFIdroid but just worth mentioning.

  • @jjurgen sounds like that - what EFIDroid does is:
    (all text in italic quoted from XDA)

    -EFIDroid Manager backups your boot.img and recovery.img in /data/media/0/UEFIESP folder
    =>so if you flash another recovery over EFIDroid it can't be found - you'll have to replace the recovery in UEFIESP folder

    -EFIDroid Manager flash EFIDroid in your boot and your recovery partitions (the recovery is flashed to prevent you using your recovery without booting it from EFIDroid)

    Then the next time you boot the stock bootloader aka aboot loads UEFIDroid that is flashed in your boot partition, LK kernel boots and execute UEFI. Then the UEFI looks for the original boot.img (for booting your actual ROM aka Internal) and looks for your actual recovery.img, remember both were saved into /data/media/0/UEFIESP.
    => that means LineageOS in our case

    And finally it looks for slots/ROMs in /data/media/0/multiboot (of course these are the slots for multibooting a lot of ROMs).
    A slot for a ROM is composed by a data folder, a system.img(1GB) and a boot.img (these are the ones used/mounted to boot the ROM you select in multiboot menu)

    => I think the problem might be about that boot image

    In the last step it shows you the Menu to select what you want to boot and it applies the propers patchs to ramdisk to use the correct data folder and system.img, then boot the correct boot.img using libboot (the usually used by android bootloaders)
    => and exactly that doesn't happen, it just loops you back to EFIDroid

    I personally tested EFIDroid with TWRP and TWRP CAF in their versions and they worked great.
    As I stated before, your current recovery is backed up to /data/media/0/partition_recovery.img so if you somehow ended having trouble to boot your recovery, you can boot to your main OS and replace /data/media/0/partition_recovery.img with another recovery (ofc change the name of the new recovery to partition_recovery.img) - YOU NEED A ROOT BROWSER -

    => that might be a hint - while I got UBPorts booting and was able to make a backup when I flashed TWRP over the UBPorts recovery it might be worth trying it the other way round, but don't flash it just replace the file like mentioned by lukss12 - though I'm still thinking the bootloader is the problem ...

    So time to sleep now - have to drive from Bristol to Cologne tomorrow ... work sucks 😉

  • Hello ! That is a good experimentation, and having a working multi-boot can be a great added value 🙂

    From the Fairphone forum, it seems that the order of installation could be crucial! Quoting @z3untu :

    It 100% doesn’t work as a second rom right now. It could maybe work, if you install EFIDroid (from Android), create a second rom (from Android), flash Ubuntu Touch (via recovery/fastboot), put the boot.img from Ubuntu Touch into the correct location (don’t know where right now), flash the boot.img from EFIDroid and then theoretically it could maybe work.

    Ubuntu Touch as a secondary rom isn’t supported yet but I meant that it might work as the primary rom.

  • @oli-sax Thank you for this additional and crucial info. We will keep this in mind in our experiment.

Log in to reply