• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[DEV] Compiled Stock Kernel + Sources

Status
Not open for further replies.
Search This thread

mKenfenheuer

Member
Jul 20, 2014
29
59
Compiled Stock Kernel + Sources

*insert usual disclaimer here*
I AM NOT RESPONSIBLE FOR ANY DAMAGE TO YOUR DEVICE. USE AT YOUR OWN RISK. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Testing? What will work?

Bugs:
- You tell me

INSTRUCTIONS
0. MAKE BACKUP
1. Download zip file
2. Download Magisk
3. Download Magisk fix
4. Flash Magisk
5. Flash Magisk fix
6. Flash Kernel zip

Resources:
SOURCE CODE
DOWNLOAD {Mod edit}

Credits:
karthick111
@datty
 
Last edited by a moderator:

datty

Member
Feb 21, 2006
15
10
www.datty.co.uk
Hi mKenfenheuer, thanks for the credit.

I'm at the same point, I can get the kernel to build but no boot. I get dropped back to fastboot immediately after trying to boot.
I've tried flashing a blank vbmeta, but it didn't seem to help. I'm not sure if it is the AVB2.0 blocking the boot or something else.

I've noticed you've changed OPPO_TARGET_DEVICE to MSM_19061. How did you decide on that value? I've since been using MSM_19781 as that is the value of getprop ro.product.prjversion from my device (Malaysian version)
 

mKenfenheuer

Member
Jul 20, 2014
29
59
Hi mKenfenheuer, thanks for the credit.

I'm at the same point, I can get the kernel to build but no boot. I get dropped back to fastboot immediately after trying to boot.
I've tried flashing a blank vbmeta, but it didn't seem to help. I'm not sure if it is the AVB2.0 blocking the boot or something else.

I've noticed you've changed OPPO_TARGET_DEVICE to MSM_19061. How did you decide on that value? I've since been using MSM_19781 as that is the value of getprop ro.product.prjversion from my device (Malaysian version)


Same behaviour for me. I've started with the target device mentioned in your repo, then changed to 19781, afterwards i've been trying out the ones from drivers/input/oppo_fp_driver/Makefile. I've just been stuck at 19061 since it was the last one i've tried, there is no specific reason for that.

I've not been working with devices with AVB 2.0 - i can see that my device is displaying "Secureboot enabled" in fastboot. As far as i can say this would be a pretty good reason for the device to refuse booting the new kernel as our kernel is probably not signed.

I'll look into signing the kernel with the dev key in the repo root. Maybe this helps. If not we would problaby need another solution to get around the secure boot.
 

datty

Member
Feb 21, 2006
15
10
www.datty.co.uk
I've made some progress, I can get the kernel to try to boot but I'm stuck at the realme logo without adb to debug what is wrong.

If you're using the kernel config extracted from the device, add the following config option.
CONFIG_BUILD_ARM64_DT_OVERLAY=y

I'm not sure if this is also necessary but I generated a new dtbo.img to flash from the compiled kernel.
You'll need mkdtboimg.py and you can run the following from the out/arch/arm64/boot directory after compilation.
python mkdtboimg.py create dtbo.img dts/*/*.dtbo
 

mKenfenheuer

Member
Jul 20, 2014
29
59
I've made some progress, I can get the kernel to try to boot but I'm stuck at the realme logo without adb to debug what is wrong.

If you're using the kernel config extracted from the device, add the following config option.
CONFIG_BUILD_ARM64_DT_OVERLAY=y

I'm not sure if this is also necessary but I generated a new dtbo.img to flash from the compiled kernel.
You'll need mkdtboimg.py and you can run the following from the out/arch/arm64/boot directory after compilation.
python mkdtboimg.py create dtbo.img dts/*/*.dtbo

Unfortunately i cannot. even with the config option i am still not able to get it booting.
I have created a repo to reflect how i am building the kernel and making the boot img + dtbo img.

https://github.com/mKenfenheuer/realme-X2Pro-kernel-build

Am i missing something? Also i assume that my generated dtbo.img is bad, as soon as i flash it, i cannot even boot to recovery.
 
  • Like
Reactions: John Amin

datty

Member
Feb 21, 2006
15
10
www.datty.co.uk
Unfortunately i cannot. even with the config option i am still not able to get it booting.
I have created a repo to reflect how i am building the kernel and making the boot img + dtbo img.

https://github.com/mKenfenheuer/realme-X2Pro-kernel-build

Am i missing something? Also i assume that my generated dtbo.img is bad, as soon as i flash it, i cannot even boot to recovery.

Try using the Image-dtb file rather than the plain Image to add to boot.img. You might need to change your make line to the following to get it to generate:

make -j$(nproc --all) O=out CC=clang CLANG_TRIPLE=aarch64-linux-gnu- Image-dtb dtbs

For the dtbo.img, it looks like you're adding *.dtb rather than *.dtbo.

I'll try and upload my build scripts later tonight, I'm at work at the minute and can't get to them.

I've made a little more progress, I've managed to get adb to come up at early boot so I can get a logcat and shell. The kernel looks to be failing on the audio and wireless at the minute from what I can see.

Thanks for the pointer to arter97's kernel. I can see where I've missed adding the external wifi module in, I'll give that a go and hopefully it gets a little further.
 

mKenfenheuer

Member
Jul 20, 2014
29
59
Try using the Image-dtb file rather than the plain Image to add to boot.img. You might need to change your make line to the following to get it to generate:

make -j$(nproc --all) O=out CC=clang CLANG_TRIPLE=aarch64-linux-gnu- Image-dtb dtbs

For the dtbo.img, it looks like you're adding *.dtb rather than *.dtbo.

I'll try and upload my build scripts later tonight, I'm at work at the minute and can't get to them.

I've made a little more progress, I've managed to get adb to come up at early boot so I can get a logcat and shell. The kernel looks to be failing on the audio and wireless at the minute from what I can see.

Thanks for the pointer to arter97's kernel. I can see where I've missed adding the external wifi module in, I'll give that a go and hopefully it gets a little further.

My kernel is booting now, but wifi and aod are causing issues.
As for now, the zip requires magisk to be flashed first.

I've had some chat with other devs working on our devices kernel in the official telegram group, they're in touch with realme, realme will release their wifi driver from qualcomm soon on their github.

Credits for getting me up to here go to karthick111 from the telegram group.
 

Attachments

  • realme-x2pro-kernel-20200210_224714.zip
    16.4 MB · Views: 76
Last edited:

mKenfenheuer

Member
Jul 20, 2014
29
59
Great news! Turns out that the changes by realme actually fix the AoD and the reason why the kernel was not booting was my fault, i still had unfinished changes regarding SafetyNet which got compiled and caused the kernel to panic (i'd do that too if i were him).

So the current status is that now all main functionalities work as i was able to fix wifi too (with a little help of arter97).

All changes can be found in my github repo so feel free to fork!
 

John Amin

Senior Member
Apr 19, 2017
225
85
Great news! Turns out that the changes by realme actually fix the AoD and the reason why the kernel was not booting was my fault, i still had unfinished changes regarding SafetyNet which got compiled and caused the kernel to panic (i'd do that too if i were him).

So the current status is that now all main functionalities work as i was able to fix wifi too (with a little help of arter97).

All changes can be found in my github repo so feel free to fork!

Good job ,that's a good news Go on
If I may ask after you finish working in the kernel would it be easy to build custom roms with the help of your kernel ,Thanks to you
 
  • Like
Reactions: pkpkpkpkpkpk

asusgarb

Senior Member
Jul 4, 2010
1,781
346
Hi. Thank you for your kernel. I'm a bit noob about kernel, so it's difficult to me understand kernel's features. What's this kernel different then the stock one?
 
  • Like
Reactions: pkpkpkpkpkpk

mKenfenheuer

Member
Jul 20, 2014
29
59
Is the FP issue an kernel related issue? Or overlay?

What do you mean by FP issue? In case you are refering to the issues with GSI's, check out the issues on phhussons github:
https://github.com/phhusson/treble_experimentations/issues/1103

The cause of this is Realme/Oppo not sticking to standards and of course the fact that the in display fp reader is quite new and does not have any generic stock implementation yet.


So TL;DR its not a kernel issue. Phhusson is working on this with Google.
 

pkpkpkpkpkpk

New member
Aug 12, 2018
1
0
realme x2pro cm rom

---------- Post added at 12:22 PM ---------- Previous post was at 12:17 PM ----------

Good job ,that's a good news Go on
If I may ask after you finish working in the kernel would it be easy to build custom roms with the help of your kernel ,Thanks to you
sir videos
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 12
    Compiled Stock Kernel + Sources

    *insert usual disclaimer here*
    I AM NOT RESPONSIBLE FOR ANY DAMAGE TO YOUR DEVICE. USE AT YOUR OWN RISK. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


    Testing? What will work?

    Bugs:
    - You tell me

    INSTRUCTIONS
    0. MAKE BACKUP
    1. Download zip file
    2. Download Magisk
    3. Download Magisk fix
    4. Flash Magisk
    5. Flash Magisk fix
    6. Flash Kernel zip

    Resources:
    SOURCE CODE
    DOWNLOAD {Mod edit}

    Credits:
    karthick111
    @datty
    8
    Great news! Turns out that the changes by realme actually fix the AoD and the reason why the kernel was not booting was my fault, i still had unfinished changes regarding SafetyNet which got compiled and caused the kernel to panic (i'd do that too if i were him).

    So the current status is that now all main functionalities work as i was able to fix wifi too (with a little help of arter97).

    All changes can be found in my github repo so feel free to fork!
    7
    Try using the Image-dtb file rather than the plain Image to add to boot.img. You might need to change your make line to the following to get it to generate:

    make -j$(nproc --all) O=out CC=clang CLANG_TRIPLE=aarch64-linux-gnu- Image-dtb dtbs

    For the dtbo.img, it looks like you're adding *.dtb rather than *.dtbo.

    I'll try and upload my build scripts later tonight, I'm at work at the minute and can't get to them.

    I've made a little more progress, I've managed to get adb to come up at early boot so I can get a logcat and shell. The kernel looks to be failing on the audio and wireless at the minute from what I can see.

    Thanks for the pointer to arter97's kernel. I can see where I've missed adding the external wifi module in, I'll give that a go and hopefully it gets a little further.

    My kernel is booting now, but wifi and aod are causing issues.
    As for now, the zip requires magisk to be flashed first.

    I've had some chat with other devs working on our devices kernel in the official telegram group, they're in touch with realme, realme will release their wifi driver from qualcomm soon on their github.

    Credits for getting me up to here go to karthick111 from the telegram group.
    3
    Hi. Thank you for your kernel. I'm a bit noob about kernel, so it's difficult to me understand kernel's features. What's this kernel different then the stock one?

    It's a work in progress to have a working kernel base for our phone which will then be useful for other people to build their own customized kernel with it.
    3
    Realme kernel source code got updated. Any great news?

    No. I've imported the changes by realme, things got worse. Now the kernel is not booting anymore.
    I'll look into this once i've got more time