How to compile a kernel module for stock OnePlus 6T kernel? - OnePlus 6T Questions & Answers

Hi guys,
I am trying to compile an xt_HL.ko module which will allow me to use target TTL in iptables to fix the TTL when using the phone as a hotspot. I would like to do so for a stock kernel.
I am doing this under linux mint 19.
I have gotten as far as
1) Getting the sources for the Oneplus 6T kernel from git.
2) I got the android NDK installed (sudo apt install google-android-ndk-installer)
3) export ARCH=arm64
4) export CROSS_COMPILE=/usr/lib/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android-
5) in the kernel source
6) make ARCH=arm64 CROSS_COMPILE=/usr/lib/android-ndk/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/bin/aarch64-linux-android- sdm845-perf_defconfig
7) make menuconfig >> here I add the TTL Target as a module, save the .config
8) make -j8
9) make modules
10) everything builds successfully with no errors in the modules area
11) I transfer the resulting xt_HL.ko into the phone onto /sdcard/xt_HL.ko
12) adb shell
13) su
14) insmod /sdcard/xt_HL.ko
and after all this I get an error:
Code:
OnePlus6T:/sdcard # insmod xt_HL.ko -f
insmod: failed to load xt_HL.ko: Required key not available
As i understand I am using the wrong toolchain? Or am I missing something else?
when I look at /proc/version I get:
Code:
OnePlus6T:/sdcard # cat /proc/version
Linux version 4.9.106-perf+ ([email protected]) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Tue Nov 27 03:37:42 CST 2018
Please help me with this. I don't really want to go as far as a completely custom kernel yet.

The kernel in the phone was built with EFI_SECURE_BOOT_SIG_ENFORCE=y. This prevents loading unsigned, 3rd-party modules. You would probably need a custom kernel.

Mind elaborating on EXACTLY how to do this? I see your steps but am finding them a little sparse. I created this thread: https://forum.xda-developers.com/t/...ive-guide-to-kernels-update-21-12-16.3121088/
I'm trying to do this on LineageOS18.1 so hoping the secure_boot isn't an issue, but don't know how to add this module! Thanks!!

Related

Openvpn working! (ROOTED only)

It isn't easy, but if you have rooted your Xoom then you can get Openvpn running. If you are not familiar or comfortable working in the guts, then don't do this.
> You must have ROOTed your Xoom.
Follow these not so easy steps:
1) From the market, install the Busybox installer.
2) Run the Busybox installer and select /system/xbin for the install location.
3) Install Openvpn Installer
4) Run the installer, specify /system/xbin for the location
5) The installer will say it failed, and it surely has, no worries though, because it left the bit we need on the sdcard
6) From a terminal shell:
Code:
su
mount -w -o remount /system
mkdir /system/xbin/bb
ln -s /system/xbin/busybox /system/xbin/bb/ifconfig
ln -s /system/xbin/busybox /system/xbin/bb/route
cp /mnt/sdcard/openvpn /system/xbin/
chmod 555 /system/xbin/openvpn
mount -r -o remount /system
5) Open the attached tun.zip file and copy the tun.ko file to your /mnt/sdcard/openvpn directory along with all your other configuration files.
6) From a terminal shell:
Code:
su
insmod /mnt/sdcard/openvpn/tun.ko
That is a pain to do every time and I never had any luck getting modules to load automatically. So you can use the Openvpn settings program from the Market which is what I do.
7) Install Openvpn Settings from market
8) Run Openvpn Settings
9) Press menu button and select "Advanced"
10) Select "Load tun kernel module"
11) Select "TUN Module Settings"
Load module using = insmod
Path to tun module = /mnt/sdcard/openvpn/tun.ko
I think that should get you going, but it has been a long day and I may have missed something. There surely must be an easier way to get openvpn installed. But this is what worked for me. If you've done this before then the important bit is the Xoom tun.ko file.
UPDATE: My tun.ko doesn't work with coolbho3000's overclocked kernel. I think it is a difference in the kernel versions koush and he used. Still trying to learn how git works so I can get the exact version of the source coolbho used. I will post another tun.ko when I get it working.
UPDATE 2: Thanks to instructions from coolbho3000 I have recompiled tun.ko with the right version number for his overclocked kernel. The tun.ko for the overclocked kernel is in the file tun-overclock.zip. So use tun.zip if you are running koush's kernel and tun-overclock.zip if you are running coolbho3000's overclocked kernel.
UPDATE 3: Updated this post to reflect that a new busybox installer was released to the market that fixes it's install.
thanks for the tun.ko file
Thanks for this post! Quick question though - where do I find the openvpn installer?
The app market.
trackerk said:
That is a pain to do every time and I never had any luck getting modules to load automatically.
Click to expand...
Click to collapse
I've always put the tun.ko module in the /system/lib/modules directory and never had an issue.
Also this doesn't seem to work with VPNConnections, the program for IPSEC VPNs. Shame, I was really excited for it too.
Can you post your server .conf file and the .conf file for the Xoom? I'm having router errors that I've not had with other devices.
I'm unable to insmod the overclocked tun.ko on the overclocked kernel.
I get the following error:
# insmod tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
Click to expand...
Click to collapse
Adam B. said:
I'm unable to insmod the overclocked tun.ko on the overclocked kernel.
I get the following error:
Click to expand...
Click to collapse
Run 'dmesg' after trying insmod and tell me what the last lines are. They will probably be something to do with version magic numbers.
blulite said:
Can you post your server .conf file and the .conf file for the Xoom? I'm having router errors that I've not had with other devices.
Click to expand...
Click to collapse
The VPN is work related, I can't post any of the config. But they are the same config files I use on my Droid and Galaxy Tab. They shouldn't have to change.
Also, until busybox and openvpn installer can be updated, getting this working is kind of a mess. If openvpn can't find 'ifconfig' and 'route', then the VPN connection may get setup, but packets go nowhere. Go back over my instructions and make sure you get this bit in:
ln -s /system/xbin/busybox /system/xbin/bb/ifconfig
ln -s /system/xbin/busybox /system/xbin/bb/route
trackerk said:
Run 'dmesg' after trying insmod and tell me what the last lines are. They will probably be something to do with version magic numbers.
Click to expand...
Click to collapse
Code:
[93513.332923] tun: version magic '2.6.36.3-g1615a68 SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-g53275e0 SMP preempt mod_unload ARMv7 '
Code:
# uname -a
Linux localhost 2.6.36.3-g53275e0 #36 SMP PREEMPT Mon Feb 28 13:22:20 PST 2011 armv7l GNU/Linux
coolbho released another overclock kernel after I had compiled up tun. I guess he got a different branch of the source which had a different kernel version number. They have to match exactly. I have updated the tun-overclock.zip at the top of the thread to match his. Download and install it again and it should work. I just flashed his kernel and tun.ko to my xoom and made a vpn connection with it.
Not sure if I'm missing something, but I can't seem to get this working. I'm using cool's OC kernel (second version).
I'm using the same config file that I use on my phone (D1).
As you said, busybox install reported it failed, but it *seemed* to have worked. OpenVPN Installer must of updated their app because I was able to install it without it failing. Worked just like it did on my D1.
Then I try to connect to the VPN, it seems to get past Auth and Get Config, but dies at "Connected to IP_ADDRESS_OF_OPENVPN as" and the notification keeps popping up saying its connected.
Running netcfg from the CLI shows the tun0 interface down, with no IP assigned. It's almost as ifconfig can't assign the address, but it seems like ifconfig and route are properly installed. Any ideas?
From the command line run:
insmod /path/to/tun.ko
(with whatever path you saved tun.ko to)
to make sure it is being loaded. It probably is since you see it in netcfg. But that is the most common reason for openvpn not working.
If that works, then look to see if openvpn is finding the ifconfig and route commands. The only way I could get it to work with the Openvpn Settings program was to put them in /system/xbin/bb.
I could of swore there was a built in log with OpenVPN Settings, but I can't find it. How can I find out if its finding ifconfig and route?
I'm pretty sure thats the issue. I know its loading the module correctly, and I know I have ifconfig installed properly because I could do "# ifconfig tun0 5.5.0.254 netmask 255.255.255.0 up" and it will assign the address to the tun0 interface, and I could ping it. For some reason it seems OpenVPN can't use ifconfig.
FYI - i confirmed the following with a file manager
both ifconfig and route are inside /system/xbin/bb (as well as /system/bin/ and /system/xbin for good measure)
OpenVPN binary is inside /system/xbin/
I'm not sure what else I could be missing.
Just try running openvpn from the command line. Like this:
Code:
su
cd /path/to/openvpn_stuff
openvpn my.conf
If it can't find 'route' or 'ifconfig' you'll see it there.
Yea, something doesn't look right. Take a look
http://dl.dropbox.com/u/14573841/log.txt
Thats your version of openvpn complaining. I don't think the version in the market supports push options like that. My server config doesn't have them so it didn't matter to me. The guy who compiled up tun.ko for the Galaxy Tab also had instructions on getting a different openvpn that supported push. You'll have to look around a bit to find it.
I'll try http://code.google.com/p/android-openvpn-settings/issues/detail?id=26 when I get out of work. Weird thing is though it works on my phone no problem.
edit// that seems to have done it. I'm now connected and can pass traffic. Now I just need to figure out why "connected" keeps popping up in my notifications.
Anyone coming across this, that is having a similair issue. Here is the part of the log that pointed trackerk to the push issue (just in case I remove the log from my dropbox)
Code:
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:4: dhcp-pre-release (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:5: dhcp-renew (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:6: dhcp-release (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:13: route (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:14: route (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:15: route (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:18: register-dns (2.1.1)
Tue Mar 8 15:36:18 2011 Options error: Unrecognized option or missing parameter(s) in [PUSH-OPTIONS]:20: ifconfig (2.1.1)
I'm using the "static" openvpn 2.1.1 from github, so all is working. With the exception of DNS redirection. Anyone got that working? I'm setting the default route to my ovpn, and all the traffic is going that way. But I cannot get DNS to redirect.
Code:
push "dhcp-option DNS 192.168.1.1"
push "redirect-gateway"
edit: I found the following commands to change DNS, now I need a script called from openvpn. Anyone got one, or am I writing from scratch?
Code:
setprop net.dns1 192.168.1.1
setprop net.dns2 8.8.8.8
Ideas?
Jeff

[GUIDE] Compile the stock android kernel

I have already discussed how to unpack/repack the boot.img file.
Now let's try to recompile the android kernel.
You will need some packages not included in a default Ubuntu 11.04 installation:
Code:
sudo apt-get install git unrar libncurses5-dev qt3-dev-tools
Unrar and git are the only necessary packages.
Install libncurses if you want to modify the kernel configuration with the command line menu.
Otherwise, if you want a graphical interface, go with qt3.
Please refer to the documentation of your linux distro for help on how to install additional packages.
For the purpose of this guide we are going to rebuild the official asus kernel with no modifications.
Download the latest kernel source from the ASUS site (atm 2.6.36.3)
Code:
wget http://dlcdnet.asus.com/pub/ASUS/EeePAD/TF101/Eee_PAD_TF101_Kernel_Code_8_4_4_11.rar
Now unpack it:
Code:
unrar e Eee_PAD_TF101_Kernel_Code_8_4_4_11.rar
tar xvfz kernel-3eb19ec-fix-lic.tar.gz
We need a config file for the compile process.
The config file essentially sets features ON or OFF from the final kernel (yes, I know that is much more than this...).
If your tablet is upgraded to the latest build (8.4.4.11) you can extract the config file from your running device:
Code:
adb pull /proc/config.gz ./
Or you can find it attached to this post (the forum won't allow to upload a .gz file, so i made a .zip file; use unzip instead of gunzip).
Now uncompress and move it into the kernel dir (renaming it in .config).
Code:
gunzip config.gz
cp config kernel-3eb19ec/.config
Now the not-so-fun part.
We will need a compiler for the arm platform.
The android source comes with the arm compiler. You can download it following this instructions http://source.android.com/source/downloading.html .
The only problem is that the repository is about 2.6GB...
So we are going to download only the prebuilt toolchain (1,8GB):
Code:
git clone git://android.git.kernel.org/platform/prebuilt.git
After git finishes his download, you will have a new directory called "toolchain".
We have to set some environment variables (i assume you have downloaded the toolchain in your home directory):
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
Ok, the compiler is installed and configured.
It's time to come back to the kernel source.
If you want to modify some settings in your config file (!!AT YOUR OWN RISK!!) you can edit the .config file or use a graphical interface.
Code:
cd kernel-3eb19ec
make xconfig (make menuconfig if you prefer a command-line menu)
Now we can compile the android kernel:
Code:
make -j4
Our new kernel is stored in : arch/arm/boot/zImage
We can use it for make a boot image and flash in our TF101 (use this guide http://forum.xda-developers.com/showthread.php?t=1193737)
Let me say this again: I'm not an expert in android kernel/compiler.
If you find something wrong with this guide, please tell me.
I've learned this with google and by trial and error.
If you brick something don't blame on me.
If you want to hit "thanks", you're welcome.
Have Fun!
Pulling out config.gz you will get the current kernel configuration...it could not fit the stock kernel..
gnufabio said:
Pulling out config.gz you will get the current kernel configuration...it could not fit the stock kernel..
Click to expand...
Click to collapse
Of course the kernel source has to be exactly the same version as the running kernel for this to work.
In this example, the source and running kernel were both 2.6.36.3 (build 8.4.4.11).
For use an older .config (or a newer source tree), we should run:
Code:
make oldconfig
to adapt them (...kinda).
Thanks for point this out.
I was eventually planning on making this guide, good work!
gnufabio said:
Pulling out config.gz you will get the current kernel configuration...it could not fit the stock kernel..
Click to expand...
Click to collapse
This is a possibility if anything in the config changes from the kernel you're running in the actual source Asus has posted
I've always done the following:
Code:
make tegra_defconfig
make
I haven't actually checked to see if this is up to date with a running kernel, just noticed Asus pops up a few times in there.
Actually this is the default TF101 config: tf101_defconfig
Thanks for the guides. These are really helpful -
Hashi
I'm getting this set of errors. I've built and modified many linux kernels, so I'm guessing this is in the toolchain area, and am wondering if it needs to know something else for where to look at dynamic load libraries, etc?
I created a shell script to setup / export the shell environment vars. It looks like this:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
I'm using a PC I use for work ARM cross compiles that is 64 bit Ubuntu 9.10.
Thanks --
--- make -j4 errors ---
Code:
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ make -j4
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: `include/generated/mach-types.h' is up to date.
make[1]: *** [scripts/mod] Error 2
CC kernel/bounds.s
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
In searching for the basic problem, that arm*gcc can't see libc.so.6 in the version it wants, I think it's not seeing this at all:
~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ find ../../toolchain/ -iname libc.so.6 -exec ls -al {} \;
lrwxrwxrwx 1 hashi hashi 11 2011-08-01 15:58 ../../toolchain/prebuilt/linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/lib/libc.so.6 -> libc-2.7.so
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
thanks. I'm not new to kernel compiling but I'm new to android
hachamacha said:
I'm getting this set of errors. I've built and modified many linux kernels, so I'm guessing this is in the toolchain area, and am wondering if it needs to know something else for where to look at dynamic load libraries, etc?
I created a shell script to setup / export the shell environment vars. It looks like this:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-eabi-
export PATH=$PATH:~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/
I'm using a PC I use for work ARM cross compiles that is 64 bit Ubuntu 9.10.
Thanks --
--- make -j4 errors ---
Code:
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ make -j4
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
CHK include/linux/version.h
CHK include/generated/utsrelease.h
CC scripts/mod/empty.o
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make[2]: *** [scripts/mod/empty.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: `include/generated/mach-types.h' is up to date.
make[1]: *** [scripts/mod] Error 2
CC kernel/bounds.s
arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by arm-eabi-gcc)
make: *** [scripts] Error 2
make: *** Waiting for unfinished jobs....
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
In searching for the basic problem, that arm*gcc can't see libc.so.6 in the version it wants, I think it's not seeing this at all:
~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$ find ../../toolchain/ -iname libc.so.6 -exec ls -al {} \;
lrwxrwxrwx 1 hashi hashi 11 2011-08-01 15:58 ../../toolchain/prebuilt/linux-x86/toolchain/i686-linux-glibc2.7-4.4.3/sysroot/usr/lib/libc.so.6 -> libc-2.7.so
[email protected]:~/sandbox/android-sdk-linux_x86/kernel/kernel-3eb19ec$
Click to expand...
Click to collapse
The toolchain has everything it needs for compile the kernel.
The problem seems to be your 64 bit...
The arm compiler is built against 32bit version of glibc library; I think you already have a multilib environment (you have a /lib32 dir). Maybe the 32bit verion of the glibc is not the correct version.
Try this command:
Code:
ldd ~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc
And look what it says for the libc.so.6. In my system it says it is located in /lib/i386-linux-gnu/libc.so.6. So if I run it:
Code:
$ /lib/i386-linux-gnu/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.13-0ubuntu13) stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.38 system on 2011-04-11.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
The first line tell the version number. If it's older than 2.11 you need to update your multilib libc.
gnufabio said:
Actually this is the default TF101 config: tf101_defconfig
Click to expand...
Click to collapse
This is for 2.6.36.3 but seems way older. It says "Fri Mar 25 19:50:17 2011".
Maybe it's from an old build?
The last ASUS config (the one attached to the first post) is "Mon Jul 11 14:47:43 2011".
Brilliant!
I had problems cloning using the git protocol because of a corporate firewall, but the HTTP method worked fine:
Code:
http://android.git.kernel.org/platform/prebuilt.git
I also found the the toolchain with the Android NDK failed to build the kernel but the one linked to in the OP worked perfectly.
SammyC said:
I also found the the toolchain with the Android NDK failed to build the kernel but the one linked to in the OP worked perfectly.
Click to expand...
Click to collapse
Yes, I have tried this also, with the same result.
Someone said that the codesourcery compiler can compile the android kernel.
I have tried, it compiles all, but when i flash on the tablet it stucks on the boot screen.
Initially I wrote the guide using this compiler (it's smaller and has a graphical installer), when i realized that it doesn't work , i switched back to the android official compiler.
If someone want to try with the codesourcery compiler here's the (unsuccessful) process I have used:
!!ATTENTION!!: ATM THIS DOESN'T WORK
An easier (and somewhat faster) way is downloading the Code Sorcery's "Code Bench" compiler (http://www.codesourcery.com/) and install it.
Code:
wget http://www.codesourcery.com/sgpp/lite/arm/portal/package8741/public/arm-none-linux-gnueabi/arm-2011.03-41-arm-none-linux-gnueabi.bin
This compiler need some extra packages to work in Ubuntu:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind
For some reason, in Ubuntu 11.04 the /bin/sh link refer to the dash shell and not bash.
The compiler's installer will comply for this, so we do as follows:
Code:
sudo dpkg-reconfigure -plow dash
and when it asks to use dash as the default shell, click on "NO"
Code:
sh arm-2011.03-41-arm-none-linux-gnueabi.bin
Leave all the default options. The installer will copy the files in your home directory.
We should set some environmet variables:
Code:
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabi-
export PATH=$PATH:~/CodeSourcery/Sourcery_G++_Lite/bin
Click to expand...
Click to collapse
Then continue with the guide from the "make xconfig".
If someone can make it work with this compiler, could be so gentle to tell us how?
rebound821 said:
The toolchain has everything it needs for compile the kernel.
The problem seems to be your 64 bit...
The arm compiler is built against 32bit version of glibc library; I think you already have a multilib environment (you have a /lib32 dir). Maybe the 32bit verion of the glibc is not the correct version.
Try this command:
Code:
ldd ~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc
And look what it says for the libc.so.6. In my system it says it is located in /lib/i386-linux-gnu/libc.so.6. So if I run it:
Code:
$ /lib/i386-linux-gnu/libc.so.6
GNU C Library (Ubuntu EGLIBC 2.13-0ubuntu13) stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.38 system on 2011-04-11.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.
The first line tell the version number. If it's older than 2.11 you need to update your multilib libc.
Click to expand...
Click to collapse
Thanks again -- I'll try that out as soon as I'm back in TF mode.
Code:
~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib32/libc.so.6: version `GLIBC_2.11' not found (required by ~/sandbox/android-sdk-linux_x86/toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
linux-gate.so.1 => (0xf77e0000)
libc.so.6 => /lib32/libc.so.6 (0xf7677000)
/lib/ld-linux.so.2 (0xf77e1000)
^^ that was from the first command
Code:
GNU C Library (EGLIBC) stable release version 2.10.1, by Roland McGrath et al.
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.4.1.
Compiled on a Linux >>2.6.24-27-server<< system on 2011-01-11.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
BIND-8.2.3-T5B
For bug reporting instructions, please see:
<http://www.eglibc.org/issues/>.
And ^^ from the second.
It looks like with 9.10 Ubuntu, (backporting something from 10 or 11.x notwithstanding), I can't easily get to GLIBC 2.11 from GLIBC 2.10.x. Thanks. I'll put together an 11.x VM for this task.
For 64bit machines, you might need to do the following?
apt-get install ia32-libs
raypou said:
For 64bit machines, you might need to do the following?
apt-get install ia32-libs
Click to expand...
Click to collapse
Thanks, I managed to download a ARM toolchain from their site that works fine with Ubuntu 9.10 64 bit.
Whether or not it'll run when I try to install a kernel is another question, but it builds without problem and produces ARM code.
rebound821 said:
Yes, I have tried this also, with the same result.
Someone said that the codesourcery compiler can compile the android kernel.
I have tried, it compiles all, but when i flash on the tablet it stucks on the boot screen.
Initially I wrote the guide using this compiler (it's smaller and has a graphical installer), when i realized that it doesn't work , i switched back to the android official compiler.
If someone want to try with the codesourcery compiler here's the (unsuccessful) process I have used:
!!ATTENTION!!: ATM THIS DOESN'T WORK
Then continue with the guide from the "make xconfig".
If someone can make it work with this compiler, could be so gentle to tell us how?
Click to expand...
Click to collapse
Wow can't believe I found this thread. I just want to confirm that I'm also having a horrible time with the code sourcery toolchain trying to compile the android kernel, the moto atrix kernel specifically. The zimage compiles, but flashing to the device it just hangs.
So im currently downloading the official android toolchain.
Also some learned knowledge for everybody, the correct code sourcery toolchain supposedly android equivalent is arm-none-linux-gnueabi-, NOT the arm-none-eabi- or any of the others. This info is very hard to find fyi.
However as this thread seems to prove, even using the correct one doesn't exactly work.
Hi,
I'm trying to build the stock Memo Pad smart(ME301t) stock kernel 10.6.1.29 downloaded directly from asus.
I used 4.3.3 to 4.7 toolchains with similar results(give or take some deprecated compiler arguments).
What I really want to know is why I'm getting a lot of warnings(NOT ERRORS), some of them are minor errors like "unused function" and some of them are major warnings breaking function functionality. Some of the builds don't even boot.
What toolchain should I use with this kernel?
Why a stock kernel(from asus) should produce warnings at the first place?
I'm on linux BTW.

official cm7.2 kernel source

Hello,
I need to recompile the kernel to get the serial port through the usb plug (google: android serialport api htc )
The kernel shipped with cm-7.2.0-click is 2.6.35.14 (-Arco-Kalim) and I can't find this version on git for this phone (that would take /proc/config.gz with no modification by using make menuconfig+save).
Anybody has some clue ?
Thanks
david
deyv said:
Hello,
I need to recompile the kernel to get the serial port through the usb plug (google: android serialport api htc )
The kernel shipped with cm-7.2.0-click is 2.6.35.14 (-Arco-Kalim) and I can't find this version on git for this phone (that would take /proc/config.gz with no modification by using make menuconfig+save).
Anybody has some clue ?
Thanks
david
Click to expand...
Click to collapse
If you need to make just minor tweaks, use dsxda's kitchen to extract the kernel, make changes and then repack it
Hi deyv,
kernel source for tattoo and wildfire are into arco git:
https://github.com/arco/htc-kernel-msm7225
and here's the gingerbread branch config file for tattoo:
https://github.com/arco/htc-kernel-msm7225/blob/gingerbread/arch/arm/configs/click_defconfig
bye
yen
Thanks a lot !
Thanks to both of you I managed to recompile a kernel, and repack it in the official cm7.2 using dsixda.
I have now the serial port /dev/ttyMSM2 that appeared (which I still have to test) and this is great
But I have now the touchscreen which is totally broken (touch is working but gives random places, never under the thumb). I compared the two rom-zip files, and there is absolutely no difference between them, except a new binary /system/bin/wmdsi, and of course the kernel (no difference in ramdisk.img).
Here is the .config diff.
Do you have any clue ?
edit: screen and touchpad X and Y axis are reversed, (in both landscape and portrait mode)
Code:
--- click_defconfig 2012-07-25 08:56:38.219763553 +0200
+++ click_defconfig-noheadset-serialport 2012-07-26 01:43:44.190274884 +0200
@@ -2,5 +2,5 @@
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.35.14
-# Wed Feb 1 07:32:28 2012
+# Thu Jul 26 01:43:22 2012
#
CONFIG_ARM=y
@@ -363,6 +363,5 @@
# CONFIG_MICROP_COMMON is not set
# CONFIG_HTC_HEADSET_MGR is not set
-CONFIG_HTC_HEADSET_V1=y
-CONFIG_HTC_AUDIOJACK_V1=y
+# CONFIG_HTC_HEADSET_V1 is not set
# CONFIG_HTC_ONMODE_CHARGING is not set
# CONFIG_BUILD_CIQ is not set
@@ -1192,5 +1191,7 @@
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
-# CONFIG_SERIAL_MSM is not set
+CONFIG_SERIAL_MSM=y
+# CONFIG_SERIAL_MSM_CONSOLE is not set
+# CONFIG_SERIAL_MSM_CLOCK_CONTROL is not set
# CONFIG_SERIAL_MSM_HSL is not set
CONFIG_SERIAL_MSM_HS=y
Is not the L missing here?
Code:
# CONFIG_SERIAL_MSM_HSL is not set
CONFIG_SERIAL_MSM_HS=y
CONFIG_SERIAL_MSM_HS is flagged for 2.6.39 kernel onwards here http://cateee.net/lkddb/web-lkddb/SERIAL_MSM_HS.html
Other than this i suggest to extract kernel config from a working cm7 rom to check if it match that on github (just in case of)
To compile kernel do you have used toolchain shipped with cm?
bye
yen
The /proc/config.gz extracted from the original running cm7.2 matches the second link you wrote above.
and the two following lines are in it (you can check):
Code:
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.35.14
# Wed Feb 1 07:32:28 2012
[...]
# CONFIG_SERIAL_MSM_HSL is not set
CONFIG_SERIAL_MSM_HS=y
Yes, I have used the toolchain shipped with cm's git repository.
I'm using the remotes/origin/gingerbread branch of arco's kernel :
Code:
$ git branch -a
* (no branch)
ics
remotes/origin/HEAD -> origin/ics
remotes/origin/gingerbread
remotes/origin/ics
$ git diff -r remotes/origin/gingerbread
$
I had also compiled the entired android (not the kernel) with the same toolchain and it worked. I am now using the original CM distribution, not the one I compiled but with the new .config I described above.
Can it be a /proc/cmdline problem ? I can't see where it is stored, it's obviously not in the rom:
Code:
# bash
localhost / # cat /proc/cmdline
board_bahamas.disable_uart3=0 board_bahamas.usb_h2w_sw=0 board_bahamas.disable_sdcard=0 diag.enabled=0 board_bahamas.debug_uart=0 smisize=0 androidboot.baseband=3.35.07.20 androidboot.cid=ORANG202 androidboot.carrier=ORANGE-French androidboot.mid=CLIC10000 androidboot.keycaps=azerty androidboot.mode=normal androidboot.serialno=SH9BGLG00083 androidboot.bootloader=0.52.0001 no_console_suspend=1 console=null
localhost / #
Should I restart the process from scratch ?
So original kernel config & source and toolchain are all good, i got no (possibly) good idea at all.
Should I restart the process from scratch ?
Click to expand...
Click to collapse
last try should perhaps be to compile kernel inline with the rom (not tested if it's possible in cm7 too like for cm9)
bye
yen

[Guide] How to build kernel from source

Build-kernel​
Building Kernel only from Oppo Source​
"Official Oppo Find 5 kernel source":https://github.com/oppo-source/Find5-Kernel-Source
EDIT: the 12025_release_defconfig doesn't work for me (touchscreen doesn't respond). Most likely a change needs to be made here
Code:
446,447c436,437
< CONFIG_TOUCHSCREEN_MELFAS=y
< CONFIG_TOUCHSCREEN_SYNAPTICS_S3202_I2C_RMI=y
---
> CONFIG_TOUCHSCREEN_ATMEL_MXT=y
> CONFIG_TOUCHSCREEN_CYTTSP_I2C_QC=y
Check out the source code
Code:
git clone git://github.com/oppo-source/Find5-Kernel-Source.git
Using +12025_debug_defconfig+ as config. You can use +12025_release_defconfig+ , with some modifications to the source to make it work properly
Code:
cd Find5-Kernel-Source
make ARCH=arm clean
make ARCH=arm 12025_debug_defconfig
edit include/config/kernel.release
if you want to modify the kernel version numbering
Build
Code:
make -j4 ARCH=arm CROSS_COMPILE=arm-eabi-
or use this following (uses as many cores as your computer has
Code:
make -j$(grep -c ^processor /proc/cpuinfo) ARCH=arm CROSS_COMPILE=arm-eabi-
\n if you want to use the +12025_release_defconfig+, there are some config problems. I have fixed them in my github
My github (use the branch [*]config-fixes): https://github.com/ngvincent/android-kernel-oppo-find5
The end, you'll get two files (Image and zImage) inside arch/arm/boot
Image = full kernel image, zImage = compressed version
*_The boot partition has ~10MB of space(see bottom of page for details). Make sure your kernel+ramdisk doesn't exceed this_*
Make boot.img file (need to add ramdisk)​
Copy the ramdisk from existing device or ROM. "Here":https://git.ngvincent.com/attachments/download/5/ramdisk.gz is one I extracted from the X909EN_13_130307 rom
Extracting kernel from device​
Code:
adb shell
su
dd if=/dev/block/mmcblk0p18 of=/sdcard/boot.img
exit
adb pull /sdcard/boot.img
Extracting from boot.img​
Code:
abootimg -x boot.img
Making boot.img​
Copy the stuff below into a file called bootimg.cfg (gives the configuration for abootimg to create the img properly)
Code:
bootsize =
pagesize = 0x800
kerneladdr = 0x80208000
ramdiskaddr = 0x82200000
secondaddr = 0x81100000
tagsaddr = 0x80200100
name =
cmdline = console=ttyHSL0,115200,n8 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3
Code:
abootimg --create bootimage.img -f bootimg.cfg -k zImage -r ramdisk.gz
Flash kernel onto device​
You'll need to use fastboot to do it. I need to sudo as root for fastboot to work properly
Code:
adb reboot bootloader
sudo -s
fastboot devices
fastboot flash boot bootimage.img
fastboot reboot
verify​
Code:
adb shell
cat /proc/version
Linux version 3.4.0-perf-g5d91181 ([email protected]) (gcc version 4.4.3 (GCC) ) [*]1 SMP PREEMPT Sat Mar 16 13:29:19 EDT 2013
partition space on the device​
Code:
adb shell
cat /proc/partitions
Code:
179 18 10240 mmcblk0p18
Code:
[email protected]:/dev/block/platform/msm_sdcc.1/by-name $ ls -la
lrwxrwxrwx root root 1970-01-16 12:58 DDR -> /dev/block/mmcblk0p15
lrwxrwxrwx root root 1970-01-16 12:58 aboot -> /dev/block/mmcblk0p17
lrwxrwxrwx root root 1970-01-16 12:58 boot -> /dev/block/mmcblk0p18
Looks like there's plenty of space for the kernel/boot.img - 10240 kilobytes
Thanks for this. While this is way beyond my skill level, I'm glad the info is available. I'm slowing scratching the surface.. just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Coreym said:
just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Click to expand...
Click to collapse
are you planning on making nightlies for the oppo ?
CoopZor said:
are you planning on making nightlies for the oppo ?
Click to expand...
Click to collapse
I think kAmMa is working on CM right now? So hopefully we will have the CM Rom to install on the Find 5 in the near future. I know he said that he almost had it complete but was having problems with the drivers for the display and needed the drivers from the source code. Now that the source code has been released we might see something good soon. I don't know if his CM will be the official CM release though. We do need an official CM for the Find 5 though.
Personally, I would like to see Paranoid Android 3+ on the Find 5 as its my favorite rom, and it would be amazing on the Find 5. I use it as my daily on my Nexus 4 and 7 and both run great!
This is out of my league also, I wish I could build some good kernels and Roms. I will beta test Roms and Kernels if anyone needs me too though.
Coreym said:
Thanks for this. While this is way beyond my skill level, I'm glad the info is available. I'm slowing scratching the surface.. just recently learned how to build Nightlies! Thanks
Sent from my X909 using Tapatalk 2
Click to expand...
Click to collapse
once you get the hang of linux build tools, the next part is rather easy
I'm porting over the changes that faux123 made in his kernel for the Nexus 4 (same Qualcomm S4Pro APQ8064 processor+SoC)...
finished reading his mods for voltage control, i'll probably slicing in the code tomorrow...
I'm not touching CM10 (or AOKP/Paranoid...) porting yet... had some experience with kernel development a few years ago, but not for android porting...
error when run Command
I got error when run Command : make ARCH=arm clean , how can I fix it?
PHP:
[email protected]:~/aosp/kernel/Find5-4.2-kernel-source-master$ make ARCH=arm clean
scripts/Makefile.clean:17: /home/war/aosp/kernel/Find5-4.2-kernel-source-master/drivers/networkpmsmodule/Makefile: No such file or directory
make[2]: *** No rule to make target `/home/war/aosp/kernel/Find5-4.2-kernel-source-master/drivers/networkpmsmodule/Makefile'. Stop.
make[1]: *** [drivers/networkpmsmodule] Error 2
make: *** [_clean_drivers] Error 2
#### make failed to build some targets (1 seconds) ####

Kernel compilation fails with "Exec format error"

Hi,
I downloaded the LG G2 kernel source from https://www.lg.com/global/support/opensource/opensourceList?types=ALL&search=D802.
I followed the instructions in the readme:
Code:
2. Kernel Build
- Uncompress using following command at the android directory
tar xvzf LG-D802(G2)_Android_JB_D802_10a_Kernel.tar.gz
- When you compile the kernel source code, you have to add google original prebuilt source(toolchain) into the android directory.
- Run following scripts to build kernel
a) cd kernel
b) export PATH=$PATH:tools/lz4demo
c) make ARCH=arm CROSS_COMPILE=../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi- g2-open_com-perf_defconfig zImage -j4
* "-j4" : The number, 4, is the number of multiple jobs to be invoked simultaneously.
* lz4demo : More information can be found at "https://code.google.com/p/lz4/"
- After build, you can find the build image(zImage) at arch/arm/boot/
I downloaded the prebuilt toolchain from https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6.
This is the exact error message:
Code:
../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc -Wp,-MD,scripts/mod/.empty.o.d -nostdinc -isystem ../prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi-gcc -print-file-name=include [Errno 8] Exec format error -I/root/kernel/arch/arm/include -Iarch/arm/include/generated -Iinclude -include /root/kernel/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-msm/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -O2 -fstack-protector -mabi=aapcs-linux -mno-thumb-interwork -funwind-tables -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a -msoft-float -Uarm -fomit-frame-pointer -g -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(empty) -DKBUILD_MODNAME=KBUILD_STR(empty) -c -o scripts/mod/.tmp_empty.o scripts/mod/empty.c [Errno 8] Exec format error
I am running a fresh installation of ubuntu 12.04 x86.
Any ideas how to fix this?
Guess I can answer that myself: Android can only be build on 64-bit machines.

Categories

Resources