yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Android Development] lukss12:
Yep that "never seen before menu" is EFIDroid hehe, so your primary ROM is booting ok, please share what ROM you are using. And remember to enable Force SELinux permissive when booting a secondary ROM to prevent a SELinux denial bootloop, then you can try with the option disabled. But if the LineageOS kernel, that is the most "normal" kernel I know, couldn't do it I don't think any other could boot with SELinux enforced as secondary ROM. Anyways logcat and dmesg from a bootloop are useful and welcome.
[Nexus 5 Android Development] lukss12:
[MENTION=4330004]AndresOrue[/MENTION] I forgot that you can delete a secondary ROM from EFIDroid Manager app just by long pressing the entry in Operating Systems menu :)

Thanks for the testing and the logs are correct the SELinux denials are there ****ing it up...
[Nexus 5 Android Development] willyinpr4u:
For now the internal ROM is set to permissive. I saw the EFIDroid menu where I can set it to permissive, but since I haven't download the secondary, not sure if that's the one to select for secondary ROM. Here is a screenshot of my current ROM, it's Lineage OS DarkRom by Dark_Eyes.
[Nexus 5 Android Development] alessio89g:
For me, it works fine; my configuration is:

AlmostVanillaAOSP Marshmallow as primary

and

AOSP Nougat (it works only with SElinux set as Permessive, or you get an endless BootAnimation).

In both ROMs I flashed franco.Kernel r105, because I've /data and /cache in f2fs.

A little flaw is that in TWRP you can't see what the zips "say".

Two questions:

There is any way to boot my primary ROM with it's default SELinux mode?

And

If I wipe dalvik, data and cache, will I wipe there only for its ROM?
[Nexus 5 Android Development] lukss12:
Please explain this better, because I'm not having any problem in TWRP

Well by now the only way is to disable the Force SELinux permissive option before starting it - The primary ROM should ever work with this option disabled

Well to start TWRP you need to get into EFIDroid, select TWRP and then select the slot/ROM you want to modify with TWRP. Done that TWRP will affect only that ROM - Also as /sdcard is shared among ROMs when booting TWRP for a SECONDARY ROM the wipe /data/media will do nothing - Any other behavior is a BIG and FAT BUG, but by now no one have trouble with that
[Nexus 5 Android Development] alessio89g:
Before I installed EFIDroid, in TWRP when I flashed SuperSU, I got a sort of log of what the zip did (e.g. if it use systemless mode or not).

After I Installed EFIDroid i don't more get this log (I tested only in secondary, I don't know if in primary I've the same situation).

Same things with Open GApps pico zip.
[Nexus 5 Android Development] lukss12:
Oh you mean the log.txt file stored on the /sdcard , well because /sdcard get mocked for protection... when the flash script tries to write something to it, it gets "redirected" to the mock location. So I think you have two options:

1- With a root browser:

-Go to /sdcard/multiboot/the_rom_where_you_flashed_the_script/data

-Your logs will probably be there or in /sdcard/multiboot/the_rom_where_you_flashed_the_script/data/media/0

2-After flashing in TWRP use TWRP file explorer, go to /sdcard (this is the mocked sdcard) copy your logs to /multiboot/data/media/0 (the real sdcard)
[Nexus 5 Android Development] alessio89g:
No, I probably expressed myself badly. I don't mean a log file, but a log in the screen where there are all performed operations (e.g. wipe, format, flash, etc ...). Here I get only a sort of partial log (the beginning of installation and if the operation ends properly).

For example, without EFIDroid, when I flashed pico OpenGapps, I got in this screen an ASCII ART; with EFIDroid not.

The TWRP screen that I mean is accessible tapping in the three lines icon (usually the last) in the NavBar.
[Nexus 5 Android Development] lukss12:
Oh, I'm going to test it later...please if you can test what happens on primary rom
[Nexus 5 Android Development] willyinpr4u:
OK, I tried to boot into recovery following the instructions to no avail. I tried to use fastboot first on my Mac but it didn't recognize the device unless I cd first to platform-tools. So I moved to my Ubuntu PC which I already had the tools installed, just updated to make sure I had the latest version. I tried to fastboot first into the new slot, which is still empty, no luck. Then I decided to flash TWRP using the instructions in the OP with Ubuntu, it does recognize my device, but the device still display "waiting for commands", and no advance is display in the terminal.

I did mention that I am using Lineage OS caf version, I figure that has nothing to do with the issues I'm having right now, because the main OS is booting fine. EFIDroid was set to permissive as stated in the OP.

OK, how can I get you a log?
[Nexus 5 Android Development] alessio89g:
I'm sorry, but for now I've nothing to flash in primary slot, so I can't test it.
[Nexus 5 Android Development] lukss12:
Wich exacy version are you using? And what's exactly happenning when booting it from EFIDroid?

Fastboot inside EFIDroid is not meant to be used with slots

That's weird, if you are using the fastboot mode (Volume Down + Power Off) that's the original LG's fastboot and EFIDroid does not touch it in any way.

Can you boot TWRP from EFIDroid for your Internal ROM?
[Nexus 5 Android Development] willyinpr4u:
Recovery is (should be) TWRP 3.1.0.0.

Original Fatboot should work, I was using the one in the EFIDroid, scroll down to Fastboot, choose primary ROM, device prompt me to connect cable to PC, then it display waiting for commands. Type the commands in the terminal, but that's it, nothing else happens.

I can not boot into recovery for my internal rom either.

Should I flash TWRP again using my phone's bootloader?

I have a feeling that I'm doing something wrong, because I can access /multiboot with a root file explorer.

Sorry for the headache my friend.
[Nexus 5 Android Development] lukss12:
It's weird that your TWRP isn't working.

It's fine that you can access /multiboot with a root file explorer.

If you want to revert stock flash twrp from your phone's bootloader and flash your current installed boot.img too (fastboot flash boot boot.img). Then you can delete /sdcard/UEFIESP and /sdcard/multiboot and try to install EFIDroid again.

What does EFIDroid show when you try to boot TWRP? It get stuck? The phone reboots? what happens?
[Nexus 5 Android Development] AndresOrue:
To revert back to stock twrp you need to use normal fastboot mode ( vol down + power) then flash boot.img and twrp, maybe you need to do it two time, for me the first time didn't work..

When you back to stock boot.img you will lose root and others mods, Just as a reminder

After that, root again and install EFIDroid and should work
[Nexus 5 Android Development] willyinpr4u:
I could use the phone's Fastboot, but the rom that I'm using is compressed in a zip file, I would have to check if the image is within after decompressing, and also re-flash twrp.

Regarding what is display when trying to boot twrp, something like previous boot fail and then a square with the word OK. Let me see if the pictures can be uploaded, I'm using an iCrap to take the pictures and it crash like crazy.

EDIT: I could upload just one.
[Nexus 5 Android Development] lukss12:
The boot.img is inside your ROM.zip, and for recovery download twrp.img from official twrp site. I'm going to take a look about the message you got when booting twrp, please if you have your twrp image saved in your pc and can upload it for me to test on my phone would be great.

Hahahahahahah "iCrap" :D
[Nexus 5 Android Development] AndresOrue:
Yes mine too, i used DU rom to test and i used the boot.img inside the zip too.
[Nexus 5 Android Development] AndroZeek:
great work op
[Nexus 5 Android Development] sa4ni:
Do Primary ROM get Updated Normal way......?

I Mean Flash Full ROM zip from recovery (by wiping data+cache+dalvik).......?

I'm Preparing to Use AOSP 7.1.1 as Primary with Lineage 14.1 as secondary....
[Nexus 5 Android Development] willyinpr4u:
I downloaded (it was when I was done replying) another twrp 3.1.0.0 directly from my phone and used Flashfire to flash it. It flash with no error. So in theory, it should be installed, right? Reboot and same result. Can I share with you the one I downloaded from my phone? Or maybe I should just make a video of how I'm dealing with EFIDroid so that you can spot what I'm doing wrong.

This is off topic, and I'm sorry if I'm doing something wrong by asking this, but, are from Argentina? I just notice the Mar de Plata png. ( La foto).

Dude , a big thanks for having to deal with me.
[Nexus 5 Android Development] AndresOrue:
Yes but don't forget to select the correct rom slot
[Nexus 5 Android Development] lukss12:
No, this is not offtopic because it's about EFIDroid :). Well as I said in the OP the recovery used by EFIDroid is tje back up of your recovery at the time of installing EFIDroid and it's saved in /data/media/0/UEFIESP/partition_recovery.img.

So the only way to change the recovery used by EFIDroid is deleting that file and placing your new recovery there with that name (you need root explorer) (I know that this is hacky but remember EFIDroid is on beta, having multiple recoveries and modifying the stock one from EFIDroid Manager is something that is going to be implemented in the future).

So if you flash a recovery through your phone's fastboot this is not going to be used by EFIDroid.

Another option is to flash boot.img recovery.img (test that actually your recovery is working) and then reinstall UEFIDroid as [MENTION=4330004]AndresOrue[/MENTION] did when his ROM wasn't booting because of an incompatible kernel.

And yes I'm from Argentina :)

EDIT: I tested TWRP CAF version just to be sure and it works fine. So maybe your recovery backup is damaged for any strange reason or perhaps you updated TWRP lately and the download was damaged and you has not used it so far. I recommend you to return stock and start over:

for this flash your boot.img extracted from your ROM, flash your new downloaded twrp.img (to be sure it's fine you can check the md5 hash) -Flash them from the phone's fastboot mode not from EFIDroid's-

Reboot your phone (it should boot fine - you will loose any systemless addon you have installed)

Use a root browser to delete /data/media/0/UEFIESP

That's it, now you can try again
[Nexus 5 Android Development] alessio89g:
Some other questions:

It's the same also for format (or rm -rf) /data? Does it touch only the /data of its slot, without touching the real sdcard?

If I want to completely remove EFIDroid from my device, it would be enough tap the delete icon from the App?

Any news about the "issue" with the TWRP log screen?
[Nexus 5 Android Development] sa4ni:
Great Work......

Successfully Booted AOSP 7.1.1 as Primary and LineageOS 14.1 as Secondary......

and guess what every thing working fine ........ tnx.

just for info., Is It SELinux Permissive require for every ROM accepting Primary...?reason...?

by the way Tnx again great Work, :good:
[Nexus 5 Android Development] BreckZeBoulay:
First, a big thx to [MENTION=5361265]lukss12[/MENTION] to port EFI for our beloved Nexus 5 :good:

My initial configuration is MultiRom with UntouchedAOSP 6.0.1 (with EX kernel) as primary rom and StockOnlyDebloated 6.0.1 as secondary rom.

(Roms are here : https://xdaforums.com/google-nexus-5/development/rom-untouchedaosp-aug-17-2015-t3182377 )

What I've done :

- Backups of the 2 roms

- Delete secondary rom, uninstall MultiRom

- Reflash of UntouchedAOSP 6.0.1 to have a clean system and a clean boot (no wipe data)

- Install of classic TWRP then EFI (following the OP)

- First slot, installation of StockOnlyDebloated, stuck on bootanimation

- Second slot, installation of Lineage OS 7.1.1, all works fine

- Third slot, installation of UntouchedAOSP, all works fine but......

at the first reboot after the installation of UntouchedAOSP and after the Google logo, a toast notification appears saying "Update entry cache".

After that when I want to go in TWRP using EFI, I enter in a stock Android recovery, TWRP is gone.

The only way to access to TWRP is to use the bootloader.

So TWRP is always there but EFI "losts" the path to it (I guess).

And the most stange is where this stock recovery cames from ?

EDIT :

TWRP is back. I've done a repair using EFI Manager.

The only issue I have is the stock MM which doesn't want to finish the boot.
[Nexus 5 Android Development] willyinpr4u:
Just one, well, two words: THANK YOU!!!! I just needed​ a push in the right direction and you did it my friend. I followed your instructions to replace partition_recovery.img, used the last one I downloaded (decided not to use CAF this time since my ROM works with both variants), renamed TWRP to partition_recovery.img and it boots to TWRP on my internal ROM.

So you were right all along, the one I was using was corrupt, or modified somehow.

Thanks for sticking up with me. I think the explanation of fixing partition_recovery.img should be in the OP under troubleshooting, just my two cents.
[Nexus 5 Android Development] lukss12:
-Yes the mountpoints are mocked to use the corresponding slot (ONLY IF YOU START TWRP FROM EFIDROID)

The only way to modify /data/media/0 aka /sdcard from TWRP is booting it for your Internal ROM

-The delete icon flashes back your boot.img and recovery.img form the /data/media/0/UEFIESP, but it does not touch the slots, you can delete any OS by touching and holding in the name in the Operating Systems Menu.
[Nexus 5 Android Development] lukss12:
Because SELinux is complaining about the mountbindigs etc... It's a problem that the EFIDroid dev will try to solve. I'm getting involved in the project to see if I can help him in any way.

Right now he is working in a new UEFI port that don't resides in LK to make it easier to port to other devices and to debug.
[Nexus 5 Android Development] BIade:
Sorry for this total noobish question:

Could this be installed as a secondary in multiROM?

Like chainloading? So it boots the normal multiROM and one can choose to "chain"-boot efidroid?

Thank you very much

Blade
[Nexus 5 Android Development] lukss12:
It sounds like one of your ROMs flashed a recovery :confused: - but the only way to flash a recovery should be from a recovery started for the Internal ROM

So StockOnlyDebloated is bootlooping, can you get any kind of log? Or ADB was disabled when you backup your ROM? I think you're using the Force SELinux permissive option because you got LOS booting as secondary

I think that MultiROM requires a patch in the guest kernel to look for the atags and other memmory things, also EFIDroid is not a linux kernel. So I think trying to kexec'in EFIDroid would fail.

I think it's more reasonable to work the other way... EFIDroid booting a multirom kernel. I need to take a look to a multirom.zip to see what modifications it does.

EDIT: Well, I think that if you install Multirom to your Internal from UEFIDroid TWRP, and then boot the internal from EFIDroid it could work... I'm not going to test this... because I have little time to spend on this. But if anyone wants to test, I'll be glad to put their results in the OP
[Nexus 5 Android Development] BIade:
OMG, the OP himself answered me. Feeling honored.

On a hammerhead, multiROM doesn't need any kexec kernel for secondaries, Only for the primary.

I can boot all roms as 2ndary (including all nougats, without FCs on dev-options ;) )

But this project looks AMAZING!! (but i also love multiROM soo much xD)

If I can be of any help for, tell me. Will test anything for you and this great project!

Gratefully

Blade

Sidenote: I dont care about enforcing selinux ;) I can run anything with permissive...
[Nexus 5 Android Development] lukss12:
If you want to test my crazy ideas read again my answer and look for the "EDIT" :D hahaha, hopefully EFIDroid will support not android based ROMs at a time, but for now it's under development
[Nexus 5 Android Development] BIade:
LOOL, kill me for not reading that EDIT before .... Damn me... Thank you soo much, will test it soon :)

Okay wicked.

Downloaded your ota.zip, extracted boot.img, and fastboot boot boot.img it just to see it one time :)

Looks amazing :D

Now Im thinking if it would be possible, to create a flashable ZIP out of your boot.img and install it as secondary :D

Sadly im on holidays atm (first time in asia / india) but this internet is killing me.

Its like every 5 minutes i get 30s of internet xD

But im keeping on :)
[Nexus 5 Android Development] willyinpr4u:
I don't think TWRP Multirom is compatible with EFIDroid, just a hunch. [MENTION=268386]blade[/MENTION], I suggest you to give it a try, the UI is amazing, it does kind of look like Multirom thou. The one big difference, you don't need a Kexec patch in order to work. I tried Multirom and couldn't install it because of the kennel (Dark_Eyes Kernel ) but this one is working very nice.
[Nexus 5 Android Development] BIade:
1st of all: Thank you very much :)

multiROM only needs kexec on primary. (So all secondaries can be left untouched)

Also I like the possibility to manage all roms on recovery-level (like multiROM does).

As I understand it right, efidroid is only manageable through the app (which ofc needs a rom booted).

Could you enlighten me, what EFIDroid can, which multiROM doesnt?

(I need to convince myself to switch xD)

Also you know of a possiblity to make EFIDroid bootable, as a 2ndary in multiROM?

(since "fastboot boot efidroid.img" works im hoping for a workaround/bug/hack)

Gratefully

Blade
[Nexus 5 Android Development] BreckZeBoulay:
UntouchedAOSP and StockOnlyDebloated don't have recovery in their flashing zip

Internal rom is UntouchedAOSP (coming from a previous installation with MultiRom), but classical TWRP is flashed over MultiRom TWRP like asked in OP.

I went back to MultiRom, I need a functionnal phone. But I will provide logs when I will retest EFI in few days.

What for ADB ? Backup ? Don't understand what you ask.

Yes permissive was enable.
[Nexus 5 Android Development] lukss12:
The StockOnlyDebloated ROM was restored from a backup? Or did you do a clean install?

I was trying to say that if you had restored the ROM from a backup you may had ADB enabled and could provide logs from the bootloop.

Thanks for the testing.
[Nexus 5 Android Development] willyinpr4u:
I think you need to see it in action to understand it. It is hard to explain it. Yes, I agree that you need Kexec only in the primary ROM. With EFIDroid you don't any patch in the primary. Both do just about the same job, no denying that, but, as I posted before, since TWRP for Multirom is customize, I m just thinking that it won't boot into TWRP. Give it a try, it's a Nexus 5, if it bricks, it will come back to life, you know that. I have to admit it sounds interesting. Post results.
[Nexus 5 Android Development] BreckZeBoulay:
Clean install with flashing zip.

Installation with backup is possible ? I was thinking (wrong) that only installation with flashing zip was possible.

So I will make a backup with ADB enable.
[Nexus 5 Android Development] lukss12:
I will test the backup thing before making you loose your time, because installation with backup should work for internal, but I don't know how twrp will work when trying to restore a data.img to the data folder mounted in a secondary ROM. It may fail

EDIT: Restore worked for me, but as /sdcard gets mocked on TWRP for secondary ROMs there is some steps to follow

1-create a new slot

2-go to /data/media/0/multiboot/your_new_slot/data

3-create folder media/0/TWRP/BACKUPS

4- move/copy your backup to the created folder -remember the backup folder is the one that look like a hash (like "'03480ffg04395g234")

5-Boot TWRP from EFIDroid for the new slot

6-Format System

7-Flash your backup
[Nexus 5 Android Development] sa4ni:
MiUi8 also working in multiboot....

:good:

Where to find Screenshot taken from EFIDroid boot menu....?
[Nexus 5 Android Development] BreckZeBoulay:
And I stuck on Booting..... at first boot.
[Nexus 5 Android Development] lukss12:
Sorry I forgot to tell you that I downloaded the ROM, it's not booting for me neither, I could get last_kmsg and there is some problems when trying to init the modem.

Stuck at booting? Are you using custom kernel?

EDIT: this is why the ROM is bootlooping

[ 22.766608] smem_find(22, 40): wrong size 88

[ 22.767511] smem_find(22, 40): wrong size 88

[ 22.769911] Ramdump(ramdump_smem): No consumers. Aborting..

[ 22.770295] restart_notifier_cb: unable to dump smem -32

[ 22.771795] modem_notifier_cb: sysmon_send_event error -38

[ 22.772173] M-Notify: General: 4

[ 22.851923] pil-q6v5-mss fc880000.qcom,mss: mba: Brought out of reset

[ 22.852179] Ramdump(ramdump_modem): No consumers. Aborting..

[ 22.852450] Unable to dump modem fw memory (rc = -32).

It seems like something is messing up with the smem table and that prevents the modem firmware to be downloaded.

I'm talking with the EFIDroid dev about this but he's kind of busy and I'm not a C expert like him, so don't expect a short-term solution for that ROM :/ sorry
[Nexus 5 Android Development] lukss12:
Sometimes is necessary to disable drivers to test EFIDRoid in new devices, like the eMMC driver... so screenshots are stored in RAM, and you need to use "fastbootwrapper" an script from EFIDroids developer that adds some functionality like taking these screenshots from RAM.

If you are interested is pretty simple to get them:

1-Create efidroid folder wherever you want

2-Clone/Download this repo (https://github.com/efidroid/build) inside that folder

3-Open terminal, go to efidroid folder and issue:

"source build/envsetup.sh"

4-Now take all screenshots you want and in EFIDroid start Fastboot mode and connect to PC (Of course you need fastboot installed and in your PATH)

5-From the terminal you opened, you can get the screenshots with:

"fastbootwrapper oem screenshot [ID] [OUTPUT_FILE.png]"

ID starts at 0 and depends on how many screenshots you take.
[Nexus 5 Android Development] willyinpr4u:
[MENTION=5361265]lukss12[/MENTION]. I successfully installed Euclidean OS, which is base on Our Nexus, as secondary ROM. I think this ROM is AOSP.

Now I'm downloading Xenon, base on LOS.

Now, his do I go to delete a secondary ROM?

I saw it when I download the app, but I can't find it now. Thanks.
[Nexus 5 Android Development] lukss12:
From EFIDroid Manager, just long press over the slot you want to delete
[Nexus 5 Android Development] willyinpr4u:
Mmm, yes. In going to confess one thing but don't laugh. I was opening the wrong app instead of EFIDroid app. I was opening Magisk, no wonder I couldn't find where to delete the slot.

Anyway, I just tested Xenon HD AOSP as secondary, it boots fine, boot TWRP to Xenon ROM no problem.

So I guess you should have no problem booting any AOSP or CAF ROM as secondary or internal. Everything is working as it should so far.

Here is a screenshot for Xenon.
[Nexus 5 Android Development] martinchaine:
bootloop in Fake nexus rom. how i uninstall it? ps:macri gato
[Nexus 5 Android Development] lukss12:
Did you enable SELinux permissive option?

If you want to delete a slot just long press over the entry in efridroid manager app, if you want to delete efidroid completely:

fastboot flash boot boot.img (your main ROM boot.img)

fastboot flash recovery recovery.img (your twrp.img)

Delete /data/media/0/UEFIESP

Delete /data/media/0/multiboot
[Nexus 5 Android Development] martinchaine:
Yes I did it, but don't work with SuperSU, any fix?
[Nexus 5 Android Development] willyinpr4u:
Testing RR, fail to mount system. Have no idea if it's because of the ROM or that it's not compatible with EFIDroid.

I don't need this ROM, if just a feedback.
[Nexus 5 Android Development] lukss12:
Where are you getting that fail to moun system error?
[Nexus 5 Android Development] willyinpr4u:
It was a second slot I created and name it Resurrection Remix. Follow the steps, as I did with the first created slot, but at the end of flashing the TWRP have me an error fail to mount system.

But this was just for testing purpose, and I thought I should let you know.