[Q] tun.ko - exec format error - Nook Color Q&A, Help & Troubleshooting

I downloaded a tun.ko from a link in http://forum.xda-developers.com/showthread.php?t=889736 for the NC kernel 2.6.32.9. My NC is with that kernel and with CM7 nightly from 11142011 (Nov 14, 2011) build.
The tun.ko I DL'ed was 194388 bytes and when I get to the insmod part, I get the error:
# su
# insmod /system/lib/modules/tun.ko
insmod: init_module '/system/lib/modules/tun.ko' failed (Exec format error)
Any insights will be greatly appreciated. Thanks.

Maybe this is the problem? How do I overcome this? Thanks.
# dmesg | grep tun
<6>tun: Universal TUN/TAP device driver, 1.6
<6>tun: (C) 1999-2004 Max Krasnyansky <[email protected]>
<3>tun: version magic '2.6.32.9 preempt mod_unload modversions ARMv7 ' should be '2.6.32.9 preempt mod_unload ARMv7 '

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

[DEV] A500 Kernel Modules

I've began to work on a Kernel modules for the A500.
Code:
CIFS
TUN
USB-SERIAL-OPTION(USB 3G DRIVER)
USB-SERIAL-WWAN(needed by the 3g driver)
nls_utf8
Tested CIFS and OPTION and working
if you guys need other modules just say so.
modules.rar is for kernel 2.6.36.3-00001-gf991e5d
modules - k2.6.36.3-00001-g9b3ce2b.zip for kernel 2.6.36.3-00001-g9b3ce2b
modules - k2.6.36.3-00001-g12f9a52.zip for kernel 2.6.36.3-00001-g12f9a52
modules - k2.6.36.3.zip for kernel 2.6.36.3
modules - k2.6.36.3-00005-g5dff38c - acer 3.1 kernel leak
original kernel modules can be found here: http://forum.xda-developers.com/showpost.php?p=13974214&postcount=62
can't insmod cifs.ko getting a exec format error
is there a dependency missed?
no mine works fine..... what does it say in dmesg?
edit: do you have the 3g model?
Thanks thor2002ro, cifs.ko work grate on my A500.
But have one problem on utf8. When i mount with "iocharset=utf8" show below error:
failed: Can not access a needed shared library
I think need another utf8 module?
Thanks again.
wood1978 said:
Thanks thor2002ro, cifs.ko work grate on my A500.
But have one problem on utf8. When i mount with "iocharset=utf8" show below error:
failed: Can not access a needed shared library
I think need another utf8 module?
Thanks again.
Click to expand...
Click to collapse
yes you need nls_utf8.ko i will build it later...
openvpn
Can you build tun.ko for openvpn please ?
bouaroudj said:
Can you build tun.ko for openvpn please ?
Click to expand...
Click to collapse
cant you read? :| its built.... :|
wood1978 said:
Thanks thor2002ro, cifs.ko work grate on my A500.
But have one problem on utf8. When i mount with "iocharset=utf8" show below error:
failed: Can not access a needed shared library
I think need another utf8 module?
Thanks again.
Click to expand...
Click to collapse
built it... its in the first post
thor2002ro said:
no mine works fine..... what does it say in dmesg?
edit: do you have the 3g model?
Click to expand...
Click to collapse
I'm having the same issue.
I copied cifs.ko to the tablet. Used root explorer to move it to the existing /system/lib/modules directory. Then:
adb shell
#su
#insmod /system/lib/modules/cifs.ko
insmod /system/lib/modules/cifs.ko
insmod: init_module '/system/lib/modules/cifs.ko' failed (Exec format error)
dmesg has...
<3>[ 2235.293898] cifs: version magic '2.6.36.3-00001-gf991e5d SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-00001-g9b3ce2b SMP
preempt mod_unload ARMv7 '
<3>[ 2422.009026] cifs: version magic '2.6.36.3-00001-gf991e5d SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-00001-g9b3ce2b SMP
preempt mod_unload ARMv7 '
And I have the US version... Product SKU 3G, Model ID A501.
tun.ko not working ?
Thanks for theses modules but I tried the tun.ko but I get an error :
$ su
su
# insmod /sdcard/openvpn/tun.ko
insmod /sdcard/openvpn/tun.ko
insmod: init_module '/sdcard/openvpn/tun.ko' failed (Exec format error)
#
saeba said:
dmesg has...
<3>[ 2235.293898] cifs: version magic '2.6.36.3-00001-gf991e5d SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-00001-g9b3ce2b SMP
preempt mod_unload ARMv7 '
<3>[ 2422.009026] cifs: version magic '2.6.36.3-00001-gf991e5d SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-00001-g9b3ce2b SMP
preempt mod_unload ARMv7 '
And I have the US version... Product SKU 3G, Model ID A501.
Click to expand...
Click to collapse
OK. Did a hex edit of the cifs.ko file replacing 'gf991e5d' with 'g9b3ce2b' and it seems to be working for my a501. If anyone else wants to try it, I've attached the edited file.
Thanks so much for this !!!! This is the one piece missing that I really wanted on my Acer !!! Thanks and will send a long a donation. Well worth it!
saeba said:
I'm having the same issue.
I copied cifs.ko to the tablet. Used root explorer to move it to the existing /system/lib/modules directory. Then:
adb shell
#su
#insmod /system/lib/modules/cifs.ko
insmod /system/lib/modules/cifs.ko
insmod: init_module '/system/lib/modules/cifs.ko' failed (Exec format error)
dmesg has...
<3>[ 2235.293898] cifs: version magic '2.6.36.3-00001-gf991e5d SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-00001-g9b3ce2b SMP
preempt mod_unload ARMv7 '
<3>[ 2422.009026] cifs: version magic '2.6.36.3-00001-gf991e5d SMP preempt mod_unload ARMv7 ' should be '2.6.36.3-00001-g9b3ce2b SMP
preempt mod_unload ARMv7 '
And I have the US version... Product SKU 3G, Model ID A501.
Click to expand...
Click to collapse
you have a different kernel version :O
do:
Code:
adb pull /proc/config.gz config.gz
and post it here...and i will compile you guys different set of modules
edit: added 2.6.36.3-00001-g9b3ce2b modules in the first post
thor2002ro said:
you have a different kernel version :O
and post it here...and i will compile you guys different set of modules
Click to expand...
Click to collapse
Here is my config.gz (zip format)
For the tun.ko
Thanks a lot.
I just check : my kernel is
#cat /proc/version
Linux version 2.6.36.3-00001-g12f9a52 ([email protected]) (gcc version 4.4.3 (GCC) ) #1 SMP PREEMPT Tue Mar 29 10:00:40 CST 2011
rgouyet said:
Here is my config.gz (zip format)
For the tun.ko
Thanks a lot.
Click to expand...
Click to collapse
ya thanks... same kernel different version... these companies are getting bored making the same stuff twice....
edit: added your version too in the first post
Great job ! Thanks a lot.
The tun.ko is working with my A500 now.
(I have now some issue with my openvpn config file but it's an other story.)
What about USB NET module?
That could relieve missing USB mass storage.
Thx!
maddler said:
What about USB NET module?
That could relieve missing USB mass storage.
Thx!
Click to expand...
Click to collapse
what you mean by usb net module? you what to plug usb network card or what?
thor2002ro said:
what you mean by usb net module? you what to plug usb network card or what?
Click to expand...
Click to collapse
I mean usbnet.ko needed to have networking running over USB just like if it was an ethernet cable. Same used when you use USB tethering on other devices.
EDIT: By the way, being able to use an USB ethernet adapter could be nice too.
maddler said:
I mean usbnet.ko needed to have networking running over USB just like if it was an ethernet cable. Same used when you use USB tethering on other devices.
EDIT: By the way, being able to use an USB ethernet adapter could be nice too.
Click to expand...
Click to collapse
looks like usbnet is build into the kernel...
thor2002ro said:
you have a different kernel version :O
do:
Code:
adb pull /proc/config.gz config.gz
and post it here...and i will compile you guys different set of modules
edit: added 2.6.36.3-00001-g9b3ce2b modules in the first post
Click to expand...
Click to collapse
Here it says:
fs: version magic '2.6.36.3-00001-gf991e5d SMP preempt mod_unload ARMv7 ' should be '2.6.36.3 SMP
preempt mod_unload ARMv7 '
I've attached my config.gz.
Thanx a lot for doing all that!

Lg e430 stock kernel with swap enabled

Hello, i downloaded the kernel for lg-e430 from lg official site and recompiled it to enable swap :
[email protected]:/ # uname -a
uname -a
Linux localhost 3.4.0 #2 PREEMPT Mon Jun 2 11:27:05 CEST 2014 armv7l GNU/Linux
[email protected]:/ # zcat /proc/config.gz |grep SWAP
zcat /proc/config.gz |grep SWAP
CONFIG_SWAP=y
CONFIG_MTD_SWAP=y
CONFIG_RING_BUFFER_ALLOW_SWAP=y
[email protected]:/ #
[email protected]:/ # free
free
total used free shared buffers
Mem: 426424 418776 7648 0 1284
-/+ buffers: 417492 8932
Swap: 204796 48364 156432
You can flash the new kernel with fastboot flash boot boot.img in bootloader mode, i recommend wipeing cache and dalvik before.
Making it available here hoping it helps some, since this site helped me a lot.
Greetings.
as a flashable zip
how to do dart.. can u give a flashable zip.. thats easy

Ouya kernel port. one step closer to working linux

https://www.reddit.com/r/ouya/comments/82rumq/ouya_kernel_4x/
[email protected]:/# uname -a
Linux Ouya 4.14.0-00011-g56c9e43b231b-dirty #185 SMP PREEMPT Fri Mar 9 08:03:41 EST 2018 armv7l GNU/Linux
[email protected]:/# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

How to compile a kernel module for stock OnePlus 6T kernel?

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!!

Categories

Resources