Jump to content


Photo

Additional Kernel Modules (cifs.ko and tun.ko)

- - - - -

  • Please log in to reply
38 replies to this topic

#1
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300
Here are some commonly needed modules that are missing from stock kernels, providing OpenVPN and Samba/CIFs support. Maybe someone will find them useful, at least whilst the G300 lacks a CyanogenMod port. However, if you don't know what they are, you probably don't need them...

Additional kernel modules for Gingerbread kernel 2.6.38.6-perf

Additional kernel modules for Ice Cream Sandwich kernel 3.0.8-perf

You'll need the Android SDK installed and root access on your handset. After unpacking the .zip, execute the following from the directory containing the modules:

adb push *.ko /sdcard/
adb shell
su
mount -o rw,remount /dev/block/mmcblk0p12 /system
cp /sdcard/*.ko /system/lib/modules/
chmod 644 /system/lib/modules/*
mount -o ro,remount /dev/block/mmcblk0p12 /system
exit
exit

Although OpenVPN Installer and OpenVPN Settings from the market are not as good as the CyanogenMod implementation (CM employs password protected certificate storage), they provide a perfectly serviceable solution.

Edited by unaszplodrmann, 29 July 2012 - 03:09 PM.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#2
khumhurezu

khumhurezu

    Newbie

  • Members
  • Pip
  • 10 posts
  • Devices:Ascend G300
Hello. I've been trying to compile tun.ko for ICS using the kernel from http://www.modaco.co...nel-kernel-308/ .
Unfortunatelly, without success.
Please let me know what toolchain you used to compile your modules.

Thanks

  • 0

#3
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300

Hello. I've been trying to compile tun.ko for ICS using the kernel from http://www.modaco.co...nel-kernel-308/ .
Unfortunatelly, without success.
Please let me know what toolchain you used to compile your modules.

Thanks


Odd. I just used the standard prebuilt 4.4.3 toolchain cloned from the Google repo. What do you have in /proc/version?

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#4
khumhurezu

khumhurezu

    Newbie

  • Members
  • Pip
  • 10 posts
  • Devices:Ascend G300
I've used the same toolchain from the Android NDK.

Here's /proc/version

shell@android:/system/lib/modules # cat /proc/version
Linux version 3.0.8-perf-00213-g8dfa62b (android@localhost) (gcc version 4.4.3 (GCC) ) #1 PREEMPT Wed Jun 20 10:04:10 CST 2012

The strings from the compiled module:
/ics/source/drivers/net# strings tun.ko
tun_get_socket
tun_get_user
alias=devname:net/tun
alias=char-major-10-200
license=GPL
author=© 1999-2004 Max Krasnyansky <[email protected]>
description=Universal TUN/TAP device driver
depends=
vermagic=3.0.8-perf-00213-g8dfa62b preempt mod_unload modversions ARMv7
0x%x
include/linux/netdevice.h
<6>tun: netif_stop_queue() cannot be called before register_netdev()
<3>tun: unexpected GSO type: 0x%x, gso_size %d, hdr_len %d
tun:
drivers/net/tun.c
tun: GSO!
<3>RTNL: assertion failed at %s (%d)
<6>tun: %s, %s
Universal TUN/TAP device driver
<6>tun: %s
© 1999-2004 Max Krasnyansky <[email protected]>
<3>tun: Can't register link_ops
<3>tun: Can't register misc device %d
tun%d
tap%d
<3>tun: Failed to create tun sysfs files
net/tun
tun_flags
owner
group
GSO!

And insmod attempt
shell@android:/system/lib/modules # insmod tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
255|

I'm kinda stumped... :( :wacko:

  • 0

#5
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300

...

vermagic=3.0.8-perf-00213-g8dfa62b preempt mod_unload modversions ARMv7

...

insmod: init_module 'tun.ko' failed (Exec format error)


Disable CONFIG_MODVERSIONS in the loadable module support section and to avoid the kernel complaining about a magic value mismatch.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#6
khumhurezu

khumhurezu

    Newbie

  • Members
  • Pip
  • 10 posts
  • Devices:Ascend G300
No go.

vermagic=3.0.8-perf-00213-g8dfa62b preempt mod_unload ARMv7

shell@android:/ # insmod system/lib/modules/tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
255|

I must be doing something very wrong here... :(

  • 0

#7
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300

No go.

vermagic=3.0.8-perf-00213-g8dfa62b preempt mod_unload ARMv7

shell@android:/ # insmod system/lib/modules/tun.ko
insmod: init_module 'tun.ko' failed (Exec format error)
255|

I must be doing something very wrong here... :(


Darn. Nothing usful in dmesg? I'll grab the sources later today and give it a try. It'd be great if you could post the default config for 3.0.8.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#8
khumhurezu

khumhurezu

    Newbie

  • Members
  • Pip
  • 10 posts
  • Devices:Ascend G300
Sorry for the delay.

Dmesg only says this:

<4>[4749, insmod] [33075.044928] do_exit: exit code=65280

Original config.gz, from B927 rom.
http://dl.dropbox.co...97546/config.gz

In detail, here's what I did.

On a fresh ubuntu 10.04, got the sources and Android NDK
Modified the config with:
CONFIG_CROSS_COMPILE="arm-linux-androideabi-"
CONFIG_LOCALVERSION="$(KERNEL_LOCAL_VERSION)-perf-00213-g8dfa62b"
# CONFIG_LOCALVERSION_AUTO is not set
CONFIG_TUN=m

Exported the path to the compiler, in my case
export PATH=$PATH:/ics/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/
export ARCH=arm

Modified the setlocationversion script so it won't display "+" symbol:
<<
go to source directory
vi scripts/setlocalversion
locate the following line
if $short; then
echo "+"
change echo "+" to echo ""
>>

make modules

  • 0

#9
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300
Try the ones I've added to the OP. I thought that CONFIG_MODVERSIONS would be disabled in the new kernel too, as it was in 2.6.38, hence I suggested disabling it, having wrongly presuming you'd enabled it. Nice to see them being less zealous about kernel security.

I exported $PATH, $ARCH and $CROSS_COMPILE (set to "arm-eabi-"), then did a 'make oldconfig', followed by 'make menuconfig' to enable the modules. As CONFIG_MODVERSIONS is enabled, I didn't bother setting the versioning options.

Interesting also to see that USB OTG support is still present, but not fully enabled.

Edited by unaszplodrmann, 28 July 2012 - 08:30 PM.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#10
khumhurezu

khumhurezu

    Newbie

  • Members
  • Pip
  • 10 posts
  • Devices:Ascend G300
I tried your version, didn't work.
dmesg gives me the following, for both your build and one I compiled using your instructions.

[1978, insmod] [ 3390.762324] tun: no symbol version for module_layout
[4978, insmod] [ 3390.782884] do_exit: exit code=65280

  • 0

#11
dragpyre

dragpyre

    Enthusiast

  • Members
  • PipPipPip
  • 232 posts
  • Gender:Male
  • Devices:kumquat, grouper
  • Twitter:@dragpyre

I tried your version, didn't work.
dmesg gives me the following, for both your build and one I compiled using your instructions.

[1978, insmod] [ 3390.762324] tun: no symbol version for module_layout
[4978, insmod] [ 3390.782884] do_exit: exit code=65280


I think what happens is that when tun comes back as no existing or no symbol present, it sets connectioninprogress to null. The connectionInProgess.isNumericToken() may be what is causing the errors, and potential force closing.

Try making the link between tun and connectionInProgress yourselves, before trying to run it.

Also, try setting permissions in /dev/net to rwx. If the folder isn't present, create it.

  • 0
Posted Image

If you like one of my posts, or if it helps you out, vote it up! :)

(now updated device list and added twitter. Come stalk me ;) )

#12
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300

I tried your version, didn't work.
dmesg gives me the following, for both your build and one I compiled using your instructions.

[1978, insmod] [ 3390.762324] tun: no symbol version for module_layout
[4978, insmod] [ 3390.782884] do_exit: exit code=65280


OK. It seems that Module.symvers is not being created and this is the root of the problem. Set the version string as you had it and do a full kernel build... Let me know ;)

Edit: It seems a problem with the Netfilter TCP MSS component prevents a clean build, so I disabled it, fudged the version string for good measure and ran a full build. Module.symvers was created. Here's the modinfo output:

filename:	   /media/work/android/g300/android_kernel_huawei_u8818/drivers/net/tun.ko
alias:		  devname:net/tun
alias:		  char-major-10-200
license:	    GPL
author:		 (C) 1999-2004 Max Krasnyansky <[email protected]>
description:    Universal TUN/TAP device driver
depends:	    
vermagic:	   3.0.8-perf-00213-g8dfa62b preempt mod_unload modversions ARMv7

http://dl.dropbox.com/u/4942645/tun.ko

Any joy? This is bugging me now; I'm tempted to install the ROM in an emulator, but I don't want to update my handset to ICD yet...

Edited by unaszplodrmann, 29 July 2012 - 12:14 AM.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#13
khumhurezu

khumhurezu

    Newbie

  • Members
  • Pip
  • 10 posts
  • Devices:Ascend G300
You Sir, are a certified module guru! This worked perfectly. I bow before you. Many thanks!

  • 0

#14
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300
Two heads, eh. Glad we worked it out between us. I'll be looking to switch to ICS once an official ROM is out there, so this will save me head-scratching at a later date. I'll hopefully add modules for OTG support here when that time comes.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#15
omegamoon

omegamoon

    Regular

  • Members
  • PipPip
  • 133 posts
Interesting... nice read and great that it works. Thumbs up!

  • 0

#16
nosmicek

nosmicek

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:Huawei Ascend G300
I tried your version of cifs.ko, kernel 3.0.8-perf-00240- for my huawei g300, module loaded properly, but when trying to mount, the mount says "no such file or directory"

im just asking if having proper version of cifs.ko can influence mount in any way.. im starting to be desperate..

lsmod list module as live, all tools can access my network shared drives, but it fail only at mounting (with proper rights in target mount poins)..

  • 0

#17
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300
I never actually tried the CIFs module, other than checking it loaded correctly. I use ES File Explorer instead, on the odd occasion... I'm getting the same error n Gingerbread, so its not versioning thats the problem.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#18
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300
Just a quick heads up; after finally upgrading to ICS, I went about compiling a tun module for the new kernel version included with B944, but then found that a nice person at Huawei has built support directly into the kernel this time around.

Thanks, nice person at Huawei - very considerate of you! ;)

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth

#19
tmor

tmor

    Newbie

  • Members
  • Pip
  • 10 posts
  • Devices:Huawei Ascend G300
Hey unaszplodrmann, how is going the OTG support? :rolleyes:

  • 0

#20
unaszplodrmann

unaszplodrmann

    Diehard

  • Members
  • PipPipPipPip
  • 400 posts
  • Gender:Male
  • Devices:Huawei G300

Hey unaszplodrmann, how is going the OTG support? :rolleyes:


It was discussed briefly on IRC lastnight, as it happens ;) :rolleyes:

I have an OTG cable but not a hub. Like I said, I might give it a whirl soon, if I can drag myself from XCOM for an evening. I doubt the G300 can supply power and it would be better if someone with a hub and a power meter (for the safety of the precious G300) tested it.

  • 0
Kill the bee... and ultimately... you'll have nothing to spread on your toast — John Shuttleworth




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users