FORUMS
Remove All Ads from XDA

[REFERENCE] How to compile an Android kernel

13,728 posts
Thanks Meter: 50,760
 
By nathanchance, Recognized Developer / Recognized Contributor on 26th June 2017, 04:38 AM
Post Reply Email Thread
9th September 2019, 08:49 PM |#621  
spezi77's Avatar
Recognized Developer / Contributor
Flag /home/xda
Thanks Meter: 6,950
 
Donate to Me
More
Hey there,
I am compiling my rom for marlin. Clang kernel is compiled inline. After I have reinstalled my build machine with Debian I get a segmentation fault and the build fails.. On my old distro (Deepin) the segmentation fault was also occurring but the build never failed, and the rom worked like a charm.

Here's my log: https://del.dog/irebegutaf.coffeescript

Edit: please do not pay attention to my issue. I have solved it. After upgrading gnu make on my machine the issue was gone.
 
 
10th September 2019, 03:19 AM |#622  
Junior Member
Thanks Meter: 0
 
More
Hi
After searching and information I have managed to compile a kernel for the Galaxy A50
But but I can't find the lines to disable dm verify, knox, tima this is very rare can I add the line to my defconfig to disable it?
Thanks you
16th September 2019, 09:43 PM |#623  
Member
Thanks Meter: 18
 
More
Hello i do compile kernel since 2.2 came out on linux, but it's my first time doing it on android. I read your guide and several (outdated and not) others.
i'm trying to update the kernel of my device. It's an Elephone P9000, Mediatek cpu (MT6755 + MaliT860).
Kernel version i tryed are the official linux stable 5.2.11 (it's probably a long shot, i know ) and to official google's git branch "common-android-4.19" .
I can compile both of them, their modules... (since there is no defconfig for my device, i selected the single options, maybe here is the issue. did i miss something? (attached the defconfig i created)
I had troubles at beginning with verified boot, and if i understood correctly there are 2 version. VB 1.0 and AVB 2.0. My device when i unpack falls under the 1st version.
I tried AIK, superr to upack and repack the official bootloader but i was stuck on bootloop on the first logo. (First logo is Elephone symbol, second is the android loading animation)
I then found that Android_boot_image_editor works for me (https://github.com/cfig/Android_boot_image_editor) and the official stock rom will recompile without any problem.
I substituted the kernel in the unpacked bootloader, added the modules in the ramdisk. I repacked (a signed image is created) and flashed.
It just looks like the previous rom, same kernel boot parameters, same file format (Android , not ext4)
It gets stuck on the first boot animation. I don't have any error, not one i can read atleast.
I would like to provide more informations, but i'm actually asking you if you can give me an advice about how to have some sort of log or you have an idea what i possibly mess up.
is there a serial port i can read boot informations? can i remove the bootlogo in some way and have (my loved) linux boot text?
Thank you for your attention


P.S.
Twrp is already installed and works with any of the boot image i flash (as it should beeing in another partition)
I did enable Android options in the kernel config, and i did enable ext2/4 + mtd to be able to mount the real root.
I did format cache and dalvik partitions
bootloader is unlocked
flashboot doesn't work on mtk, i'm using sp_flash_tool (latest version on linux) with his scatter file

P.P.S.
toolchain versions shouldn't matter since compilation do not fail... but anyway...
i used the one in the guide (https://android.googlesource.com/pla...x-android-4.9/) for 5.2.11
and the one that is automatically selected with git source from google's git with "clang-r353983c"

My aim is to have an updated bootloader i can use with GSI or learn how android boot works in detail, and next to this kernel i'll update the one on my tablet (another MTK).
Unfortunally MTK configs are not upstreamed, and there is a lack of ORGANIZED source code.
Attached Files
File Type: txt p9000_defconfig.txt - [Click for QR Code] (121.0 KB, 0 views)
17th September 2019, 12:54 AM |#624  
attack11's Avatar
Senior Member
Flag Buenos Aires
Thanks Meter: 2,260
 
Donate to Me
More
Quote:
Originally Posted by darklight2k2

Hello i do compile kernel since 2.2 came out on linux, but it's my first time doing it on android. I read your guide and several (outdated and not) others.
i'm trying to update the kernel of my device. It's an Elephone P9000, Mediatek cpu (MT6755 + MaliT860).
Kernel version i tryed are the official linux stable 5.2.11 (it's probably a long shot, i know ) and to official google's git branch "common-android-4.19" .
I can compile both of them, their modules... (since there is no defconfig for my device, i selected the single options, maybe here is the issue. did i miss something? (attached the defconfig i created)
I had troubles at beginning with verified boot, and if i understood correctly there are 2 version. VB 1.0 and AVB 2.0. My device when i unpack falls under the 1st version.
I tried AIK, superr to upack and repack the official bootloader but i was stuck on bootloop on the first logo. (First logo is Elephone symbol, second is the android loading animation)
I then found that Android_boot_image_editor works for me (https://github.com/cfig/Android_boot_image_editor) and the official stock rom will recompile without any problem.
I substituted the kernel in the unpacked bootloader, added the modules in the ramdisk. I repacked (a signed image is created) and flashed.
It just looks like the previous rom, same kernel boot parameters, same file format (Android , not ext4)
It gets stuck on the first boot animation. I don't have any error, not one i can read atleast.
I would like to provide more informations, but i'm actually asking you if you can give me an advice about how to have some sort of log or you have an idea what i possibly mess up.
is there a serial port i can read boot informations? can i remove the bootlogo in some way and have (my loved) linux boot text?
Thank you for your attention


P.S.
Twrp is already installed and works with any of the boot image i flash (as it should beeing in another partition)
I did enable Android options in the kernel config, and i did enable ext2/4 + mtd to be able to mount the real root.
I did format cache and dalvik partitions
bootloader is unlocked
flashboot doesn't work on mtk, i'm using sp_flash_tool (latest version on linux) with his scatter file

P.P.S.
toolchain versions shouldn't matter since compilation do not fail... but anyway...
i used the one in the guide (https://android.googlesource.com/pla...-android-4.9/) for 5.2.11
and the one that is automatically selected with git source from google's git with "clang-r353983c"

My aim is to have an updated bootloader i can use with GSI or learn how android boot works in detail, and next to this kernel i'll update the one on my tablet (another MTK).
Unfortunally MTK configs are not upstreamed, and there is a lack of ORGANIZED source code.

Linux kernel in android isn't like pcs,you can't upgrade your kernel just like that just modifying your defconfig, what you want to do is imposible,your best bet it's just upstream your kernel to the latest 3.18 release
17th September 2019, 02:05 AM |#625  
Member
Thanks Meter: 18
 
More
i'm not expecting all to be working (gps, and everything else is actually needing a vendor driver) but since 3.18 some drivers have been released from MTK. and i'm curious to see which point is possible to reach.
Either way i will need to upgrade the bootimage to give the correct interfaces to a GSI

edit.
even if 5.2.11 will not work it should still be possible to boot to a shell like linux, with just generic drivers
right now i'm trying to see if i'm able to pass the bootloader stage with a compiled 3.18 kernel.
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