Many2 Errors while building nethunter kernel for redmi 6 - Xiaomi Redmi 6 Questions & Answers

I Use GCC Toolchain From NDK r16b
I patch some thing on my kernel : mac80211 injection,HID patch,ath9k naming error,rtl88xx driver,and rtl8188eus driver
this is the full log of my "make O=../out -j2" command : here

Related

compiling Linux kernel for Samsung Galaxy 5 : compiled zImage doesn't work

I am trying to compile Linux kernel for my Samsung Galaxy 5 with full Netfilter support:
The phone specifications are:
Code:
Model number : GT-I5503
Firmware version : 2.1-update1
Baseband version : I5503DDJG5
Kernel version : 2.6.29-perf [email protected] #5
Build number : ERE27
I downloaded **GT-I5500_OpenSource.zip** and **GT-I5503T_OpenSource.zip** from opensource.samsung.com as they contain the required kernel trees for the samsung phone, and did the following steps:
I modified the .config file for enabling full netfilter support and then for **GT-I5500_OpenSource.zip**
Code:
[email protected]:~/GT-I5500_OpenSource_Kernel/kernel# ./make_kernel.sh
[email protected]:~/GT-I5500_OpenSource_Kernel/kernel# ARCH=arm CROSS_COMPILE=~/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
Here i chose the toolchain from android source.
Now i got the required output, i.e.
Code:
CHK include/linux/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 30 modules
[email protected]:~/GT-I5500_OpenSource_Kernel/kernel#
I copied this zImage in the phones sdcard, and tried to flash the kernel using **SGS Kernel Flasher**. The phone rebooted, but i could still see the old kernel version in the settings... And there is no netfilter(iptables) functionality.
I followed the same steps with **GT-I5503T_OpenSource.zip**
Code:
[email protected]:~/GT-I5503T_OpenSource_Kernel/kernel$ ./make_kernel.sh
[email protected]:~/GT-I5503T_OpenSource_Kernel/kernel# find . -type f -name ‘*’ -exec dos2unix {} \;
[email protected]:~/GT-I5503T_OpenSource_Kernel/kernel# make ARCH=arm CROSS_COMPILE=~/myandroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
and finally
Code:
CHK include/linux/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 30 modules
[email protected]:~/GT-I5503T_OpenSource_Kernel/kernel#
But this kernel also doesn't work in the real device(Samsung Galaxy 5).
The third time, I copied the .config file from GT-I5503T_OpenSource.zip into the common folder, here the common folder has the kernel from
Code:
$git clone git://android.git.kernel.org/kernel/common
and did the same steps, I got zImage but it failed to work in the phone.
Please someone tell, what exactly am i doing wrong or do i need to go for kernel tree from some other sources. I did kernel compilation process for almost 5-7 times, but failed.
I tried to flash kernel from windows with fastboot, but that also didn't work...
please someone help... Thank you!!!

[Q] Hp slate 21 Kernel Compilation

Hi, I am looking to compile the hp slate 21 kernel
I Have the source code which I took from Hp Open Source at this link:
https://h20392.www2.hp.com/opensource/product.jsp?cat=100&e=true&fam=Desktop+PCs&prd=E2P18AA
The problem is that i don't know 3 things because the readmeFile inside the kernel is the Linux one and is not specific for the hp kernel:
1: The specific Toolchain required to build this kernel
2: The Configuration file for the HP slate 21 ( I took the one from /proc/config.gz config ) from the tablet
3: Which ARCH to choose arm,x86,ia64 etc...
ANY information like samsung kernel gives would be great
I know how to build Samsung kernels because in the readmefile that looks like this, there is enough information to know what to do:
HOW TO BUILD KERNEL FOR GT-P5113_XAR
1. How to Build
- get Toolchain
download and install arm-eabi-4.4.3 toolchain for ARM EABI.
Extract kernel source and move into the top directory.
$ export CROSS_COMPILE=/opt/toolchains/arm-2010q1/bin/arm-none-linux-gnueabi-
$ make android_espresso10_omap4430_r02_user_defconfig
$ make
2. Output files
- Kernel : Kernel/arch/arm/boot/zImage
- module : Kernel/drivers/*/*.ko
3. How to Clean
$ make clean
4. How to make .tar binary for downloading into target.
- change current directory to Kernel/arch/arm/boot
- type following command
$ tar cvf GT-P5113_XAR.tar zImage

[FAQ/HOWTO] An introduction to how-to-build a kernel for MT6589

Hi guys,
I was working on this since some time and here it is
Please read FAQ first
FAQ :
Can I compile a MT6589 kernel for every phone ?
As you know, a MT6589 kernel won't fit in every MT6589 smartphone because of specific configs/files in the kernel source tree.
So, if you compile my kernel which is expected to work on a Faea F2S don't expect it to work on a Acer Liquid E3 for example.
Conclusion : You have to get the kernel source for your phone​
How can I check my kernel source ?
Of course, this is not enough to see "source code for ZTE N986", you have to check if it's full or not and if it works.
Most people don't know what is working kernel source. You just have to read the GPL guidelines that every manufacturer have to complain with :
“ The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. ”
The part which has not to be included is the toolchain but there should reference to it (which toolchain to use)
For MT6589 kernel, the toolchains arm-eabi-4.6 and arm-linux-androideabi-4.6 should be used. (mtk used arm-linux-androideabi-4.6 for kernel but it should be arm-eabi-4.6)
So now you know which toolchain to grab and then for kernel source you have to check this minimal structure :
bionic
kernel
mediatek
build
config
custom
kernel
platform​README​
If I have kernel source, can I build it for my device ?
Erm... Sometimes the structure is here but the kernel source is messy... Why ?
Because you were not provided the matching source of the kernel used on your smartphone and the reasons are multiple (I won't give details).
So, the idea is to run a first build. If you get errors, then check the step above about toolchain and structure.
The next step for fixing errors is to play with source. Good luck for that.​
What are the benefits of a custom kernel for MT6589 ?
First big benefit is to introduce kitkat compatibility because there was an issue on android binder driver in mtk kernel source.
Next benefit is to be able to remove some stuff from mtk which is useless on user side and waste ressources (a lot of debug for example).
Others benefits will be in optimizations or new features (see frandom for example)​
HOWTO :
Build from my repo (specific devices supported) - It's not for compiling your kernel source but to understand how kernel build works​I explain how to build from my repo first because it can help you to understand how you should build kernel source
Prerequisites : A build environment (actually Ubuntu Saucy x64 with build-essentials, ccache, repo, java, perl v5.14+ and openssl) and I won't explain how to get one as there is multiple howto on the net.
For repo, the idea is to create a bin directory in your $HOME (usually /home/accountname/), copy repo binary inside it and then add this bin to $PATH var.
BE CAREFULL TO WHAT YOU DO WITH $PATH VAR ! I always see people doing :
Code:
export PATH=/home/foo/bin
this is erasing $PATH var, just check before and after with echo $PATH
So the idea is to introduce your path AFTER the actual $PATH var
This is easy...
Code:
export PATH=[COLOR="red"]$PATH:[/COLOR]/home/foo/bin
And of course, $PATH is reset once you close terminal and I won't explain how to set $PATH automatically.
Once you got this, everything should be working and it will be easy
Code:
mkdir workdir
cd workdir
repo init -u https://github.com/Dr-Shadow/android_kernel_mt6589_manifest.git -b master
repo sync
Then you should get this in your workdir :
kernel
manifest
mtk-tools
out
ramdisk
scripts
toolchain​Just do :
Code:
cd kernel
./certificates.sh
./build.sh
./certificates.sh is needed only once (it's for signing flashable zip and it will setup some keys for it, just reply to questions and don't add passphrase)
And of course, the build.sh contains most things you need to know on steps for building kernel (which commands to use) and you need to know how it works ​Build from your own kernel source​
I'm building the doc... I have to remind which vars need to be overriden
Reserved
Reserved #2
Thanks for making this thread brother it will help us to learn... Subscribed
Looking forward to the how-to to build with your own kernel source.
Dr-Shadow said:
Hi guys,
I was working on this since some time and here it is
Click to expand...
Click to collapse
Thank you Dr-Shadow! This is very cool. I'm going to try it out!
Great
It's always nice to see further development on MTK Based Devices.
Regards
I'll chip in and say thanks too. Finally getting around to trying to compile Alcatel's OneTouch Hero (aka TCL Y910) provided sources.
I might be in as well with A820, but I'm relatively new to Android and have only done porting of 4.1 and 4.2 so far.
Haven't built anything although I have some knowledge about the source code and SDK, which I've only used for reference purposes and the tools from it.
Will try to compile the stock kernel this weekend, but I'm not quite sure if something else is needed, even if the kernel source seems complete to me.
I'm a quick learner and have a lot of programming experience in other technologies, even thought I'm more of a front-end developer these days.

[CM 10.2] linux headers for building a kernel module?

I'm trying to compile a kernel module for Cyanogenmod 10.2.1 on a Nexus 7 tablet (tilapia). I'm using for this task an ARM virtual machine with Debian installed on it.
To compile the module I need the CM linux headers, but I can't find where to get them. Can you please link me the source repo?
PS: I want to compile a driver for a usb to lan adapter:
http://www.asix.com.tw/download.php?sub=driverdetail&PItemID=105
http://www.lindy-usa.com/usb-20-fast-ethernet-adapter-usb-micro-b-42948.html
Lucas Malor said:
I'm trying to compile a kernel module for Cyanogenmod 10.2.1 on a Nexus 7 tablet (tilapia). I'm using for this task an ARM virtual machine with Debian installed on it.
To compile the module I need the CM linux headers, but I can't find where to get them. Can you please link me the source repo?
PS: I want to compile a driver for a usb to lan adapter:
http://www.asix.com.tw/download.php?sub=driverdetail&PItemID=105
http://www.lindy-usa.com/usb-20-fast-ethernet-adapter-usb-micro-b-42948.html
Click to expand...
Click to collapse
You don't need "cm linux" headers. There is no such thing. What you need is to compile from source the kernel you are using....which is some 3.1.10 kernel. Then you need to have the "3.1.10 kernel headers" installed. Finally you cross compile the USB to Lan driver against the sources of the kernel you compiled. If the compiled kernel is there....then the cross compiler must be properly linked to the source...and it will find the header files it needs and warn you of missing dependencies. It could be that you'll need to enable some things in the kernel build in order to have all the needed support for your driver.

[HOW TO GUIDE] Build custom kernel for Android

1) requirements:
good brain (recommanded)
laptop/phone (must be 64bit)
kernel source (optionnal)
2) basics:
familiar with linux cmds such as git/make
in case building C is not important
know the right clang/gcc to use
3) before compiling:
in casd your kernel is old 2017- and your kernel version is 3.x or 2.x then 98% you should use gcc else use clang
use the right clang version you can check it from kernel string (settings>about phone>kernel version)
for gcc use linux x86 gcc for android like lineage/linaro/eva gcc and for android use arm64 gcc
4) compiling
first you need a config file you can use make ARCH=arm64 CROSS_COMPILE="path where you cloned the gcc/clang /bin/aarch64-linux-android-" ....defconfig it will load the gcc i.e:
make ARCH=arm64 CROSS_COMPILE=/root/gcc/bin/aarch64-linux-android- exynos7870-m10lte_defconfig
=> the defconfig file is stored on arch/arm64/configs so use your own
then compile make ARCH=arm64 CROSS_COMPILE=/root/gcc/bin/aarch64-linux-android-
the kernel will be stored on arch/arm64/boot

Categories

Resources