[G4 Android Development] steadfasterX:
EFIDroid

A UEFI based Android bootloader.

EFIDroid provides an easy Installer, good looking Material Design user interfaces and uses very dynamic code.

Homepage: efidroid.org

Take over control before loading the Operating system.

EFIDroid attempts to make it easy for both users and developers to control their boot experience.

Multiboot

Install and boot any number of operating systems and recovery tools.

Boot plugins

Change the boot behavior without modifying ROM's. Swapping internal/external memory, overclocking or modifying the ramdisk. Live and without any permanent modifications.

UEFI Apps

EFIDroid uses UEFI in the background which means that you can boot other bootloaders like GRUB or rEFInd and even small games :)

Download

see Installation section

Requirements

The main OS (that one you currently use) must be

rooted

to use the efidroid app.

You may be able to install magisk later in a secondary ROM (never tried it though)

Hint:

lineageos root add-on works (tested on LOS 15.1) and magisk will NOT work. Use supersu.

TWRP / FlashFire installable ZIP:

Stable: supersu-stable

Beta: supersu-beta

Latest: supersu

At the moment the only TWRP which is working for efidroid is:

twrp-3.1.1

- any newer TWRP release will fail with a ramdisk size error which is

not

due to a missing kernel patch. It's a known issue for efidroid and one of the reasons for the efidroid rewrite

I maybe find a workaround to get newer TWRP versions installed.. we will see..

So if you have a newer version of TWRP installed currently: upgrade/downgrade to that version first.

Installation

A full howto with screenshots can be found here

Unlock your device! This will

NOT

work with a locked bootloader (you know about UsU?)

Download the EFIDroid Manager from Google Play Store - Has been removed..

Efidroid manager download: main efidroid thread

Download the latest version by opening the "Downloads" tab of this thread (requires to open this thread in a browser)

Download the latest version from here (EFIDroidManager_1.0-g9d797ac_working.apk)

Activate my efidroid OTA server:

Option 1

(permanent): modify /system/build.prop

Boot to TWRP

Make a backup (including

system

partition)!

Mount System partition in TWRP

enable the efidroid OTA server:

adb shell
echo "efidroid.server_url=https://raw.githubusercontent.com/steadfasterX/efidroid_ota_lgg4/master" >> /system/build.prop

reboot

verify that the efidroid server URL has been set properly:

adb shell getprop efidroid.server_url

Option 2

(will be lost on reboot): using setprop

Set the efidroid OTA server:

adb shell
setprop efidroid.server_url https://raw.githubusercontent.com/steadfasterX/efidroid_ota_lgg4/master

verify that the efidroid server URL has been set properly:

adb shell getprop efidroid.server_url

Open EFIDroid Manager

HINT: If you see an error like "cannot load device info, please check your connection : no value for lge/H815" then the above OTA url has not been set or is set wrong.

Go to Install/Update

Click Install --> HINT: THIS WILL MOVE YOUR BOOT AND RECOVERY PARTITION CONTENT

This means

1. from now on EFIDroid will boot each time u power on the device.

2. the recovery partition gets backed up and you will see it in EFIDroid again as (if TWRP): TWRP (internal).

3. you can still boot your main ROM by just choosing it from the list --> your ROM name - (internal)

If you don't like this you can install EFIDroid to either: recovery or boot partition only. But this is a manual process and when you upgrade with EFIDroid Manager it may overwrite your changes.

Install a custom ROM

A full howto with screenshots can be found here

Open EFIDroid Manager

Open the menu "Operating Systems" and click the FAB (Floating Action Button) at the bottom

Choose in the screen /data/media/0/multiboot as location.

Enter a name for the ROM

Optional: Choose another icon for the ROM

You can leave the partitions as they are (Schema LoopSystem + BindOther) Press the tab "PARTITIONS" and choose "LoopAll". You will see that the data partition is quite big (the g4 internal storage is just 23 GB so you choose a smaller size for each ROM to fit all your ROM slots).

Tip "data" and select GB in the drop down. Choose a proper size (i.e. 2 GB) depending on what you wanna do with that ROM and how many you wanna install (each ROM will take 4 GB for system + the data size you choose here)

In the tab "REPLACEMENTS" click the floating plus button and add a new cmdline override:

Name = androidboot.selinux
Value = permissive

press the tick in the top right corner to finish the setup

Now you can see your newly created ROM slot in the list

Reboot

Once you are in the efidroid, you can navigate around with volume down to go down, volume up to go up and the power button to confirm your selection.

To flash a ROM to the new empty slot, select TWRP (Internal) , press power and select the slot name with power again

At the moment the system partition is just empty and needs to be formatted before you can use it!

In TWRP:

select WIPE -> Advanced Wipe -> select "system" and "cache", then swipe to wipe.

select WIPE -> "Format Data" button

Reboot -> System. When you see efidroid again choose TWRP and select the new ROM slot again to boot TWRP again.

Install your ROM of your choice.

Hint: If you get an error regarding device detection you have to remove the assert line(s) within the ROM zip first

Supported devices

Any LG G4 model which can be unlocked (yea even UsU ones but that still requires some more work to detect them properly)

Known Issues

The Operating System list in the EFIDroid Manager is empty just upgrade to the latest EFIDroid manager app..

after installing a ROM it may bootloop under some circumstances

AROMA installer flickers extremely. Workaround: press power to turn off screen then turn it on again. It still flickers but u can see and use the installer at least.

As we need to use TWRP 3.1.1 (see requirements) UsU devices get not detected correctly!

The state of this project is ALPHA so expect issues and even data loss is possible (so do a TWRP backup often)

Booting a secondary ROM and working in a secondary ROM may feel slower (that's by design)

if a ROM has set selinux to enforcing it will not boot! --> If you setup the ROM slot properly (see above REPLACEMENTS tab) you do not need to care about.

Without

that adjustment in the efidroid manager you have to modify the boot.img of every ROM:

change the cmdline from

androidboot.selinux=enforcing

to

androidboot.selinux=permissive

I started a while ago to make selinux policies for efidroid but it's not that easy and so atm no ROM which has selinux set to enforcing will boot.

Credits

@m11kkaa for EFIDroid

@J0SH1X for bringing a first port for the G4

@steadfasterX for being steadfast and optimizing efidroid

XDA:DevDB Information

EFIDroid for the LG G4, Tool/Utility for the LG G4

Contributors

steadfasterX, @m11kkaa, @J0SH1X

Source Code: https://github.com/steadfasterX/efidroid_device_lge_g4

Version Information

Status: Alpha

Created 2017-04-14

Last Updated 2018-12-17