Gain more real users and user experience by supporting multi boot like EFIdroid with Android
@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: https://forum.xda-developers.com/showpost.php?p=72455220&postcount=2140
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 188.8.131.52 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.
@oli-sax well, as the pull server can be customised I won't say, that this can't help us - it's definitely worth to try it - thanks for bringing this up, I wasn't aware of this approach from the UT team... - maybe it's time to ask the UBports team for support - as it worked before they might be able to figure this out ways faster
@oli-sax @elastic I posted this before in category support link text, edited the dualboot script to get images from ubport instead of ubuntu and then sideloaded the ubport files. Release 13 of channel RC (not the latest release) got downloaded but no installation is started. I guess it lacks a installation script or binary. My other guess is that this feature is not fully implemented just as the option to customize the pull server.
I'm gonna try to sideload Canonicals ubuntu files and see it that leads to a install procedure.
I will post some more details of my experiments later.
@jjurgen missed that thread... Well if this path leads us to no solution there is only classic multirom (I'm no fan of this as it always needs fitting patched twrp for every device, multirom and depending on the device and/or OS kernel patches) or we put our hopes in xenial and anbox - at least for the core devices that should be a solution if it's gonna live. As I'm on a Nexus 5 I'm hoping for the very best... though my banking app refuses to work on my Jolla as it did on my BB as they were both considered as rooted from the app - not sure how anbox will behave... I'm a fan of dual boot as you get the choice - even my MacBook runs macos and Mint so I'm never left in the dark if I need another environment to work on...
@elastic Been very busy with other matters and had no time to experiment last days. I have cleaned my Nexus 4 of remnants of Multirom, Dualboot and EFIdroid to get a fresh start in experimenting with Canonicals Dualboot. It took me 2 evenings and had to flash stock rom twice. ADB devices didn't recognize it. Now that is done and have LineageOS running again.
I'm no fan of Multirom either. Its outdated and indeed to much of a hustle.
"maybe it's time to ask the UBports team for support" you wrote three days ago. This is always an option. I think it's good to have a concrete question of what our goal is (by example editing Canonicals Dualboot apk to alter the server url to UBports url) and what is not to extensive to answer. What do you think?
In my opinion we're not yet at a point of no solution.
@jjurgen I did it exactly vice versa - cleaned my Nexus 5 from all the stuff then first had a look at Xenial - smooth UI but not in a usable state for the Nexus 5 yet - and the flashed TWRP, with that flashed my UBPorts backup and after this flashed the UBPorts recovery to replace TWRP - so I'm on UBPorts now.
The main problem seems to be, that UBPorts doesn't work well with TWRP - I got it to boot once but it didn't shutdown after that - so it seems to need something special from the UBPorts recovery ... on the other side UBports recovery doesn't work (or at least I can't figure out how) for EFIDroid and Android - btw the boot.img and recovery.img for all devices are on cdimage.ubports.com if you need them ...
Let me think a few days about solutions - if you can boot two android roms you should be able to boot android and UBPorts - I might try EFIDroid with Sailfish next - if that works we might be a step closer ...
@elastic Installed Canonicals dualboot again and tried to install Ubuntu Touch by sideloading. Files are downloaded and pushed to the Nexus 4 in /sdcard/ubuntu_release. After that the Dualboot app pops up but no install activity. So a not fully implemented feature. I think the that the update_command file that is being generated is not executable. I'm gonna try to make it executable and see what happens.
There's something else that is on my mind regarding EFIdroid. I would like to know how to install UBports from recovery, just like one can install a custom rom from TWRP. In TWRP the install starts after unpacking the zip from META-INF/com/google/android/update-binary. I can't find this path in the UPports tar files.
If you know which file is the update_binary in UBports then it could be started from recovery with a self made script (pathname META-INF/com/google/android/update-binary and zipped) together with the tar files in the right directory of TWRP. If that doesn't work it will return error messages. Not what I like to see but these messages can help us.
The problem with TWRP is that it doesn't support tar.gz archives (look here and scroll down to second dot under Issues/Hacks), and zip zip doesn't support every attribute needed for the rootfs. That's a hint why UBports has its own recovery.
So that would mean flashing UBports recovery to the slot (EFIDroid) and then installing UBports. Does that make any sense?
as its possible to make recoverable backups of your UBPorts installation with TWRP by flashing it for the backup and the recovery (not handy but takes only seconds) and after recovering the backup just flashing back UBPorts recovery that seems much easier than finding a way to install UBPorts with EFIDroid already installed. I agree, we need a way to get UBPorts recovery to the slot ... but that won't work if EFIDroid doesn't recognize UBPorts recovery as it expects TWRP - maybe we should contact the dev of EFIDroid about that?
@elastic Indeed your method is easier. Lukss12 says on his page under Clarifications "EFIDroid properly patches TWRP ramdisk to affect the desire slot/ROM" so Lukss12 EFIDroid is only compatible with TWRP.
I've been playing around with EFIDroid on my Nexus 5 (had to flash stock rom and then install LineageOS to get a clean system - adb devices didn't list my device). Tried to install via option Fastboot in EFIDroid. According to Lukss12 page there should be only one entry, but there are two entries (CyanogenMod and UPport). So I thought maybe this way I can install UBports to its slot (being naïve), but this fastboot mode keeps waiting for a command and the terminal on my laptop keeps waiting for a device...
Then pushed the UBports recovery (renamed it to ubport_recovery.img) to /multiboot/data/media/0/ and then in EFIDroid activated the File Explorer and browsed to userdata/media/0/ and selected file ubport_recovery.img, pushed power button and UBports recovery starts and is functional. Could reboot, reboot into bootloader and power down. So that makes me think UBports recovery could work if EFIDroid properly patches UBports ramdisk to affect the desire slot/ROM. If UBports boot.img will work is still unknown.
Its worth a try to ask the dev of EFIDroid to consider support for UBports (if he/she isn't already doing so :)). That leaves the question do we ask this to Lukss12 (dev for hammerhead) or M11kkaa (dev EFIDroid).