Gain more real users and user experience by supporting multi boot like EFIdroid with Android
-
@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)
=>sameThen 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 caseAnd 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 imageIn 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 EFIDroidI personally tested EFIDroid with TWRP and TWRP CAF in their 3.1.0.0 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.
-
Today in Youtube suggestions I say this "pre-UBports" video, showing an elegant dual-boot app on a Nexus device. Installation instuctions can still be found but as the repo was last updated in 2014 I seriously doubt this can help us somehow...
-
@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? -
@jjurgen well to be honest I don't know if UBPort team changed anything but for UT sturmflut did a great job to figure everything out in his blog: Part 2 and Part 3
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). -
@jjurgen as Lukss12 is the one who provides the only working version for hammerhead we should contact him/her first
-
@elastic Will make an account on XDA forums tomorrow and kindly request Lukss12 to consider supporting UBports recovery in EFIDroid. He/she will probably wait until M11kkaa has completely rewritten the project. Shall we do this together? In the Netherlands we say 'two people know more than one'.
-
@jjurgen yes absolutely - and they can achieve even more
... I’m working tomorrow till 3 pm then I’ll be on the road for 430km in the Friday evening chaos between Cologne and Nuremberg so I won’t be able to respond before Saturday ...
cheers -
@elastic Did some experimenting on my Nexus 4. Installed UPports and then flashed TWRP as a new recovery. All functions well so TWRP and UBports go wel together once UBports is installed. But to install UBports and to update it UBports recovery is absolutely necessary. So if in EFIDroid UBports won't boot as you tried various times my guess its because of the boot.img. The question is not only to get support for UBports recovery in EFIDroid but also to for its boot.img. Did not have time to make an account on XDA forum. Needed to clean my laptop (Samsung N510 running Xubuntu 16.04) too. Restored a Clonezilla image from a month ago and updated the system. Now I have the NVIDEA driver and configuration back and plenty of free disk space. Tomorrow will be a busy day so it will be no sooner than after dinner to make an account on XDa forum.
You are driving a lot of kilometers for your work! I'm hoping for you that there are not to many traffic jams.
cheers to you too.