[script][v500] Convert loki kernel to bumped (permissive) kernel in recovery

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
Currently, all official CyanogenMod ROMs use loki tool to install the kernel on the LG G Pad 8.3 v500. Unfortunately, using loki tool causes a benign "secure boot error message" upon startup.

Here are some scripts that can be flashed in the recovery to convert a loki kernel to a bumped (permissive) kernel. The kernel will remain permissive until a new ROM or kernel is flashed again.

When making a kernel permissive, the following commands will be appended to the kernel boot command line:
Code:
androidboot.selinux=permissive selinux=0
Note: Only apply these scripts one time when setting the kernel to permissive mode or the command line above will be appended twice.

Instructions:
1) Flash ROM
2) Flash one of the scripts below, depending on what you want.

1) Convert a loki kernel to a bumped kernel
v500-loki-kernel-to-bumped-kernel-signed.zip

2) Convert a loki kernel to a bumped permissive kernel (turns off selinux)
v500-loki-kernel-to-bumped-permissive-kernel-signed.zip

3) Convert an already bumped kernel to a permissive bumped kernel (turns off selinux)
v500-bumped-kernel-to-bumped-permissive-kernel-signed.zip

Thanks to @Skin1980 for the bash bump code.
Thanks to @aicjofs for the script base.
 
Last edited:

annoyingduck

Senior Member
Aug 15, 2012
3,265
1,943
0
Boston, MA Area
This is really great, we all love what your doing for us - thanks again. I'm gonna take a stab in the dark and guess that its probably a bad idea to use the CM updater due to these having to be flashed along with an update?
 
  • Like
Reactions: Deltadroid

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
This is really great, we all love what your doing for us - thanks again. I'm gonna take a stab in the dark and guess that its probably a bad idea to use the CM updater due to these having to be flashed along with an update?
It's fine to use the cm updater, but you will have to reboot into the recovery twice to apply the patch. Also, if you want your Bluetooth pairings to remain intact, then you want to keep the kernel in permissive mode and never let it boot with selinux enabled (at least until the selinux denials are fixed).
 

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
Yay! thanks to the permissive script, SuperSU works on CM13! =)
That is good to hear.

The reason systemless supersu does not work with our device is because it breaks the signature on our bumped boot image.

If you choose option #1 on the op after flashing supersu, you should be able to keep selinux in enforcing mode and just rebump the boot image to fix the signature that supersu breaks.

Edit: you will need to dirty flash the rom again to put the device back into enforcing mode.. Then flash supersu and finally the script to bump the boot image over again.
 
Last edited:

nytral

Senior Member
Jul 30, 2010
56
11
0
That is good to hear.

The reason systemless supersu does not work with our device is because it breaks the signature on our bumped boot image.

If you choose option #1 on the op after flashing supersu, you should be able to keep selinux in enforcing mode and just rebump the boot image to fix the signature that supersu breaks.

Edit: you will need to dirty flash the rom again to put the device back into enforcing mode.. Then flash supersu and finally the script to bump the boot image over again.
Well, that's what I thought and what I did first, but actually latest beta SuperSU (2.68) is not breaking the boot sig for some reason (no bootloader error as with previous builds). Looking at logcat during the stuck boot I noticed some zygote process failing because of selinux and that's when I decided to try to disable it -> success! Now a cleaner way would probably be to give the logs to @Chainfire so he can have a look but given the non-popularity of V500 he probably won't care/not be able to fix it without one. Oh well, at least I have something working although not as secure as it should be. So thank you for this :good:
 
  • Like
Reactions: Deltadroid

glyrakos

Senior Member
Jun 21, 2014
58
6
0
50
Athens
Thank you for this great job!!! I was stuck on the LG logo with the know loki message... I though that my v500 was bricked for good.
I used the first file after cleaning everything in twrp 3.0.0 (not usb and external) and installing a)6.0 mmb29v, b) su v2.65 and c) your 1st file.
2 questions. 1) whenever I flash and update should I flash it through twrp with the above mentioned order? 2) Should I flash other version (older like 2..8.7.x) and philz zip?
Thank you again for your great job!!!
 

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
Thank you for this great job!!! I was stuck on the LG logo with the know loki message... I though that my v500 was bricked for good.
I used the first file after cleaning everything in twrp 3.0.0 (not usb and external) and installing a)6.0 mmb29v, b) su v2.65 and c) your 1st file.
2 questions. 1) whenever I flash and update should I flash it through twrp with the above mentioned order? 2) Should I flash other version (older like 2..8.7.x) and philz zip?
Thank you again for your great job!!!
You did it correctly. Every time you flash SuperSU over again, you will need to flash this script directly after that to bump the kernel over again and fix the boot signature. Any recovery should work, but I recommend using the latest official TWRP.
 
  • Like
Reactions: glyrakos

glyrakos

Senior Member
Jun 21, 2014
58
6
0
50
Athens
You did it correctly. Every time you flash SuperSU over again, you will need to flash this script directly after that to bump the kernel over again and fix the boot signature. Any recovery should work, but I recommend using the latest official TWRP.
Sorry, but as a nobbie let me ask you something more. Do you have a link for the latest official TWRP. How to flash it? Through TWRP 3.0.0 that I have now, or through sideload? Also I cannot enter TWRP with the combination of the 3 buttons. I get Factory Reset menu.
Thank you.
 

Deltadroid

Recognized Contributor
Apr 19, 2013
3,764
9,879
263
Sorry, but as a nobbie let me ask you something more. Do you have a link for the latest official TWRP. How to flash it? Through TWRP 3.0.0 that I have now, or through sideload? Also I cannot enter TWRP with the combination of the 3 buttons. I get Factory Reset menu.
Thank you.
The official TWRP for device is here
http://forum.xda-developers.com/showthread.php?p=61363260
You can flash the new recovery image from within TWRP.

When you use the 3 buttons to get to recovery, it asks to factory reset, but it goes to TWRP instead. It is a hack because our recoveries were never actually unlocked. Just say, yes and TWRP will open.
 

stiso

New member
Jan 4, 2017
3
0
0
The official TWRP for device is here
http://forum.xda-developers.com/showthread.php?p=61363260
You can flash the new recovery image from within TWRP.

When you use the 3 buttons to get to recovery, it asks to factory reset, but it goes to TWRP instead. It is a hack because our recoveries were never actually unlocked. Just say, yes and TWRP will open.
Maybe I am not doing something good but when using the 3 button method it goes to factory reset and stays there endless if I do not press something .... but power whipes everything (i've re-setup my v500 for about 15 times already....) ... and volume up/down exits the menu and reboots......
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone