yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] m11kkaa:
First off, EFIDroid doesn't support any of UEFI's security protocols because it wouldn't make any sense(any root user could just replace uefi).

Then, to port UEFI to another platform you need a stock bootloader which has all the drivers needed.

If there is no opensource bootloader for your device you have to write all the drivers by yourself. You can either do that based on LK like qcom's or you can directly implement drivers inside UEFI and skip EFIDroid's driver wrapping completely.
[Android Software/Hacking General [Developers Only]] jhedfors:
New to this app, and trying to get a secondary ROM set up on my OnePlus One. Could someone share how they configured it to work for them? ROM installation appears to go OK, and Gapps says success, but does not display the usual install progress. I also see "unable to mount system" errors.

Also, is there are way to configure it so the secondary ROM/Recovery can easily access the built-in SDCARD? The only way I have been able to reach the internal SDCARD is to navigate to "/multiboot/data/media/0".

Thanks!

Here a couple of screenshots of my errors

My configuration:
[Android Software/Hacking General [Developers Only]] jhedfors:
Good points - thanks. Is there an easy way to restore to a secondary ROM, a TWRP backup made with the primary ROM?
[Android Software/Hacking General [Developers Only]] musklor:
Hello, read my post #41
[Android Software/Hacking General [Developers Only]] jhedfors:
I did read that before, as well as check out the link...

My OnePlus One does not have an external SD card - just the 64gb internal. I could try transferring to a usb stick connected to an OTG cable, but I was hoping for an easier way. Also, your last comment "can't flash gapps, only ROM" - that seems like a deal-breaker. Did you figure a way to do this?

Also, any idea how to resolve the error "Failed to mount "/system (invalid argument)"?

UPDATE: Restoring backup took 30 minutes and ended up bootlooping (I gave up after 45min). Does anyone have any ideas of how I can get this to work? Thx.
[Android Software/Hacking General [Developers Only]] m11kkaa:
There actually is another problem for Android: the way in which vold detects mounts removable storage like that makes it hard to intercept that mount behavior. https://github.com/efidroid/projectmanagement/issues/33

Did you try to force selinux to permissive in the UEFI settings? EFIDroid still has big selinux issues.
[Android Software/Hacking General [Developers Only]] jhedfors:
I forced selinux to permissive, and I am able to flash and boot ROM, but I am unable to flash any additional zips as I am still getting the "unable to mount system" error I mentioned earlier.

I tried mounting system prior to flashing, and that did nothing.
[Android Software/Hacking General [Developers Only]] pavanjadhaw:
How to add support to new devices? I would like to make it work on osprey. Moto g 2015
[Android Software/Hacking General [Developers Only]] jhedfors:
Attached logs
[Android Software/Hacking General [Developers Only]] m11kkaa:
well if you can't even mount system in recovery and you're not installing an L-style zip(system patch) then you have to format system(and maybe other partition which show the same error) using TWRP's partitions manager or mkfs.
[Android Software/Hacking General [Developers Only]] jhedfors:
I am assuming you are referring to the secondary ROM, and not the primary, right? So I reformatted the system partition in TWRP, reflashed ROM, flashed additional zip, but still got the same error.

UPDATE: even though i get the error, it appears to have actually installed. I did not see the expected install dialogue that I see with the primary ROM, and I lose the ability to mount system after the error. After rebooting recovery, I can again mount system if I need to.
[Android Software/Hacking General [Developers Only]] musklor:
Since the last update no more issue.

I can flash ROM, gapps, etc....

I have a oneplus one 64gb like you.

I have 'failed to mount /system' but I flash a ROM for the first time but it works. (I made a test tonight)

A guide for the opo :

1. Install efidroid

2. Open efidroid, choose install/update and install

3. Choose operating system and hit the "+"

4. Choose 'data/media/0/multiboot' and leave the others fields unchanged (except the name of the ROM)

5. Reboot

6. Under recovery choose the name of your new ROM.

7. Under TWRP, swype when asked

8. Hit the install button under TWRP and choose the path : multiboot/data/media/0 and download (for example)

9. Flash all you need

10. Be patient, it takes some time.

11. Reboot, choose your ROM and enjoy.

And thank you very much, devs and maintainers.
[Android Software/Hacking General [Developers Only]] SirSoviet:
Great app! Since it's open-source, why not put it up on F-Droid? It'll likely be a lot more visible there, because there's a "What's New" tab in F-Droid which shows new projects.

Ok, I've tried it and I'm completely at a loss for words to describe how amazing this is. One question: HOW?
[Android Software/Hacking General [Developers Only]] jhedfors:
When creating a new OS, it appears that the system size just defaults to 1GB. Is there any way for it to default to the actual system size? The OnePlus One should be around 1.36 GB.

Also, attempting to restore a backup takes much longer than the primary OS, even though all the storage is internal on my device. Is there a way to optimize this so it would be close to the speed of the primary OS?

It normally takes about 5 1/2 minutes to restore on the primary rom, but it took 30 minutes to restore a backup.

UPDATE: Ugh. I forgot I was advised that I need to set selinux to permissive..... Maybe that should be default? I remembered this after I wiped. Starting over now.
[Android Software/Hacking General [Developers Only]] AndresOrue:
Excellent work mate, ready to test in my nexus 5 sometimes ;)
[Android Software/Hacking General [Developers Only]] barclac:
Yes great work, can't wait for the Nexus 5 to be able to work, but not yet.
[Android Software/Hacking General [Developers Only]] tom_riddler:
Intel based SoCs?
[Android Software/Hacking General [Developers Only]] m11kkaa:
first, how did we get so much activity here over night? :)

any blog/news post I've missed?

I've tried that but they have a problem with the prebuilt busybox and with the fact that I don't create tags/releases(EFIDroid is rolling release for now).

Did you ever try to restore your primary ROM after installing EFIDroid? If that's slow too there may be a general problem with the way EFIDroid handles recovery.

Also, recovery gets forced to permissive selinux no matter what you select in UEFI's settings.

Thank you :) there have been (successful?) attempts for hammerhead in past but nobody has made it official yet. And I don't even know who worked on it.

there's no support for that yet but it would probably very easy. Heck you could even port real/fully working UEFI to such devices and many even have that already.
[Android Software/Hacking General [Developers Only]] AlaskaLinuxUser:
https://www.xda-developers.com/efidroid-is-a-second-stage-bootloader/

Yes, you've been spotlighted for your great work! ;)
[Android Software/Hacking General [Developers Only]] dexz:
This is a great project!!! I saw your project from XDA news. Is it possible to work on Huawei Mate 8?
[Android Software/Hacking General [Developers Only]] m11kkaa:
since it uses a HiSilicon Kirin 950 Soc - which afaik is just as developer friendly as mediatek - I doubt that's gonna be an easy task.

In THEORY EFIDroid can work on any device - the big problem is usually the amount of work needed to add support (especially when there are no opensource drivers).
[Android Software/Hacking General [Developers Only]] CBpbxEcmecmBeH:
Ha! You beat me to it :)
[Android Software/Hacking General [Developers Only]] jhedfors:
I am doing that now, and it also is taking forever as you suspected. Is there anything that can be done about that? On that same note, is there a way to restore the pre-EFIDroid condition, so I can restore normally (without booting the OS), as I screwed it up, and I am hoping my restore works).

Setting the permissive state was the only way I could get anything to boot.

Thanks!
[Android Software/Hacking General [Developers Only]] m11kkaa:
since UEFI sits in the boot and recovery partitions, using "fastboot boot" or "fastboot flash" bypasses EFIDroid and you can install/restore whatever you want without EFIDroid protecting itself.

EDIT: oh and about the speed issue. I'll look what I can do but recovery is a very complicated environment when it comes to multibooting.
[Android Software/Hacking General [Developers Only]] dexz:
I hope some dev can look into this. Great job by the way.
[Android Software/Hacking General [Developers Only]] jhedfors:
OK, thanks!
[Android Software/Hacking General [Developers Only]] surajrv6:
does it support f2fs file system?
[Android Software/Hacking General [Developers Only]] m11kkaa:
yes, but keep in mind that recoveries and ROM's have to support this too.
[Android Software/Hacking General [Developers Only]] Adarsh2000:
Xiaomi/kenzo has unofficial support, but still it says can load device info. Help.
[Android Software/Hacking General [Developers Only]] m11kkaa:
unofficial means two things:

- no support by the app (and no official builds)

- the port may be not working or incomplete(because the dev gave up or became inactive and didn't maintain it)
[Android Software/Hacking General [Developers Only]] danerrickcuba@gmail.com:
Are Qualcomm the only arch supported?

I'm running Kirin 650 on p9 lite, I've being trying multiboot(not supported), dualboot patcher(waiting dev to add support) so far and nothing works, what others exist our there to accomplish this task?

_New World Order (NWO)_
[Android Software/Hacking General [Developers Only]] m11kkaa:
right now yes.

This doesn't have any technical reasons - it's just that Qualcomm is the only vendor who provides bootloader sources.

For other socs you have to do your own port from scratch and write your own drivers(or port them from linux).
[Android Software/Hacking General [Developers Only]] SirSoviet:
I'm using bacon, and it doesn't look like any roms are booting up, it's just stuck on the bootlogo. I flashed the rom in /data/media/0/multiboot/. When I flash the rom, is the system.img and data folder in the multiboot folder supposed to be empty? Nothing has been extracted.
[Android Software/Hacking General [Developers Only]] OldDroid:
[MENTION=3530648]m11kkaa[/MENTION]

in theory, would this whole stuff also work on different chipsets? I'm Interested in bringing this second stage bl to huawei kirin devices.

Edit: saw already that your project relies on qcom bootloader source! Sorry

regards
[Android Software/Hacking General [Developers Only]] m11kkaa:
did you try to use permissive selinux mode?(UEFI settings)

also in case you're using fastboot flash instead of recovery: that's not yet fully supported.
[Android Software/Hacking General [Developers Only]] m11kkaa:
well many chips seem to be supported by the U-Boot bootloader. But I have no idea if these work with consumer devices.

Also, you'll probably need UART to have any chance of working on such a project.
[Android Software/Hacking General [Developers Only]] SirSoviet:
Whoa, it's working now! Thanks a bunch!

---------- Post added at 03:19 AM ---------- Previous post was at 03:07 AM ----------

Btw, is it possible to flash different versions of Android and still have it boot? Ex. Primary is 7.1.1, Secondary is 4.4.4. And is there anything that can go wrong by doing it?
[Android Software/Hacking General [Developers Only]] FaserF:
Keep up the grat work. It sounds amazing!

Will use it once it's availeable for my OnePlus 3T :)
[Android Software/Hacking General [Developers Only]] m11kkaa:
if the maintainer did a proper port, yes ;)

Since you'r using a oneplus you're probably thinking about the different bootloaders(fdt vs dtimg). afaik EFIDroid can be installed with both versions of the bootloader and can boot to any kind of ROM(no matter which bootloader it was designed for).

If you experience any problems, report them on github. EFIDroid's policy is to try everything to not require users to install any prerequisites.
[Android Software/Hacking General [Developers Only]] SirSoviet:
Sorry for asking so many questions, but if I go and boot into the recovery of my secondary rom and do a full wipe, will the primary rom or internal storage be touched in any way?
[Android Software/Hacking General [Developers Only]] m11kkaa:
ask as many questions as you want :)

EFIDroid is designed to prevent any modifications outside the ROM.

If it happens anyway that's a major bug which you should report on github.
[Android Software/Hacking General [Developers Only]] DJBhardwaj:
Stupendous work man! How about other devices like the 6P?
[Android Software/Hacking General [Developers Only]] m11kkaa:
I think there were a few people who've tried this and they had very different experiences(EFIDroid was still in heavy pre-alpha development back then) but afaik there's no complete port yet.
[Android Software/Hacking General [Developers Only]] DJBhardwaj:
How about now? Do you think it will easier with the progress that has been made already?
[Android Software/Hacking General [Developers Only]] m11kkaa:
I'm not sure since the problems were very low level. It's not known if the the stock bootloader just doesn't boot LK correctly or if LK itself is crashing.

Unless sbd. tries again and keeps working on it until it works we won't know.
[Android Software/Hacking General [Developers Only]] DJBhardwaj:
I can just hope that someone takes out the time for this, definitely worth to every bit. :good:
[Android Software/Hacking General [Developers Only]] iamno1monarch:
is there a way to uninstall efidroid from bootloader menu as i couldnot boot into os and i cant flash any os ?

by the way i'm on condor
[Android Software/Hacking General [Developers Only]] m11kkaa:
just 'fastboot flash' your favorite recovery tool, boot to it and install/restore a ROM.

Also keep in mind that you should report such bugs with details on github - I can't fix things I'm not aware of.
[Android Software/Hacking General [Developers Only]] CarbonXperia:
Can you give instructions to port it for other devices....For example I have a OnePlus X... Similar to OnePlus one''s specs.....So plz reply....
[Android Software/Hacking General [Developers Only]] m11kkaa:
https://github.com/efidroid/projectmanagement/wiki/[EFIDroid]-Porting-a-new-device

and you can ask on slack if you need help porting.
[Android Software/Hacking General [Developers Only]] JoshDaWhite:
Hi sorry If its been asked before, but can you add support for One Plus3?Thanks, this stuff looks awesome!
[Android Software/Hacking General [Developers Only]] m11kkaa:
I can't add support for devices which I don't own myself. One of the developers who own this device have to work on it. msm8996 has some unresolved problems though which means it might be more work than usual.
[Android Software/Hacking General [Developers Only]] JoshDaWhite:
Oh cool thanks for the quick answer (@Grarak , [MENTION=3292224]franciscofranco[/MENTION] )
[Android Software/Hacking General [Developers Only]] evilracer123:
[MENTION=3530648]m11kkaa[/MENTION] any idea why this is happening?

/home/hannu/efidroid/out/target/arm/uefiapp_LKL/EFIDroidUEFIApps/LKL/LKL.c: In function 'LKLEntryPoint':
/home/hannu/efidroid/out/target/arm/uefiapp_LKL/EFIDroidUEFIApps/LKL/LKL.c:97:41: error: passing argument 2 of 'lkl_start_kernel' makes pointer from integer without a cast [-Werror=int-conversion]
ret = lkl_start_kernel(&lkl_host_ops, 64 * 1024 * 1024, "");
^~
In file included from /home/hannu/efidroid/out/target/arm/uefiapp_LKL/EFIDroidLKL/include/lkl_host.h:8:0,
from /home/hannu/efidroid/out/target/arm/uefiapp_LKL/EFIDroidUEFIApps/LKL/LKL.h:55,
from /home/hannu/efidroid/out/target/arm/uefiapp_LKL/EFIDroidUEFIApps/LKL/LKL.c:24:
/home/hannu/efidroid/out/target/arm/uefiapp_LKL/EFIDroidLKL/include/lkl/asm/host_ops.h:141:5: note: expected 'const char *' but argument is of type 'int'
int lkl_start_kernel(struct lkl_host_operations *lkl_ops,
^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: Poistutaan hakemistosta ”/home/hannu/efidroid/out/target/arm/uefiapp_LKL/Build/EFIDroidUEFIApps/DEBUG_GCC5/ARM/EFIDroidUEFIApps/LKL/LKL”
make[2]: *** [GNUmakefile:1366: /home/hannu/efidroid/out/target/arm/uefiapp_LKL/Build/EFIDroidUEFIApps/DEBUG_GCC5/ARM/EFIDroidUEFIApps/LKL/LKL/OUTPUT/LKL.obj] Virhe 1

build.py...
: error 7000: Failed to execute command
make tbuild [/home/hannu/efidroid/out/target/arm/uefiapp_LKL/Build/EFIDroidUEFIApps/DEBUG_GCC5/ARM/EFIDroidUEFIApps/LKL/LKL]

build.py...
: error F002: Failed to build module
/home/hannu/efidroid/out/target/arm/uefiapp_LKL/EFIDroidUEFIApps/LKL/LKL.inf [ARM, GCC5, DEBUG]

- Failed -
Build end time: 15:41:14, Mar.07 2017
Build total time: 00:00:05
[Android Software/Hacking General [Developers Only]] rrgreatvijay5:
Hey op, i am trying to port this to my device lenovo vibe k5

It has msm8929 SoC and while selecting the target lk, this soc is not listed.. Can you help ?
[Android Software/Hacking General [Developers Only]] cc6691:
Please tell how to port this to our own device
[Android Software/Hacking General [Developers Only]] m11kkaa:
I need to update a few things since I was busy last month and the xda news came unexpected ;)

msm8929 is supported by the 'msm8916' target.

https://github.com/efidroid/projectmanagement/wiki/[EFIDroid]-Porting-a-new-device
[Android Software/Hacking General [Developers Only]] Vagelis1608:
Hello.

I'm trying to port this to the LG G2 Mini (D620r).

It uses msm8926, however, that's not supported directly.

Msm8226 should cover it, right?
[Android Software/Hacking General [Developers Only]] m11kkaa:
exactly :)
[Android Software/Hacking General [Developers Only]] m11kkaa:
fixed :)
[Android Software/Hacking General [Developers Only]] rrgreatvijay5:
typed the command "finalize_device device/lenovo/a6020" and nothing happens after that on the terminal or on the mobile's screen

It looks stuck..

anything wrong? [MENTION=3530648]m11kkaa[/MENTION]
[Android Software/Hacking General [Developers Only]] evilracer123:
Sync'd, ported, built and it works!! Thanks :highfive:
[Android Software/Hacking General [Developers Only]] m11kkaa:
finalize does only work if lk has successfully booted. a successful boot results in the device being in a custom fastboot state and if you're lucky the device even shows LK logs on the screen.
[Android Software/Hacking General [Developers Only]] Vagelis1608:
So, make -j2 lk completes without errors.

However, there is no image in out/target. I found one under out/device...

I flashed it in the recovery partition but when I boot it, the screen simply turns black.

Something that should be noted: The only way we (on the g2 mini forums) have found to access fastboot on the device is to wipe the laf partition and boot into download mode.
[Android Software/Hacking General [Developers Only]] rrgreatvijay5:
I was able to run the custom lk commands like "fastboot oem bootaddresses" and it showed the output in the terminal..

But the mobile just showed lenovo logo(fastboot screen) and nothing else..
[Android Software/Hacking General [Developers Only]] XeniX_Force:
id ask my phone's devs to work on this (lg g4) but i wanna know if i can dualboot two different android versions

as in first ROM being stock mm

and secondary being lineage nougat
[Android Software/Hacking General [Developers Only]] m11kkaa:
I've corrected the guide.

refer to the "Display driver" section of the guide then.
[Android Software/Hacking General [Developers Only]] m11kkaa:
if the port is fully working, yes. We can even compensate most bootloader differences.
[Android Software/Hacking General [Developers Only]] Alexandroid99:
Hmm I tried to compile it for the Nexus 5 but at some point it shows an error about an operation not being permitted. Does this have to do with filesystem permissions or is it an error in the compilation process itself?
[Android Software/Hacking General [Developers Only]] m11kkaa:
I guess you have to post the full log because the error doesn't sound familiar.
[Android Software/Hacking General [Developers Only]] debilausaure:
Hi !

I own an OPO, which is great since it is officially supported ! ;)

There is a Kali NetHunter ROM available for the OPO (also officially supported by Offensive Security team).

Is EFIDroid compatible with OSes other than Android (especially NetHunter) ?

Thanks for your work :laugh:
[Android Software/Hacking General [Developers Only]] m11kkaa:
depending on if your device uses fdt or dt.img add one of the following lines to your device's config.ini:

BOOTIMG_FDT_PARSER = qcom_lge

BOOTIMG_QCDT_PARSER = qcom_lge
[Android Software/Hacking General [Developers Only]] m11kkaa:
not yet. I've looked at sailfish and ubuntu in the past but didn't invest much time yet(but I might in future) :)
[Android Software/Hacking General [Developers Only]] debilausaure:
Ok, thank you for your answer :)
[Android Software/Hacking General [Developers Only]] rrgreatvijay5:
So I tried these:

Case 1: DISPLAY_2NDSTAGE with this driver, i get Lenovo logo on the screen in android and in terminal fastboot is detected

Case 2: DISPLAY_2NDSTAGE_DTB with this driver, i get white screen in android and in terminal fastboot is detected

Case 3: "DISPLAY_2NDSTAGE" with "DEFINES += WITH_2NDSTAGE_DISPLAY_DMA_TRIGGER" and result is same as case 1.

finalize_device does not work in any of these cases... :/

Edit: The default fastboot screen is a Lenovo Boot logo with fastboot written in the bottom

[MENTION=3530648]m11kkaa[/MENTION]
[Android Software/Hacking General [Developers Only]] Vagelis1608:
That img file is almost 1MB. Is that normal?

If it is then I will start tweaking the display drivers.

Also, I flashed it using dd over the recovery partition. I don't know if that makes any difference.
[Android Software/Hacking General [Developers Only]] surajrv6:
I think the user interface of the bootloader is still for the advance user.. I installed EFIDroid and I rebooted my device and when I tried booting the main OS, with short pressing power button, it got stuck with the loading boot logo even with selinux set to permissive. ( I am using latest version of the lineage os as my primary os) Only when I long pressed the main OS and selected booting without ramdisk patching option, I was able to boot.. that was a bit confusing for noob user like me :)

Edit: I am using oneplus one
[Android Software/Hacking General [Developers Only]] cc6691:
Can this be ported by noob persons ?

Or porting process requirs advance knowledge
[Android Software/Hacking General [Developers Only]] m11kkaa:
I think it would be better if you create a github issue for your device so we can collect all information and give provide proper advise and ideas.

1MB is normal and actually very small. devices which need huge device-trees can be up to 10mb.

There's a lot inside that image:

- qcom's LK bootloader

- UEFI

- user interface with libaroma and many graphics

- multiboot userspace

- linux kernel for filesystem drivers

- devicetree for dt devices

your problem is not related to the user interface. It's a major booting bug which you should report. unpatched boot is just a workaround for issues such as yours and basicall means that efidroid is unusable on your device

If there will not be any problems, yes. Otherwise you'll have to do intensive debugging and maybe write/fix some drivers.
[Android Software/Hacking General [Developers Only]] surajrv6:
I am attaching the dmesg.txt

Don't know if that is helpful for you to find the bug
[Android Software/Hacking General [Developers Only]] XeniX_Force:
[MENTION=3208754]codeworkx[/MENTION] [MENTION=5776465]genesixxbf3[/MENTION]

can you guys be kind enough to work on this if you have free time
[Android Software/Hacking General [Developers Only]] m11kkaa:
well that's just a normal log and not a last_kmsg/pstore log from the boot attempt.