How do I build my own version of pershoot's kernel? - Galaxy Tab 10.1 Q&A, Help & Troubleshooting

Hi everyone,
The forum didn't let me post in the relevant thread, so I hope I'll get noticed here.
For starters, I've successfully built and used additional modules with pershoot's kernel so I have the basics down.
Next, I'd like to use oprofile, unfortunately oprofile can't be loaded as a module unless the kernel is rebuilt with profiling enabled. Inspired by this tutorial I built a full kernel, grabbed boot-cm_2636.4_ux-oc-xtra-vfpv3-d16_fp-091311.zip and replaced zImage, dhd.ko and scsi_wait_scan.ko in the zip and flashed it with CWM.
Unfortunately it doesn't work, when booting the tab shows the logo and padlock, there it gets stuck and nothing more happens. Using the original kernel config without any changes doesn't help either.
The procedure I used to build the kernel (using codesourcery 2010.09) is in short:
git clone git://github.com/pershoot/galaxy-2636.git
make pershoot_samsung_p4wifi-ux_defconfig
make -j8 ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
Kernel modules from the build can be insmoded and used on the device. Any suggestions on how to get the entire custom built kernel up and running is greatly appreciated.
/Lakristrolle

OPROFILE is already enabled in this kernel:
grep OPROFILE arch/arm/configs/pershoot_samsung_p*
arch/arm/configs/pershoot_samsung_p3_defconfig:CONFIG_HAVE_OPROFILE=y
arch/arm/configs/pershoot_samsung_p4lte_defconfig:CONFIG_HAVE_OPROFILE=y
arch/arm/configs/pershoot_samsung_p4-ux_defconfig:CONFIG_HAVE_OPROFILE=y
arch/arm/configs/pershoot_samsung_p4wifi_defconfig:CONFIG_HAVE_OPROFILE=y
arch/arm/configs/pershoot_samsung_p4wifi-ux_defconfig:CONFIG_HAVE_OPROFILE=y

Hi pershoot,
Tanks for your reply. That option doesn't enable oprofile, I have no idea what it does. This can easily be verified with "grep oprofilefs /proc/filesystems" on the tab, it comes up blank when running your kernel.
To enable it for real, add the following to the config:
CONFIG_PROFILING=y
CONFIG_OPROFILE=y (or m)
If you could do this in your kernel builds it would be awesome!
Otherwise, I'd really appreciate it if you can give some instructions or point me to a tutorial on how to make my own kernel.
/lakristrolle

i will enable profiling in the next update.

pershoot said:
i will enable profiling in the next update.
Click to expand...
Click to collapse
Thanks a million!
In the mean time I'll be off on the next adventure, finding or building the user-space oprofile tools.
/lakristrolle

Did we just get a second kernel dev! Hooray GT10 developers!
Feature request: I'd like the next kernel to "pop" and taste great smothered in butter.

Related

Kernel sources

I have a Garminfone and have done a lot of Rom hacking with it so far, enough that I want to port cyanogen to it now. In the config.gz file there are references to Garmin specific items... how do I go about figuring what is included in the kernel and if the stock one might work with the right config settings. I know that they load a few ko modules at boot, but I don't know the requirements for when they must release kernel sources and what to do with it if they do.
I know they have released some in the past for the a10 but not the a50, and none for the 2.1 build.
I do know that they use the 2.6.29 kernel so is there a chance that I could use the current kernel with froyo?
Any assistance would be appreciated.

[Q] Kernel Compiling

Hello! I just recently got a brand new MyTouch4GSlide ($5 from t-mobile xD) Anyhow since the lack of development going on for this phone I decided to join in and do my part... My original plan was to create a simple CM7 Kernel with support for UV and OC + Smartass... I have successfully in the past week set up my ubuntu virtual machine, kernel source, kitchen (boot.img extract/compile), voltage table & have successfully compiled a custom working kernel for my device, but i just need a bit of help.... I have 3 specific questions wich hopefully someone will be able to answer so I may get better with developing and continue developing in the future...
1) Adding new frequencies to the kernel
-I have created my voltage table and have added it to the file acpuclock-8x60.c (Which is corresponding to my device) located in /arch/arm/mach-msm O have also disabled the performance lock in the .config file using the make menuconfig command but when I compile the kernel and flash it setcpu does not recognize the frequencies... Did I not edit the correct file? Am I missing a lock placed by HTC somewhere else?
2) Adding Smartass
-I have found 1 source for the smartass module but whenever I try to compile the module I get #define OFS_KALLSYMS_LOOKUP_NAME 0xc009684c // kallsyms_lookup_name any reason why this is? am I using the wrong source? is there an easier way?
3) WiFi Module
-Whenever I compile my kernel the WiFi does not turn on... Probably because I have not compiled a Wifi module -_- but how can I compile a WiFi module? do I use the same source as the kernel? how would I go about doing this? how do I pack it with the boot.img?
Thats all for now... I shall edit this if I have more questions... I shall constantly be checking this thread hoping for some responses... I am eager to get this working!
Thanks in advanced! ~GiGoO
P.S. If you want you may add me on Skype if you would like to help me with this xD (robster105)
gigoo25 said:
Hello! I just recently got a brand new MyTouch4GSlide ($5 from t-mobile xD) Anyhow since the lack of development going on for this phone I decided to join in and do my part... My original plan was to create a simple CM7 Kernel with support for UV and OC + Smartass... I have successfully in the past week set up my ubuntu virtual machine, kernel source, kitchen (boot.img extract/compile), voltage table & have successfully compiled a custom working kernel for my device, but i just need a bit of help.... I have 3 specific questions wich hopefully someone will be able to answer so I may get better with developing and continue developing in the future...
1) Adding new frequencies to the kernel
-I have created my voltage table and have added it to the file acpuclock-8x60.c (Which is corresponding to my device) located in /arch/arm/mach-msm O have also disabled the performance lock in the .config file using the make menuconfig command but when I compile the kernel and flash it setcpu does not recognize the frequencies... Did I not edit the correct file? Am I missing a lock placed by HTC somewhere else?
2) Adding Smartass
-I have found 1 source for the smartass module but whenever I try to compile the module I get #define OFS_KALLSYMS_LOOKUP_NAME 0xc009684c // kallsyms_lookup_name any reason why this is? am I using the wrong source? is there an easier way?
3) WiFi Module
-Whenever I compile my kernel the WiFi does not turn on... Probably because I have not compiled a Wifi module -_- but how can I compile a WiFi module? do I use the same source as the kernel? how would I go about doing this? how do I pack it with the boot.img?
Thats all for now... I shall edit this if I have more questions... I shall constantly be checking this thread hoping for some responses... I am eager to get this working!
Thanks in advanced! ~GiGoO
P.S. If you want you may add me on Skype if you would like to help me with this xD (robster105)
Click to expand...
Click to collapse
Hey Rob, I wish you the best of luck and don't give up!
The one thing I can say is when I was compiling my own kernels a while back and when I was trying to do the exact same thing and add different frequencies, if I remember correctly, there is a couple files that need to be changed, not just one, but don't quote me on that
I would also try getting help from other phone developers too. Post in the Q&A section of the phones, you might get more help that way.
Other then that good luck!
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

Help: Understanding Basics of Building and Compiling?

Hi all,
In short i want to modify Android 4.2.2 on my MK802IIIS to allow me to use an external USB WIFI Adapter. The one i have uses a Ralink (MediaTek) RT5372 chipset.
I'm not a beginner, but by no means an expert. I have compiled firmware for my Linux based routers. But compiling Android, or parts of, seems much more complicated. I only want to add support for a USB adapter. Do i need to build the kernel from scratch, or can i create a module? Do i need to cross compile a module or can it be "made" in Ubunutu and just copied across?
I have searched for a RT5372.ko file online, finding references to RT5370, but i dont think it's the same.
I downloaded the driver from the Mediatek website and proceeded to attempt to create a .ko file by making it in Ubuntu but it only created a RT5372STA.dat file. Does this driver need to be cross compilied for android? Also how do i turn it in to a module that i can just load into my currently installed ROM?
I have been poking around for a while so i havent covered everhything i've tried. I'd really like to understand how building for Android works. If anyone can answer any of these questions for me, it'd help me imensely. Or if there is a resource covering these topics that i have yet to come across please point me at it. I know there are a lot of very detailed How-To's for compliling but i seem to get lost with the amount of detail.
Many thanks
More info regarding my setup:
Building in Ubuntu 14.04, 64bit.
The current ROM appears to have been built using the Linaro 4.6.2 toolchain, so u have downloaded that, currently stored in /home/wriggerz/RK3066/Toolchains
Also downloaded the RK3066 Kernel Source, stored in /home/wriggerz/RK3066/RK3066-Kernel
The RT5372 driver has been extracted to /home/wriggerz/RT5572NEW
I've been mashing bits of different guides and suggestions found on other forums together to try and frankenstien this KO module. From within the drivers folder i ran the two commands below. From what i've read this needs to be done to specify which "Toolchain" and "Compiler" to use.
Code:
export CROSS_COMPILE=~/home/wriggerz/rk3066/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
export ARCH=arm
Then i ran the make command like below to try and have the driver built for the correct Toolchain with the correct Compiler:
Code:
make ARCH=arm CROSS_COMPILE=arm-eabi-linaro-4.6.2
However i get the following response:
Code:
make -C tools
make[1]: Entering directory `/home/wriggerz/RT5572NEW/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/wriggerz/RT5572NEW/tools'
/home/wriggerz/RT5572NEW/tools/bin2h
cp -f os/linux/Makefile.6 /home/wriggerz/RT5572NEW/os/linux/Makefile
make -C /lib/modules/3.16.0-30-generic/build SUBDIRS=/home/wriggerz/RT5572NEW/os/linux modules
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-30-generic'
Makefile:652: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
make[1]: arm-eabi-linaro-4.6.2-gcc: Command not found
CC [M] /home/wriggerz/RT5572NEW/os/linux/../../common/crypt_md5.o
/bin/sh: 1: arm-eabi-linaro-4.6.2-gcc: not found
make[2]: *** [/home/wriggerz/RT5572NEW/os/linux/../../common/crypt_md5.o] Error 127
make[1]: *** [_module_/home/wriggerz/RT5572NEW/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.16.0-30-generic'
make: *** [LINUX] Error 2
Someone knowledgeable will hopefully look at the steps i have just taken to rip it to shreds...... :fingers-crossed:
If not, is there anyone with any ideas of where i'm going wrong?
I think i've put this in the wrong section....
If anyone has to go out of their way to move it they have my sincere apologies.
J Double You said:
I think i've put this in the wrong section....
If anyone has to go out of their way to move it they have my sincere apologies.
Click to expand...
Click to collapse
First of all, I would suggest to recompile the kernel and the entire source code (like when building CM), it is way better than insmodding modules every time, and you have less errors to solve. I'm currently writing a guide about building Cyanogenmod to support awus036h wireless adapter, maybe I can have a look for yours too, shouldn't be too hard. There are two or there good references around, however I'm trying to out all of them together in this new one I want to publish. Hope this will help you too.
Don't download a .KO from internet, it's not going to work. You would not only need to build for the specific device, but also for the specific kernel, which may vary from build to build, that's why I recommend to compile the whole kernel. Please consider to download a ROM's source code or your device kernel.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Thanks for the helpful response Ciuffy.
Before i ask any more potetnially stupid questions i will do some research on that approach. I look forward to seeing your guide. For now i may be back for some direction.
Thanks again
I do like the ROM i'm on at the minute. NeoTV CR 2.0 (4.2.2), works really well, snappier than others i;ve tried and the benchmark results are pretty good too, but there are a couple of issues with it:
Busybox isnt installed and doesnt install.
Commands dont seem to work in terminal.
Now it doesnt really matter, as i wont be Insmodding the driver now, but it would be nice to have. How do i stay as cose to my current ROM as possible while re-compiling? Do i need to contact the ROM creator and ask them for the source? Should it be available on the web somewhere? Or can i "rip" it off the device? My main goal is to add driver support to the kernel from the drivers srouce files. But it would be nice to have busybox installed too. Was thinking i might re-comile the whole rom, but that be like trying to run before i can stand..... But, learning is amazing, and i learn best by doing!!
Main question: Whats the easiest way to re-compile my current kernel? Do i need source files from the ROM creator? I have asked but havent had a repsonse yet, but it's only been about 16 hours, not even that.
J Double You said:
I do like the ROM i'm on at the minute. NeoTV CR 2.0 (4.2.2), works really well, snappier than others i;ve tried and the benchmark results are pretty good too, but there are a couple of issues with it:
Busybox isnt installed and doesnt install.
Commands dont seem to work in terminal.
Now it doesnt really matter, as i wont be Insmodding the driver now, but it would be nice to have. How do i stay as cose to my current ROM as possible while re-compiling? Do i need to contact the ROM creator and ask them for the source? Should it be available on the web somewhere? Or can i "rip" it off the device? My main goal is to add driver support to the kernel from the drivers srouce files. But it would be nice to have busybox installed too. Was thinking i might re-comile the whole rom, but that be like trying to run before i can stand..... But, learning is amazing, and i learn best by doing!!
Main question: Whats the easiest way to re-compile my current kernel? Do i need source files from the ROM creator? I have asked but havent had a repsonse yet, but it's only been about 16 hours, not even that.
Click to expand...
Click to collapse
Definetely, you should find the kernel source code, I think you can find it on Github, I'll give a look at it. I honestly don't think you can reverse engineer the kernel and recompile it.
Edit: I can't seem to find it. It is also possibile that the source code was not released.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Stupid Question: Is the SDK the same thing as the source?
If so i think i found what i need to build from scratch here: http://www.cnx-software.com/2013/08/20/rockchip-rk3066-android-4-2-2-hdmi-tv-stick-sdk-leaked/
If thats right, i need to find a way to add the driver i found to the source so it's included in the compilation.
Boom, think i found my base... And answered my previous question. SDK is not source.
http://freaktab.com/forum/tv-player...73-full-1080p-modded-kit-kat-4-4-2-rk3066-rom
The OP kindly links to the kernel source.
Apologies for spamming my own thread, i like to keep anyone watching up to date with progress so they dont waste their time replying to old stuff.
J Double You said:
Boom, think i found my base... And answered my previous question. SDK is not source.
http://freaktab.com/forum/tv-player...73-full-1080p-modded-kit-kat-4-4-2-rk3066-rom
The OP kindly links to the kernel source.
Apologies for spamming my own thread, i like to keep anyone watching up to date with progress so they dont waste their time replying to old stuff.
Click to expand...
Click to collapse
SDK stands for Software Development Kit, in other words the environment that lets you build applications and related for a specific platform.
So, you found the source you were looking for?
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Sure did, i also now know which compiler i need.... arm-linux-gnueabi-4.7.
Now to find out how to add the driver i have downloaded to the kernel.
From what i've read i need to "make" the driver, cross compiling in the process, then put some of the resulting files in situ within the kernel source. (along these lines: http://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code).
J Double You said:
Sure did, i also now know which compiler i need.... arm-linux-gnueabi-4.7.
Now to find out how to add the driver i have downloaded to the kernel.
From what i've read i need to "make" the driver, cross compiling in the process, then put some of the resulting files in situ within the kernel source. (along these lines: http://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code).
Click to expand...
Click to collapse
Excuse me, are you then going to compile the enitre kernel? Waiting for your answer, there should be an easier way to do this.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
I was going to, based on your suggestion to compile from scratch, but i have most likely mis-understood what it was you were getting at.
Also, i have downloaded a bunch of toolchains and i have arm-linux-androideabi-4.7, but is that the same as arm-linux-gnueabi-4.7
Again, i could be barking up the completely wrong tree. Which is a shame, as i thought i was actually getting somewhere..... hahaha!
As always, your continued input is greatly appreciated Ciuffy.
J Double You said:
As always, your continued input is greatly appreciated Ciuffy.
Click to expand...
Click to collapse
Yes, I was in fact suggesting you to build from scratch, thinking you could include modules for your adapter in the kernel configuration. However, I can't find what kernel module is exactly going to do it. I found rt2800usb, however I am not sure. You may try to include support for rt2800 and also build the kernel module from the driver source code, as explained in that link for example.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Ciuffy said:
Yes, I was in fact suggesting you to build from scratch, thinking you could include modules for your adapter in the kernel configuration. However, I can't find what kernel module is exactly going to do it. I found rt2800usb, however I am not sure. You may try to include support for rt2800 and also build the kernel module from the driver source code, as explained in that link for example.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Click to expand...
Click to collapse
Ah.... I have downloaded the Linux driver from the MediaTek websitefor the RT5372, but it needs "making". Would cross compiling the driver not give me the modules i need to load in to the kernel?
That link explains how to add the required files, but doesnt explain how they're created. I dont think....
J Double You said:
Ah.... I have downloaded the Linux driver from the MediaTek websitefor the RT5372, but it needs "making". Would cross compiling the driver not give me the modules i need to load in to the kernel?
That link explains how to add the required files, but doesnt explain how they're created. I dont think....
Click to expand...
Click to collapse
If by cross compiling you mean building the kernel module while also compiling the source code and then loading it in the running kernel, yes, as long as you downloaded the drivers compatible with the Linux kernel on your Android.
You can either use the instruction on that link on StackExchange, or follow the "How to build them?" section here:
http://forum.xda-developers.com/showthread.php?t=1455382
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Thanks Ciuffy.
Seems i've still got some stuff to get my head around. I'll re-read up and come back.
FAIL!!!
Tried flashing the unit with the ROM i was going to compile a kernel for. Looked to go well, but wouldn't boot past the boot splash screen. And after rebooting wouldnt boot at all. Obviously some fundamental incompatibility, or the fact that it cant handle the overclock....
Problem is i have previously broken the OTG port so i have no way to flash using ADB, not until i get a cable soldered in it's place.
Really just wanted to explain why i may be absent from this topic for a bit. I'm going to make some calls to see if any nearby electronics shops can do the job. Once done i'll be back.
J Double You said:
FAIL!!!
Tried flashing the unit with the ROM i was going to compile a kernel for. Looked to go well, but wouldn't boot past the boot splash screen. And after rebooting wouldnt boot at all. Obviously some fundamental incompatibility, or the fact that it cant handle the overclock....
Problem is i have previously broken the OTG port so i have no way to flash using ADB, not until i get a cable soldered in it's place.
Really just wanted to explain why i may be absent from this topic for a bit. I'm going to make some calls to see if any nearby electronics shops can do the job. Once done i'll be back.
Click to expand...
Click to collapse
In case you misunderstood: I just wanted to point out that once compiled the kernel modules along with the kernel, you don't keed to flash the kernel, only insmod the modules.
Hope you can solve the OTG problem, waiting for your response.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.

Questions about kernel

Hey guys,
So I've been searching around for a while now and I could not find any updated guide on porting/building custom kernels. I need a lot of help for this, as I am completely new and do not know anything to do with kernel stuff. I do my part by finding out whats a ramdisk and stuff, but please pardon me if I ask very stupid questions which may give you cancer.
I asked quite a few people, but all those don't reply. I won't list names, but just to let you know I tried.
Anyways, my problem here is I want to port a kernel which isn't available for my device, i9305. First kernel I want to try porting is boeffla kernel. Here is the repo --> https://github.com/n0aaz/boeffla-kernel-cm-s3/tree/boeffla13.0_u600 I am continuing off @aaz03 's work, as his laptop spoilt or something. In the first place, when I tried to use the script bbuild.sh, the terminal window immediately closes after a bunch of stuff happened and I cannot find the .zip. I don't even know if there's an error in building because terminal window immediately closes after a huge bunch of text showed up
I would also want to port other kernels in the future but I guess I'll get some basic knowledge of kernels first.
Thanks,
limjh16
limjh16 said:
Hey guys,
So I've been searching around for a while now and I could not find any updated guide on porting/building custom kernels. I need a lot of help for this, as I am completely new and do not know anything to do with kernel stuff. I do my part by finding out whats a ramdisk and stuff, but please pardon me if I ask very stupid questions which may give you cancer.
I asked quite a few people, but all those don't reply. I won't list names, but just to let you know I tried.
Anyways, my problem here is I want to port a kernel which isn't available for my device, i9305. First kernel I want to try porting is boeffla kernel. Here is the repo --> https://github.com/n0aaz/boeffla-kernel-cm-s3/tree/boeffla13.0_u600 I am continuing off @aaz03 's work, as his laptop spoilt or something. In the first place, when I tried to use the script bbuild.sh, the terminal window immediately closes after a bunch of stuff happened and I cannot find the .zip. I don't even know if there's an error in building because terminal window immediately closes after a huge bunch of text showed up
I would also want to port other kernels in the future but I guess I'll get some basic knowledge of kernels first.
Thanks,
limjh16
Click to expand...
Click to collapse
Told you in private : launch the script using
Code:
sudo ./bbuild.sh
The terminal closing problem is due to a syntax error.
Also the kernel, first time I managed to build it was booting, not working, it booted until lockscreen and then immediately bootloop. Will upload the faulty kernel for those who want to try, for every dev/contributer that can help please come and let us make a glorious boeffla kernel
The boeffla I built is from zanezam's custom for i9300 and everything is on my github.
EDIT: make a thread in i9305 Q&A, no one gives a shirt about i9305 here and we will be more visible to i9305 users
aaz03 said:
Told you in private : launch the script using
Code:
sudo ./bbuild.sh
The terminal closing problem is due to a syntax error.
Also the kernel, first time I managed to build it was booting, not working, it booted until lockscreen and then immediately bootloop. Will upload the faulty kernel for those who want to try, for every dev/contributer that can help please come and let us make a glorious boeffla kernel
The boeffla I built is from zanezam's custom for i9300 and everything is on my github.
EDIT: make a thread in i9305 Q&A, no one gives a shirt about i9305 here and we will be more visible to i9305 users
Click to expand...
Click to collapse
Nope, I tried and the terminal still dies.
Anyways I posted here because not only boeffla I also want to port AK. But boeffla first since the "base" has been set I guess...
edit: I'll make a thread in i9305 Q&A tmr, no time today.
limjh16 said:
Nope, I tried and the terminal still dies.
Anyways I posted here because not only boeffla I also want to port AK. But boeffla first since the "base" has been set I guess...
edit: I'll make a thread in i9305 Q&A tmr, no time today.
Click to expand...
Click to collapse
Here the booting boeffla I built : https://mega.nz/#!PEh2mTCL!jvkZ-xaDXiMlymTUMxeObZ471-d_9kCGP2xAYF67Pmw it will probably help
Hello,
I asked Boeffla once and he told me to pick all commits from his Boeffla Kernel to your kernel. At your site, I would start with adding some custom Governos. And after that pick some schedulers.
Clone your kernel (git clone)
Fetch the other kernel repo (git fetch)
Pick the commit (git cherrz-pick)
Push the commit (git push)
Then you will see n0aaz committed with Trafalgar-Square (your username) on date in GitHub.
Trafalgar Square said:
Hello,
I asked Boeffla once and he told me to pick all commits from his Boeffla Kernel to your kernel. At your site, I would start with adding some custom Governos. And after that pick some schedulers.
Clone your kernel (git clone)
Fetch the other kernel repo (git fetch)
Pick the commit (git cherrz-pick)
Push the commit (git push)
Then you will see n0aaz committed with Trafalgar-Square (your username) on date in GitHub.
Click to expand...
Click to collapse
Yeah I agree this is a normal procedure for a kernel port but for us it isn't really a port as the i9300 and the i9305 share the same smdk4412 source with very few differences so you can easily recycle the folder and I take as proof that it is booting. Plus I have zero knowledge about standalone kernel building so I'm happy with the boeffla building script...

Need help with errors when compiling kernel from source.

So, I recently got a ASUS Zenfone 4 Selfie Pro, the phone is stuck on android 7.1 and doesn't have any roms, nothing, just TWRP. So I'm on a journey trying to build stuff for this device from the ground up, I already made a device tree based on Zenfone 3 (which has the same SoC) and I tried to build lineage/cyanogenmod 14.1 for it and got a lot of kernel errors, so I went to try to compile the kernel from the source ASUS gave on their website and uploaded it to my github. In this past 3 days was able to fix and workaround some of the errors I got while building, but now I'm stuck on this one: https://hastebin.com/iqisuzegeg.coffeescript | any help would be greatly apreciated .
For easier access to the kernel source I uploaded it to my github and made some fixes/workarounds for some errors: https://github.com/2003Frost/android_kernel_asus_Z01M_stock
I'm using Linaro 7.5.0 as arm64 toolchain.
I'm using Zorin OS 15.2 as OS.
If any more information is needed I'll be glad to give out.
0
Seppppx said:
Hmm. There is probably no definition for 'drivers/platform' and 'drivers/platform/msm' . But there is a reference (probably). Also have you tried to build the kernel with the defconfig "the manual way". If there is something wrong with the kernel I have almost no way of helping you because I'm not a real developer.
EDIT : There is a kernel source for your phone that on a developer's github https://github.com/shakalaca/android_kernel_asus_zd552kl . That is also the person who is the maintainer for official twrp. He has some large commits on the kernel so his kernel should build.
Click to expand...
Click to collapse
I already tried his kernel and got the same exact error :/
I didn't understand fully what you said with "the manual way" but I'm trying to compile the kernel outside the rom build environment, by using my device's defconfig and compiling with linaro.
0
Seppppx said:
By the manual way I mean the with the defconfig. Also I made a pull request to your Device Tree (adds persist partition and Shakalaca's kernel).
Also if you're trying to build with defconfig there is a tutorial by google. https://source.android.com/setup/build/building-kernels-deprecated .
After that you will have to put it to the boot image. Another guide for that. https://source.android.com/setup/build/building-kernels#embedding-into-Android .
Edit : Isn't the Android kernel build with the defconfig when you run a source build? I think it actually builds the kernel when you build android so you don't build the kernel separately.
Click to expand...
Click to collapse
I accepted your pull request. Yes when you build a rom from source it also compiles the kernel, but I wasn't able to build the rom because it gave me kernel errors, so I went and started compiling separately because it's easier to fix kernel errors like this.
I am not using Google's tutorial, I'm following one that has almost the same steps and I'm using the same toolchain.
0
Seppppx said:
By toolchain you mean tools that you need to compile a kernel? Why doesn't one just install the tools needed to compile a kernel source.
The guide I linked doesn't specify any toolchain (thus idk if I need one). It also doesn't have anything to do with build.sh script used to compile a kernel. Instead it uses the defconfig. The commands are actually very simple.
cd kernel-source_code
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-android-
make ZD552KL-Phoenix_defconfig
make
Also have you tried to build another kernel that you are sure builds? If another kernel builds. The issues have to do something with the kernel itself. If it does not it's most likely something else.
Click to expand...
Click to collapse
To compile a kernel from source you need something a cross compiler or toolchain in my case I'm actually using the exact same commands you commented with linaro toolchain/cross compiler (aarch64-linux-android). As far as I know you need that to compile a kernel and I don't think the toolchain is the problem but the kernel itself. I can try another kernel later to see if it compiles.
0
Seppppx said:
Okay thanks!
If you manage to compile the kernel for your device make sure to mention/quote me. I would like to contribute. I'm on my way to make another pull request (now about cameras).
Click to expand...
Click to collapse
If you want to talk to me more quickly you can message me on telegram https://t.me/Frost_2003
0

Categories

Resources