FORUMS

[KERNEL]Mate 10 Pro Stock "setenforce" kernel (Wireguard) (Upstreamed)

3,206 posts
Thanks Meter: 1,581
 
By ante0, Senior Member on 3rd February 2018, 07:21 PM
Post Reply Email Thread
Note: I have only tested this on Mate 10 Pro, so I don't know if it works on Mate 10. Title will stay until tested

Kernel downloads: https://github.com/Ante0/BKL_OREO_EM...aster/releases
Source used: https://github.com/Ante0/BKL_OREO_EMUI8
Currently upstreamed to: 4.4.130
4.4.60 and above contains Blu_Active governor

Windows: https://mega.nz/#!NTgEFKiZ!4nB6Quznp...6aUIlMTyTYOQcQ
Download Kernel_Pack_tool_windows.zip, extract.
Download desired Image_4.4.*.gz, put in the Kernel_Pack_tool_windows folder, open a command prompt in the extracted folder and run "pack_kernel.bat 2018-08".
This will create an image for patch level 2018-08, change to your current patch level (Settings->About->Android Security patch).
Flash image using fastboot. Example: fastboot flash kernel Kernel_4.4.53.img

Linux: https://mega.nz/#!Ne5mXATT!FXjWsnY61...y4BlS_R0HDQ5UM
Download Kernel_Pack_tool_linux.zip, extract.
Download desired Image_4.4.*.gz, put in the Kernel_Pack_tool_linux folder, open a terminal in the extracted folder and run "./pack_kernel.sh 2018-08".
This will create an image for patch level 2018-08, change to your current patch level (Settings->About->Android Security patch).
Flash image using fastboot. Example: fastboot flash kernel Kernel_4.4.53.img
If you get permission errors you may have to chmod +x pack_kernel.sh and mkbootimg



UPDATE: I have changed sources to use Honor View 10 instead as camera works here (and everything else) and I'm also upstreaming it. Currently at 4.4.52: https://github.com/Ante0/BKL_OREO_EMUI8.0
Downloads will come soon. I will make a new script to change patch level instead of changing each image (from 2017-12 to 2018-09) as it takes time and space on my mega.

This does not set selinux to permissive all the time, you have to use 'setenforce 0' to enable permissive, this is to only enable it when you need it.

All this does is let us use 'setenforce' again, since Huawei decided to disable it in Oreo.
Could be useful for V4A and other sound mods, since they usually require permissive. Or anything else that could need permissive.
V4A still doesnt work with permissive, something else needs fixing

Note: This is for Security Patch level 2018-01. If yours is 2017-12 or 2018-02 you will bootloop.
This is because --os_patch_level must match ro.build.version.security_patch in /vendor/build.prop
If so you need to repack kernel and change --os_patch_level to match your version.
I will keep my github updated with security patches from Google, but if Huawei changes something in their own source it won't be in this kernel.

Mate 10/Mate 10 Pro downloads: https://mega.nz/#F!FbBBCaIS!YYH94l12su3HcsbwIqDygg
(Check Settings -> About - "Android security patch:" to get the correct patch level.
If it says 1 January 2018, download and flash 201801 kernel. 1 February 2018: 201802 and so on.)

Flash using: Fastboot flash kernel kernel.img

Mate 10 Kernel source: https://github.com/Ante0/ALP_OREO_EMUI8
Mate 10 Pro Kernel source: https://github.com/Ante0/BLA_OREO_EMUI8.0

Update 10/2: Added Wireguard support, for those who like to use VPNs.
Added some simple build scripts

Please note that portrait mode in camera has been broken with custom kernel since BLA-L29C432B137
The Following 17 Users Say Thank You to ante0 For This Useful Post: [ View ] Gift ante0 Ad-Free
4th February 2018, 12:32 AM |#2  
Senior Member
Flag Vienna
Thanks Meter: 117
 
More
Not working on BLA-L09, error mode boot image load failed.
The Following User Says Thank You to Bordo_Bereli51 For This Useful Post: [ View ] Gift Bordo_Bereli51 Ad-Free
4th February 2018, 12:43 AM |#3  
smariob's Avatar
Senior Member
Flag Mexico City
Thanks Meter: 40
 
More
Will try on ALP and report later

Edit: Failed flash due partition lenght get error
4th February 2018, 06:46 AM |#4  
OP Senior Member
Flag Stockholm
Thanks Meter: 1,581
 
Donate to Me
More
Quote:
Originally Posted by smariob

Will try on ALP and report later

Edit: Failed flash due partition lenght get error

Quote:
Originally Posted by Bordo_Bereli51

Not working on BLA-L09, error mode boot image load failed.

Fastboot flash kernel kernel.img

Its kernel, not boot image or ramdisk.
The Following User Says Thank You to ante0 For This Useful Post: [ View ] Gift ante0 Ad-Free
4th February 2018, 08:12 AM |#5  
smariob's Avatar
Senior Member
Flag Mexico City
Thanks Meter: 40
 
More
Quote:
Originally Posted by ante0

Fastboot flash kernel kernel.img

Its kernel, not boot image or ramdisk.

Ok will try again. As I'm writing this now I have a new concern.
My initial thought is remove magisk root, then flash kernel and then flash magisk again. Am I right?
4th February 2018, 08:13 AM |#6  
DonVito2020's Avatar
Senior Member
Thanks Meter: 112
 
More
@ante0

Thank you for the new kernel!!!
Keep up the good work dev
4th February 2018, 09:21 AM |#7  
OP Senior Member
Flag Stockholm
Thanks Meter: 1,581
 
Donate to Me
More
Quote:
Originally Posted by smariob

Ok will try again. As I'm writing this now I have a new concern.
My initial thought is remove magisk root, then flash kernel and then flash magisk again. Am I right?

No. Kernel is separate. Magisk goes in ramdisk.
Before oreo ramdisk and kernel was merged in the boot partition, but now they're split into ramdisk and kernel partitions.

So you only need to flash kernel to kernel.
The Following User Says Thank You to ante0 For This Useful Post: [ View ] Gift ante0 Ad-Free
4th February 2018, 09:22 AM |#8  
Pretoriano80's Avatar
Senior Member
Thanks Meter: 2,957
 
Donate to Me
More
Congrats for the first Mate 10 kernel, mate!
4th February 2018, 10:09 AM |#9  
Senior Member
Thanks Meter: 13
 
More
noob question here: setenforce 0 is written in terminal or adb? how to?
4th February 2018, 10:23 AM |#10  
Senior Member
Flag Vienna
Thanks Meter: 117
 
More
Ok worked. Thanks ante0. Guys if you have magisk, search for permissive script for magisk. It sets at every boot to permissive
P.S Now I have bootloop, phone started at first boot, but at the second boot its now in bootloop, always restarting.
4th February 2018, 11:08 AM |#11  
OP Senior Member
Flag Stockholm
Thanks Meter: 1,581
 
Donate to Me
More
Quote:
Originally Posted by Bordo_Bereli51

Ok worked. Thanks ante0. Guys if you have magisk, search for permissive script for magisk. It sets at every boot to permissive
P.S Now I have bootloop, phone started at first boot, but at the second boot its now in bootloop, always restarting.

flash back stock kernel, and see if it helps. If not, it might be the Magisk module if you installed it.
You can "disable" magisk by flashing back stock ramdisk.

Please note that this is built from Huaweis sources, so we don't know how many bugs there are yet xD (Mate 9 kernel source broke camera for example)

Quote:
Originally Posted by Saadkhalid786

noob question here: setenforce 0 is written in terminal or adb? how to?

terminal.
Or use the Magisk Module as Bordo_Bereli51 suggested.

Though if you don't have any app or something that needs permissive it's no use in running it at all times.
The Following User Says Thank You to ante0 For This Useful Post: [ View ] Gift ante0 Ad-Free
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