FORUMS
Remove All Ads from XDA

[G4][UNOFFICIAL][ALPHA] EFIdroid for the LG G4

4,973 posts
Thanks Meter: 13,344
 
By steadfasterX, Recognized Developer on 14th April 2017, 04:24 PM
Post Reply Email Thread
Announcement from steadfasterX: If you want to help making efidroid stable for the G4 - click here!
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:
  • 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
  1. Unlock your device! This will NOT work with a locked bootloader (you know about UsU?)
  2. 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)
  3. Activate my efidroid OTA server:
    Option 1 (permanent): modify /system/build.prop
    1. Boot to TWRP
    2. Make a backup (including system partition)!
    3. Mount System partition in TWRP
    4. enable the efidroid OTA server:
      Code:
      adb shell
      echo "efidroid.server_url=https://raw.githubusercontent.com/steadfasterX/efidroid_ota_lgg4/master" >> /system/build.prop
    5. reboot
    6. verify that the efidroid server URL has been set properly:
      Code:
      adb shell getprop efidroid.server_url
    Option 2 (will be lost on reboot): using setprop
    1. Set the efidroid OTA server:
      Code:
      adb shell
      setprop efidroid.server_url https://raw.githubusercontent.com/steadfasterX/efidroid_ota_lgg4/master
    2. verify that the efidroid server URL has been set properly:
      Code:
      adb shell getprop efidroid.server_url
  4. 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.
  5. Go to Install/Update
  6. 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:
    Code:
    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
The Following 37 Users Say Thank You to steadfasterX For This Useful Post: [ View ]
14th April 2017, 04:24 PM |#2  
steadfasterX's Avatar
OP Recognized Developer
Thanks Meter: 13,344
 
Donate to Me
More
Workarounds for known issues

1) random app crashes, settings do not persist on reboot

The reason is that file permissions get not set correctly on the bind mounted data partition.
So nothing can be stored there (or what get stored will be stored with the wrong perms).

When creating a new ROM slot it is important (atm) that you choose LoopAll .
This would create a data partition image with 23 GB which is way too much so you need to touch the data partition in the partitions tab and set the size to GB and choose e.g. 2 GB.


2) no WiFi

First boot TWRP internal / primary slot

Code:
adb shell cp /data/misc/wifi/config /external_sd/data_misc_wifi_config
Then for each slot you created you must reboot TWRP in its slot and:

Code:
adb shell cp /external_sd/data_misc_wifi_config /data/misc/wifi/config
adb shell chown system.wifi /data/misc/wifi/config
adb shell chattr +i /data/misc/wifi/config
The Following 5 Users Say Thank You to steadfasterX For This Useful Post: [ View ]
14th April 2017, 04:24 PM |#3  
steadfasterX's Avatar
OP Recognized Developer
Thanks Meter: 13,344
 
Donate to Me
More
Reserved
The Following 3 Users Say Thank You to steadfasterX For This Useful Post: [ View ]
17th April 2017, 10:02 PM |#4  
Junior Member
Thanks Meter: 3
 
More
I tried to install Efidroid on my LG G4 (H815, bootloader unlocked, ResurrectionRemix 5.8.2). I install the App and modify the build.prop with the efidroid url, but every time i start the app i get the error-massage:

Error. Can't load device info. Please check your connection. No value for lge/h815.

Could you help me fixing this?
The Following User Says Thank You to jokuu For This Useful Post: [ View ] Gift jokuu Ad-Free
17th April 2017, 10:26 PM |#5  
steadfasterX's Avatar
OP Recognized Developer
Thanks Meter: 13,344
 
Donate to Me
More
Quote:
Originally Posted by jokuu

I tried to install Efidroid on my LG G4 (H815, bootloader unlocked, ResurrectionRemix 5.8.2). I install the App and modify the build.prop with the efidroid url, but every time i start the app i get the error-massage:

Error. Can't load device info. Please check your connection. No value for lge/h815.

Could you help me fixing this?

Oh damn. I forgot to update the OTA for the other devices..
There is nothing you can do on your site atm.. Sorry I will fix it asap and let you know..


.





Sent from my LG-H815 using XDA Labs
The Following 2 Users Say Thank You to steadfasterX For This Useful Post: [ View ]
18th April 2017, 02:50 AM |#6  
TheMadScientist's Avatar
Senior Member
Flag VT
Thanks Meter: 3,905
 
More
still hard at it heck yea
18th April 2017, 08:12 AM |#7  
steadfasterX's Avatar
OP Recognized Developer
Thanks Meter: 13,344
 
Donate to Me
More
Quote:
Originally Posted by jokuu

I tried to install Efidroid on my LG G4 (H815, bootloader unlocked, ResurrectionRemix 5.8.2). I install the App and modify the build.prop with the efidroid url, but every time i start the app i get the error-massage:

Error. Can't load device info. Please check your connection. No value for lge/h815.

Could you help me fixing this?

ok done. please try again


.
18th April 2017, 11:15 AM |#8  
Junior Member
Thanks Meter: 3
 
More
Quote:
Originally Posted by steadfasterX

ok done. please try again


.

Now it works. Thank you!
The Following User Says Thank You to jokuu For This Useful Post: [ View ] Gift jokuu Ad-Free
18th April 2017, 03:36 PM |#9  
steadfasterX's Avatar
OP Recognized Developer
Thanks Meter: 13,344
 
Donate to Me
More
ok .. im able to boot a LL based ROM now (Imperium ROM).. but only ONCE. lol..
Well I can boot into it again after booting in the TWRP version of that ROM and doing a factory reset from within TWRP...
Cleaning /data, /cache and dalvik cache manually does NOT work.. interesting. <-- I tested with a special (FIsH) TWRP version which does not WIPE but RM only.. Once I switched to a regular TWRP it is still strange but at least behaves the same now: When I wipe /data and /cache I can boot (but only when wiping both).

Update:
Keeping strange:
When I wipe /data only -> no boot
When I wipe /cache only -> no boot
When I wipe both -> boot ok .. wtf.?!

I will look into /misc - maybe the reason can be found here!

.
The Following 10 Users Say Thank You to steadfasterX For This Useful Post: [ View ]
29th April 2017, 07:30 PM |#10  
Senior Member
Flag karachi
Thanks Meter: 70
 
More
I just booted a second rom successfully using efi on my h811

My primary rom: lineage nougat
My secondary rom: resurrection remix (mm)

First boot was slow, second a little less slow, third and so on boot at normal speed.

Anyone else with an h811 care to try it coz @steadfasterX thinks mine booted coz i have an h811.

So if anyone else with an h811 can test it, that would help.

Btw, you all jelly?
The Following 5 Users Say Thank You to XeniX_Force For This Useful Post: [ View ] Gift XeniX_Force Ad-Free
30th April 2017, 09:06 AM |#11  
Senior Member
Flag karachi
Thanks Meter: 70
 
More
Update: i have a complex sort of bootloop.
I decided to flash gapps.
Now when i try to boot the rom, i get the optimizing apps screen, then starting apps, then the boot logo, then again starting apps, and again boot logo and it goes on like that.

If i clear cache and dalvik i get the optimizing apps again, then the circle continues.

Maybe its gapps?
Or maybe its coz you all were too much jelly
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes