Wireguard module for stock OOS 9.0.14/15? - OnePlus 6T Questions & Answers

Hello,
Can anyone suggest a reasonable method to get wireguard support into the stock OOS kernel? I had hoped I could extract the .ko file from a compatible custom rom (9.0.15's kernel is the same as 9.0.14's), but it seems everything is statically linked (I've done kernel work but not on android before).
I also looked into compiling OOS myself with just the wg tweak but got lost in gcc/clang/cross-compilation and gave up after a while. If there's some build automation someone could recommend I steal from that would be really helpful also.
Appreciate any tips!

teslacuted said:
Hello,
Can anyone suggest a reasonable method to get wireguard support into the stock OOS kernel? I had hoped I could extract the .ko file from a compatible custom rom (9.0.15's kernel is the same as 9.0.14's), but it seems everything is statically linked (I've done kernel work but not on android before).
I also looked into compiling OOS myself with just the wg tweak but got lost in gcc/clang/cross-compilation and gave up after a while. If there's some build automation someone could recommend I steal from that would be really helpful also.
Appreciate any tips!
Click to expand...
Click to collapse
If you are rooted, look around there are a couple of custom kernels with wiregaurd support

Related

[DEV][TEMPLATE] Kerneller - Modify Ramdisk, dt, zImage, and SELinux on the fly

༼ つ ◕_◕ ༽つIn the name of our great lord Helix!༼ つ ◕_◕ ༽つ
Kerneller, a flashable Zip template for ramdisk modifications
Google what a kerneller is​
Many of you have no doubt heard of osm0sis' Anykernel2 and previously koush's Anykernel. Kerneller is an alternative designed solely around Sony's Xperia lineup, taking into account the 'recovery-inside-ramdisk' situation we've found ourselves in. However, the script should also support other devices such as Nexus. (I say should because I can only test on the Xperia devices I own -- if anyone could help test, I would be very grateful!)
And with the release of Android 5.0 Lollipop, users have been facing a dilemma: To download a permissive or enforcing version of the kernel? Kerneller fixes that issue by combining the two in a single zip using a slightly modified version of keycheck, allowing the user to choose what will be installed at the time of flashing.
Source: https://github.com/someone755/kerneller
Any questions, tips, or comments are welcome!
Credits & Thanks: All authors of the included binaries. osm0sis for AnyKernel2 and porting the binaries. koush for the original AnyKernel concept. Everyone who helped test. Myself5 for the inspiration and oshmoun for the help.
XDA:DevDB Information
Kerneller, Tool/Utility for the OEM Cross Device Development
Contributors
someone755
Version Information
Status: Stable
Created 2015-12-26
Last Updated 2015-12-31
This is something, i was expecting.
Thank you very much.
Black_Eyes said:
This is something, i was expecting.
Thank you very much.
Click to expand...
Click to collapse
I'm glad you like it but I can't say that's the reaction I was expecting lol. Please do let me know if anything bothers you though.
Just by the way, I moved the thing into its own repo and added a small script to compress and sign it. Cheers!
work for lock or un lock?thank you
xsj said:
work for lock or un lock?thank you
Click to expand...
Click to collapse
I'm sorry to say I don't understand the question. This script cannot lock or unlock anything.
It modifies the boot sector of your device. For that to be possible in the first place, you need an unlocked bootloader.
thank you,Im lockbootloader now,and that's what I want to know
Sorry for noob question,but where to download?Cant find the link.Want to try this on my m2 aqua.
mariosenta said:
Sorry for noob question,but where to download?Cant find the link.Want to try this on my m2 aqua.
Click to expand...
Click to collapse
Your best bet would be using 'git clone', though you can also just download the whole repo as a zip file (here, if you're having trouble finding it). Note though that the packing script won't work in Windows unless you have a *nix shell emulator (such as Cygwin or win-bash)!
You can still zip the thing together yourself using 7zip or WinRAR, however it will not be a signed zip (so some recoveries -- like Cyanogen Recovery -- may refuse to flash it, but you could use the bash script to figure out what you have to do in Windows to sign your new zip).
If you do eventually get it to run, I'd be very glad if you could send me the recovery.log of the flash via PM!
TouchWiz?
This tool works on touchwiz Lollipop 5.1.1 Roms or not?
Stock kernel is Enforcing and I tried various methods to make it permissive, nothing works
Pavan l said:
This tool works on touchwiz Lollipop 5.1.1 Roms or not?
Stock kernel is Enforcing and I tried various methods to make it permissive, nothing works
Click to expand...
Click to collapse
I don't know if your device's boot image is assembled using mkbootimg (like Nexus devices). If so, you may be able to.
But you'll need to pack the device tree binary and zImage into the zip (just use unpackbootimg).
So, I'm very confused, I usually build boot.imgs right out of the AOSP source code... how could I leverage this?
HaoZeke said:
So, I'm very confused, I usually build boot.imgs right out of the AOSP source code... how could I leverage this?
Click to expand...
Click to collapse
It's not really meant for people who compile ROMs, but more for kernel devs or testers who only compile the kernel.
Instead of always having to extract the ramdisk from boot images (whenever the ramdisk changes, which we kernel people can't know and check for every single kernel, nor do we care) and then using mkbootimg (meaning you have to release one boot image for every ramdisk you need to support, i.e. if you want to support ROMs with vastly different ramdisk implementations, where mixing ramdisks would cause a bootloop).
With this, you go around the problem. Compile the kernel outside of the ROM tree (which takes a few minutes vs several hours that compiling the entire ROM can take), grab the zImage-dtb (or adjust the script to use zImage + dt.img), and package the thing together. (There are options to also include kernel modules in the zip, and scripts that will compress and sign the zip for you.)
The highlight of this project used to be being able to switch Selinux status when flashing the zip, instead of adding androidboot.selinux=permissive for each boot image, and then uploading two images. Nowadays compatibility of this switch with various devices and Android versions is questionable (I can't test personally because of how limited Xperia devices have become recently -- the 3.10 kernel does not work with enforcing selinux), but the core idea of using it to avoid having to create boot images is still alive and kicking.

Custom kernel build (help needed)

I am trying to build a custom kernel for my redmi 2 running on Nexus Experience. I found there kernel source at their github page in nx_kernel_xiaomi_msm8916 . It's the only kernel referring to XIAOMI so I think it is the right one.
I am really new to kernel building. I read some tutorials on the web and tried building one for the stock miui rom but it didn't work out.
So before I start re-building the kernel for Nexus Experience I had some questions. I wanted to add the support for external wifi adapters based on RTL8188CUS. I found the option to enable it. My question is that , By just enabling that feature will my phone just start supporting the adapter out of the box or do I have to add some Modules to it.
And the last question, After I compile the kernel I get this zImage file. I put this file in the anyKernel.zip but I found that I also have to add the wlan.ko file and I couldn't find it....
I really need some help here.

[KERNEL] Coconut-Kernel (OOS-Oreo(5.x.x) (Pie test Kernel 9.0.3)

Coconut Kernel
Just a fancy name. Don't bother...
Please read the last post for pie kernel update.
Code:
***I'm not responsible for any problems that might occur flashing this kernel or what you do with the kernel support***
This kernel is only for stock Oxygen OS Oreo 5.x.x or any rom that supports stock kernel
This kernel was made for my own use as i could not find any working kernel with USB Wifi Adapter drivers supporting packet injection and monitor mode or simply Nethunter support.
I've been using ZaneZam's kernel for my nougat OOS. Since the Oreo version wasn't working for whatever reason, i tried to compile one my own.
My sole intention was to create a kernel with USB Wifi drivers and monitor mode/packet injection working. So this kernel doesn't have all those tweaks/options like other great kernels.
People who want upstreamed kernel with nethunter, drivedroid, android auto and stock features working can use this kernel on OOS Oreo.
Kernel has been upstreamed to 3.18.134(current)
Whats working?
- Stock features
- DriveDroid(CDROM Patch)
- USB Wifi adapters with monitor mode/packet injection
- AndroidAuto
Tested Working Wifi Adapters
1. TP Link WN-722N v1 (ath9271 chipset) - all ath9271 chipset should work
2. Alfa card AWUS036NHA (Atheros ath9271 Chipset)
3. Alfa card AWUS036NH (Ralink RT3070 Chipset)
Untested adapters
All adapters on nethunter support page have been added but not tested.
Installation
Download from attachment and flash the kernel zip file from recovery.
It is recommended to flash stock boot.img before flashing the zip.
Using USB Wifi Adapters
1. Reboot the device after flashing the zip
2. Goto Settings-->Advanced and turn on OTG Storage
3. Plugin your USB Wifi card and type ifconfig wlan1 up to test.
Keep in mind that OTG Storage turns off automatically after 10 mins on idle.
You don't need to insmod any modules as all drivers are built inline with the kernel.
Credits
Google
@ZaneZam for his support
Anykernel author
My friend @OscarAkaElvis (author of the great airgeddon tool to audit wireless networks), who tested the beta versions for me.
@nathanchance for his kernel compile and upstream guide
@flar2 for his source that i used to learn compiling at first
All others whose commits i've used
Source
https://github.com/OnePlusOSS/android_kernel_oneplus_msm8996
https://github.com/android-linux-stable/op3
Additional Note - I would like to mention that you can use tools like LinuxDeploy or other chroot supporting apps and the wifi adapters will work fine just like nethunter.
If you guys prefer ZaneZam's version, you can flash my kernel and then flash his kernel for oreo. Then everything will work on his kernel too. There is a small fix needed which will be applied on flashing my kernel.
Hi, I worked as beta tester for this kernel compilation and I must say is the best kernel ever for Oneplus3 I tried (in my opinion). All the standard functions are working flawlessly (wifi, camera, flashlight, etc...). No errors, no glitches. Gestures are working in order to enable camera or flashlight.
I tested the kernel also using Kali Nethunter, it works like a charm. I also installed a Linux using Linux Deploy app on which everything also was working fine.
Android Auto is fully working. Tested plugging it into real car (not emulators). Drive Droid is also working allowing to mount the drives without any problem. This is a feature that many custom kernels are not bearing in mind but for some people is an important stuff to be working. I use it every day.
And regarding the external usb cards. Yes, I tested it using a OTG (On-The-Go) cable. I can confirm that these two chipsets are working. In my case it was not a TP-Link card for Atheros chipset. I tested it using AWUS036NHA (Atheros ath9271 Chipset) Alfa wireless card and it worked very well supporting monitor mode, etc. I also tested it with another Alfa card AWUS036NH (Ralink RT3070 Chipset) and it worked fine too.
So congratz to de creator. This last month was a hard work. Good job. All the Oneplus3 users (like me) will be very grateful to you because of this.
Bro can you compile kernel for los based custom roms pie and oreo plz with nethunter support?,
ayanroy said:
Bro can you compile kernel for los based custom roms pie and oreo plz with nethunter support?,
Click to expand...
Click to collapse
I think ZaneZam has already done that. He builds for stock and lineage os. Did you check?
ayanroy said:
Bro can you compile kernel for los based custom roms pie and oreo plz with nethunter support?,
Click to expand...
Click to collapse
I thought there was a version already available for LOS oreo.
Since i was wrong, i compiled one. You can find it in the following thread.
https://forum.xda-developers.com/on...nel-coconut-kernel-lineage-15-1-oreo-t3902479
Pie version - maybe later
fredrickz said:
I thought there was a version already available for LOS oreo.
Since i was wrong, i compiled one. You can find it in the following thread.
https://forum.xda-developers.com/on...nel-coconut-kernel-lineage-15-1-oreo-t3902479
Pie version - maybe later
Click to expand...
Click to collapse
Thanks alot bro, will be waiting for your pie version
ayanroy said:
Thanks alot bro, will be waiting for your pie version
Click to expand...
Click to collapse
Did you check the oreo version? Or are you just waiting for the pie release?
For those who had this working can post here as a feedback.
very nice job! My TP-LINK WN722N is working just fine with nethunter!
Do you think it would be possible to add HID support to this kernel? To be able to execute HID/Bad USB attacks, that would be super cool!
hokyjack said:
very nice job! My TP-LINK WN722N is working just fine with nethunter!
Do you think it would be possible to add HID support to this kernel? To be able to execute HID/Bad USB attacks, that would be super cool!
Click to expand...
Click to collapse
I'll add that in the next version
I can confirm working monitor mode & injection on my Oneplus3 OOS Oreo with TP Link WN-722N v1 (ath9271 chipset). Nice work @fredrickz !
Limitscrw said:
I can confirm working monitor mode & injection on my Oneplus3 OOS Oreo with TP Link WN-722N v1 (ath9271 chipset). Nice work @fredrickz !
Click to expand...
Click to collapse
Can you suggest me a guide to install kalinethunter? i'm using magisk as root thx
scorpion90 said:
Can you suggest me a guide to install kalinethunter? i'm using magisk as root thx
Click to expand...
Click to collapse
u maybe can try to use one of my provided nethunter packs from here: https://www.androidfilehost.com/?w=files&flid=151160
which where done with this: https://github.com/zanezam/kali-nethunter and which has a little troubleshoot section in Readme at the end
for starting
Excellent kernel. Super performance and good battery life. I hope you make one for oxygen OS stock pie when it releases.
Didn't have one problem, aside from the horrendous Mtp-procedure install on this device(just got a Op3 recently).
Runs smooth, don't drain the battery like many Nethunter kernel from official side.
I hope this will expand in more then just a one-days development, because we need more of user who are beginning to programm etc.
I appreciate your effort and wanted to state that this kernel works without one single flaw whatsoever.. :silly:
UsPdSr said:
Didn't have one problem, aside from the horrendous Mtp-procedure install on this device(just got a Op3 recently).
Runs smooth, don't drain the battery like many Nethunter kernel from official side.
I hope this will expand in more then just a one-days development, because we need more of user wgo are beginning to programm etc.
I appreciate your effort and wanted to state that this kernel works without 1 flaw whatsoever.. :silly:
Click to expand...
Click to collapse
Thanks for the appreciation. Btw, I've already posted a pie version of the kernel with nethunter support built from holydragon sources. But it's not for OOS. It's for AOSP based roms. I'll try to compile a pie version when the official OOS sources are available.
Got my hands on an Alfa AWUS 036 NEH last week, and I am happy to report that monitor and injection are working just fine.
@fredrickz
Will u release one for pie?
metaspook said:
@fredrickz
Will u release one for pie?
Click to expand...
Click to collapse
I can compile from holydragon pie source.
fredrickz said:
I can compile from holydragon pie source.
Click to expand...
Click to collapse
Bro check your inbox...
metaspook said:
Bro check your inbox...
Click to expand...
Click to collapse
Hey i saw the message. But now I'm out of town. I'll message you when i return@metaspook

X compact stock kernel compilation

Hi all,
I like to try tweaking and hacking my phone. I've tried some ROMs on my kugo for some time, but I figured I wanted to make my own personalized build. Right now, I'd like to use the 'Night Light' app from F-Droid, which requires KCAL support. In order to enable KCAL I'd need to edit the stock kernel (I know this can be done, it was the case for Genesis Kernel on Nougat).
Hence I'd want to learn to compile a kernel, but I can't get to the end of Sony's tutorial. I've downloaded the kernel source but I am totally lost with defconfig files. How should I configure the kernel ? There is no obvious choice for a defconfig, and I can't get past point #6 in the tutorial..
Given that I've just discovered kernel compilation today, would someone be kind and take some time to maybe point me to useful doc, give me a clue as to what my next step could be, or teach me how they compile kernels for their device ?
Many thanks for any help,
Cheers
TLDR. How to compile a kernel? I have Sony's source for kugo, but don't understand how to configure the kernel compilation.

[SOLVED!] Bluetooth doesn't work after compiling a kernel based on LOS 18.1 sources.

I'm kinda new here, so please excuse me if this is not the best place to ask and it should instead be posted in another section.
First, a bit of context: I recently bought a refurbished H910 to practice android development since it was fairly cheap, and after testing its features and unlocking the bootloader to install custom roms, i opted to start compiling a kernel of my own with some changes to begin involving myself with the development side of things. For now, i am using the Lineage OS 18.1 kernel sources on github as a base for the kernel, then after making sure that the kernel compiled, i flashed it into the phone and basically everything works with the only exception being the bluetooth, and maybe the IR Blaster, but that one is working just like the stock kernels on different Android 11 roms.
Now getting to the issue itself in more details... it boils down to the phone's bluetooth refusing to turn on while running that custom kernel of mine on any Android 11 ROM, be it Lighthouse, Superior OS Xcalibur or Lineage 18.1, the bluetooth tile gets stuck on the "Turning on..." icon animation for a while and then returns to the disabled state. Reverting to the stock kernels or even using other custom kernels like Lyb's or Gamma make the Bluetooth work again without needing a wipe, which tells me that the problem is definitely somewhere in my kernel. I could of course test it on some Android 10 ROMs, but the outcome will most likely be the same.
I even took some logcats via ADB Shell but they are kind of broad and mostly explain that the service had some problems with "com.android.bluetooth service has died: psvc PER", followed by a "scheduled restart of crashed service com.android.bluetooth...". Both of which never happen on those ROM's stock kernels, where the bluetooth works as expected. I looked around on Lyb/Gamma kernel sources on github, and there aren't any major differences to the defconfigs for example with the bluetooth driver configuration also being just about the same.
I'm not sure if this will be of any help, but as for the toolchains and compilers, i am using clang 11.0.2 383902b1 as the main compiler, gcc 4.9 as the ARM32 cross-compiler, and gcc from 4.9 up to 10.3 as the AARCH64 cross-compiler, all running on Manjaro. I also changed that combination dozens of times, but to no avail.
So am i missing something during the compilation process? With all those things i already checked, i keep getting a feeling that something really simple is going over my head. Also, i can post the link to my github repository here if needed, there's a branch made specifically to check the BT since it has only the changes made to assure that the kernel compiles.
Edit: The problem was solved!!! It actually comes down to using the exact toolchains provided by the lineage OS source tree for the device (that might be optional, but it's how i managed to get it working) and checking if everything has been installed correctly. It seems some files failed to download the last time i did a 'repo sync' on the source and that was what might have caused this.

Categories

Resources