Disable version magic in kernel - XDA-University

Hi
id like to load some modules inside my kernel,
but get everytime this error:
insmod: init_module 'sdcard/tntfs.ko' failed (Exec format error)
tntfs: version magic '3.1.10-00016-gca625c5-dirty SMP preempt mod_unload ARMv7 ' should be '3.1.10+ SMP preempt mod_unload ARMv7 '
Please, could someone tell me, how i can load this module?
What i have to chance or mod inside kernel source to get this module load?
Very big thanks

since it's shorter you can try to hexedit module and fill the rest of the string with zero

Or just compile the modules along with the kernel. That way there will be no error. I had this once, but I solved it by compiling the modules right after compiling the kernel.

Related

[Q] looking for cifs.ko & nls_utf8.ko

Hi.
I'm looking for cifs.ko & nls_utf8.ko for optimus2x.
Does anybody know how to build it?
I am trying to make my NAS mounted to optimus2x.
I hope I can watch my movie that is in NAS with my phone.
I'm looking for those aswell...
just today i have setup the kernel sources for the 2X (Korean version) and compiled a kernel successfully.
If you point me to the sources of the modules you seek i can have a look and see if i can compile them and post them here...
Check the attached zip file. Compiled against the beforementioned kernel sources.
Goddchen said:
Check the attached zip file. Compiled against the beforementioned kernel sources.
Click to expand...
Click to collapse
Well I first copied them to /system/lib/modules
Then I tried to mount them with insmod via CifsManager then i tried in Mount Manager both with no luck. (although nls_utf8.ko shows up as mounted with the lsmod command)
I then checked the Mount Managers log.
It shows that insmod gave the following exitcodes:
255
stdout:
stderr: insmod: init_module '/system/lib/modules/cifs.ko' failed (No such file or directory)
and
255
stdout:
stderr: insmod :init_module '/system/lib/modules/nls_utf8.ko' failed (File exists)
I did try moving them to a folder inside the sdcard folder but still no luck. :/
I don't get why it says "stderr: insmod: init_module '/system/lib/modules/cifs.ko' failed (No such file or directory)" I know it's there?
Any idears?
BTW. It's a european version P990.
hey, this is indeed strange.
could you try to using "modprobe cifs.ko" from the console and not an app?
Yes it's the source the korean version, but i don't think that the kernel will differ much between the regional versions. I think it should work.
Sorry for the delay
Well we tried running a console thru adb, browsed to the /system/lib/modules directory. Gave it a "ls" command to check if the files were there, no problems so far, 3 files found third one being wireless.ko apparently a standard modules.
Anyway we ran the modprobe command "modprobe cifs.ko" that resulted in a
modprobe : chdir(/lib/modules): No such file or directory
strange or what?
Same result if we give it "modprobe nls_utf8.ko"
I don't know how to get su access from the console.
"su modprobe cifs.ko" returns Permission denied.
Could it be a Super user problerm or a problem with modprobe looking in the wrong directory, "chdir(/lib/modules)" shouldn't that be chdir(system/lib/modules)?
I'm not good at linux or android terminal commands I only know the basics.
Anyway I hope you have some more ideas we will be ready to try them out.
and we hope you get yours soon so we can get CyanogenMod 7 for the LG Star/X2/P990/U660 which ever you prefer...
If you succeed I might consider getting one myself instead of my HTC Desire...
You see I'm using my friends LG Optimus X2 to try this cause it's a feature I want his to have... Don't worry I have his permission to play with it, but only when he's not using it...
of course you need root priviledges to load a kernel module.
So open a shell and type:
su
modprobe cifs.ko
Just tried to load the module using modprobe, didn't work, same output as Compix.
So I made a directory called /lib/modules and then tried to modprobe cifs.ko - the following error occured:
modprobe: chdir(2.6.32.9): No such file or directory
KernelCrap said:
Just tried to load the module using modprobe, didn't work, same output as Compix.
So I made a directory called /lib/modules and then tried to modprobe cifs.ko - the following error occured:
modprobe: chdir(2.6.32.9): No such file or directory
Click to expand...
Click to collapse
What are the modes on /lib/modules/?
djmcnz said:
What are the modes on /lib/modules/?
Click to expand...
Click to collapse
Its was mounted as r/w, if that is what you are asking. I deleted the folder, and I am hoping for a solution where I can just do like: insmod /system/lib/modules/cifs.ko
KernelCrap said:
Its was mounted as r/w, if that is what you are asking. I deleted the folder, and I am hoping for a solution where I can just do like: insmod /system/lib/modules/cifs.ko
Click to expand...
Click to collapse
No, I was wondering if the directory had x permissions and the files also had x permissions?
Yes, permissions was in order
Don't know why it wont load though.
Gonna try the cifs.ko from pauls rom.
EDIT: Same problem, perhaps I should just use his kernel?
Hello,
Same problem
I'm not able to mount my nas directories with cifsmanager or mount manager. Error message "no such file or device". It works perfectly on my HTC HD2 (with custom desire hd rom).
However I have no problem accessing the directory with es file explorer.
I've tried it today and it doesn't work. In cifsmanager is no cifs.ko loaded. Has anyone get it work?
did you ever get this sorted out ?
As I'm coming from a ZTE Blade to the LG optimus 2X, the Blade was able to see ALL my shares ok using cifsmanager.
I am now using eternals 2.3 kernal for froyo that is supposed to have cifs built in, but still does not work.
On a stock installation (2.6.32.9 kernel):
Code:
# pwd
/lib/modules/2.6.32.9
# ls
modules.dep.bb
nls_utf8.ko
cifs.ko
# modprobe cifs
modprobe: 'cifs.ko': unknown symbol in module or invalid parameter
# dmesg
...snip...
<4>[ 1539.994969] cifs: disagrees about version of symbol kernel_recvmsg
<4>[ 1539.994980] cifs: Unknown symbol kernel_recvmsg
<4>[ 1539.997420] cifs: disagrees about version of symbol kernel_sock_shutdown
<4>[ 1539.997428] cifs: Unknown symbol kernel_sock_shutdown
<4>[ 1539.999231] cifs: disagrees about version of symbol sock_create_kern
<4>[ 1539.999239] cifs: Unknown symbol sock_create_kern
<4>[ 1540.000164] cifs: disagrees about version of symbol sock_release
<4>[ 1540.000171] cifs: Unknown symbol sock_release
<4>[ 1540.000478] cifs: Unknown symbol slow_work_register_user
<4>[ 1540.001318] cifs: disagrees about version of symbol kernel_sendmsg
<4>[ 1540.001326] cifs: Unknown symbol kernel_sendmsg
<4>[ 1540.001614] cifs: Unknown symbol slow_work_enqueue
I suppose this means I need slow_work.ko to get CIFS running. If someone could post this here I'd really appreciate it.
Elsand said:
On a stock installation (2.6.32.9 kernel):
Code:
# pwd
/lib/modules/2.6.32.9
# ls
modules.dep.bb
nls_utf8.ko
cifs.ko
# modprobe cifs
modprobe: 'cifs.ko': unknown symbol in module or invalid parameter
# dmesg
...snip...
<4>[ 1539.994969] cifs: disagrees about version of symbol kernel_recvmsg
<4>[ 1539.994980] cifs: Unknown symbol kernel_recvmsg
<4>[ 1539.997420] cifs: disagrees about version of symbol kernel_sock_shutdown
<4>[ 1539.997428] cifs: Unknown symbol kernel_sock_shutdown
<4>[ 1539.999231] cifs: disagrees about version of symbol sock_create_kern
<4>[ 1539.999239] cifs: Unknown symbol sock_create_kern
<4>[ 1540.000164] cifs: disagrees about version of symbol sock_release
<4>[ 1540.000171] cifs: Unknown symbol sock_release
<4>[ 1540.000478] cifs: Unknown symbol slow_work_register_user
<4>[ 1540.001318] cifs: disagrees about version of symbol kernel_sendmsg
<4>[ 1540.001326] cifs: Unknown symbol kernel_sendmsg
<4>[ 1540.001614] cifs: Unknown symbol slow_work_enqueue
I suppose this means I need slow_work.ko to get CIFS running. If someone could post this here I'd really appreciate it.
Click to expand...
Click to collapse
I'm not sure where you would get slow_work.ko from as I don't have it on my device running Fear 10 and that had cifs support (and it works).
any news on this?
Goddchen said:
Check the attached zip file. Compiled against the beforementioned kernel sources.
Click to expand...
Click to collapse
Try compiling CIFS as driver not modules please. It'll work and It'll work without modprobe

Module tun.ko for stock adam kernel

Now that NI has released Adam kernel sources I have compiled tun.ko module, needed by VPNC and OPENVPN, but it not loads.
I followed this steps.
Obtain kernel sources from repository
git clone KERNEL GIT URL
Obtain config file from my Adam
adb pull /proc/config.gz
gunzip config.gz
Patch config file to include tun module
patch -b -i config.diff -p0 --verbose -Z
Create local build directory
mkdir modules
cd modules
Copy new config file
cp -a ../config .config
Patch Makefile
cp -a ../adam-kernel/Makefile .
patch -b -i Makefile.diff -p0 --verbose -Z
Rebuild tree
lndir ../adam-kernel
rm include/asm-arm
Compile tun module
../compilar_modulos.sh
Push module to Adam
adb push drivers/net/tun.ko /system/lib/modules/
Now, i connect to Adam
$ adb shell
# modprobe tun
modprobe: can't load module tun (tun.ko): invalid module format
#
Comparing the vermagic info from Adam kernel it looks as the processor type does not match:
# busybox modinfo tun
filename: tun.ko
...
...
...
vermagic: 2.6.32.9-00066-g16c1dec-dirty SMP preempt mod_unload modversions ARMv7
# uname -a
Linux localhost 2.6.32.9-00066-g16c1dec-dirty #1 SMP PREEMPT Thu Mar 24 10:03:47 IST 2011 armv7l GNU/Linux
#
Somebody knows what is wrong in my procedure?
Curious, which compiler are you using?
aorth said:
Curious, which compiler are you using?
Click to expand...
Click to collapse
Android NDK R5B.
This is the same compiler I used in the past to compile modules for HTC Hero.
albertogb said:
Android NDK R5B.
This is the same compiler I used in the past to compile modules for HTC Hero.
Click to expand...
Click to collapse
Did you ever get anywhere on this? I was thinking you should look in `dmesg`, as I'm not sure that architecture mismatch is the problem...
whats the progress with this? Any other detailed instructions on how to compile for specific adam kernels?

Kernel Repacking

First I would like to thank boog for all his help to get me to this point, but I'm stuck with an error.
I've been dipping my foot into the kernel unpacking and repacking waters. I'm currently using the attached two scripts boog sent me for unpacking and repacking as well as these toolchains, but this is what my output looks like after unpacking and then attempting to repack the stock I897UCKI2 kernel:
Code:
##### My name is ./repacker.sh #####
##### The source kernel is /media/C70D-E87A/Captivate/Kernels/I897UCKI2/zImage #####
##### The destination zImage file is /media/C70D-E87A/Captivate/Kernels/I897UCKI2/repacked/zImage #####
##### The directory of the initramfs has been selected #####
##### The initramfs is /media/C70D-E87A/Captivate/Kernels/I897UCKI2/initramfs_root (will be gzipped) #####
5970 blocks
##### 01. Extracting kernel from /media/C70D-E87A/Captivate/Kernels/I897UCKI2/zImage (start = 16541) to ./out/Image
321+1 records in
321+1 records out
5310899 bytes (5.3 MB) copied, 0.540424 s, 9.8 MB/s
gzip: stdin: decompression OK, trailing garbage ignored
##### 02. The size of the new initramfs is = 1851649 / original = 3056568
##### 03. The size of the Image is 13428224
##### 04. Making a head.img ( from 0 ~ 143360 )
1+0 records in
1+0 records out
143360 bytes (143 kB) copied, 0.000480648 s, 298 MB/s
##### 05. Making a tail.img ( from 3199928 ~ 13428224 )
3+1 records in
3+1 records out
10228296 bytes (10 MB) copied, 0.0784701 s, 130 MB/s
##### 06. Merging head + initramfs
##### 07. Checking the size of [head+initramfs]
##### 08. Merging [head+initramfs] + padding + tail
1+0 records in
1+0 records out
1204919 bytes (1.2 MB) copied, 0.0129411 s, 93.1 MB/s
#==========================================
##### Now we are rebuilding the zImage #####
#==========================================
##### 09. Image ---> piggy.gz
##### 10. piggy.gz ---> piggy.o
##### 13. head.o + misc.o + piggy.o ---> vmlinux
/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-ld: arch/arm/boot/compressed/vmlinux: Unknown mandatory EABI object attribute 44
/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-ld: failed to merge target specific data of file arch/arm/boot/compressed/piggy.o
/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-ld: arch/arm/boot/compressed/misc.o: Unknown mandatory EABI object attribute 44
/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-ld: failed to merge target specific data of file arch/arm/boot/compressed/misc.o
##### 14. vmlinux ---> zImage
/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-objcopy: 'arch/arm/boot/compressed/vmlinux': No such file
##### 15. Getting finished!!
cp: cannot stat `arch/arm/boot/zImage': No such file or directory
rm: cannot remove `arch/arm/boot/compressed/vmlinux': No such file or directory
rm: cannot remove `arch/arm/boot/zImage': No such file or directory
#==========================================
##### DONE!! #####
#==========================================
I ran the script like follows:
./repacker.sh -s /media/C70D-E87A/Captivate/Kernels/I897UCKI2/zImage -d /media/C70D-E87A/Captivate/Kernels/I897UCKI2/repacked/zImage -r /media/C70D-E87A/Captivate/Kernels/I897UCKI2/initramfs_root/ -c gzip
I've attempted to run the repack script normally and with sudo with the same output. Now I'm wanting to pick anyone's brain who will let me in why I'm having this issue.
I was able to compile a new zImage using these toolchains but I would be stuck in a kernel bootloop.
If you need or would like more info just let me know and I'll provide what I can.
Just thought I'd provide a little update and some more OS/hardware information.
I'm working off a laptop with a 1.6Ghz Intel Celeron M 380 and 1G of RAM running Kubuntu 11.04.
I read somewhere that some people have had issues with getting the repacking to work on 11.04 so I'm thinking about downgrading back to 10.04 or whatever is the LTS version is.
I did move the kernel to ~/Kernels/I897UCKI2/ to see if it being on the FATwhatever Flash drive was causing the issue or not with no luck.
Glad to see you put your knowledge to work Patience and u'll get it done, although it would be nice if someone would give u a hand on this. I would gladly do so if I only had the knowledge
gl
fuloplori said:
Glad to see you put your knowledge to work Patience and u'll get it done, although it would be nice if someone would give u a hand on this. I would gladly do so if I only had the knowledge
gl
Click to expand...
Click to collapse
This mostly came from boog's knowledge that he shared with me. I'm still trying out a few things, but so far I'm still stuck. Just burnt me a Ubuntu 11.04 disk that I'm going to try to boot Live from and see if I can't do it from there on my main/gaming PC.
If that doesn't work I'm going to use boog's kernel as a the base for the script mtcarey used to modify boog's kernel with and just replace the initramfs from it with the one I put together. The scripts wouldn't unpack any other kernel but boog's and require more then what the other unpack scripts unpack to repack. Doesn't look like it uses the toolchains though (seeing as I didn't have them installed at the time I used it to unpack boog's kernel).
U'd prolly came across this already, but thought I'd share what I've bumped into http://forum.xda-developers.com/showthread.php?p=15318639
While I didn't see that, I'm pretty sure those are the same (or almost the same) scripts I'm using. Thanks for the tutorial though.
I would like to unpack a kernel so I can change the boot animation of it and then repack it.
Is that hard to do?
whipps said:
I would like to unpack a kernel so I can change the boot animation of it and then repack it.
Is that hard to do?
Click to expand...
Click to collapse
boot animation is not in the kernel....
Pirateghost said:
boot animation is not in the kernel....
Click to expand...
Click to collapse
Sorry. I mean the black screen with the Samsung SGH-i897.
kernel is DarkCore
whipps said:
Sorry. I mean the black screen with the Samsung SGH-i897.
kernel is DarkCore
Click to expand...
Click to collapse
That requires the kernel source. Cannot be changed in the initramfs which is all that is unpacked.
Sent from my SAMSUNG-SGH-I897 using XDA App
Go to ficeto's git hub for the source.
It should still be there,
we use a custom kernel splash for darkcore in mosaic.
studacris said:
Go to ficeto's git hub for the source.
It should still be there,
we use a custom kernel splash for darkcore in mosaic.
Click to expand...
Click to collapse
Thanks for the info.
This is where I went, https://github.com/ficeto, but I'm not sure what I'm looking for.
whipps said:
Thanks for the info.
This is where I went, https://github.com/ficeto, but I'm not sure what I'm looking for.
Click to expand...
Click to collapse
I believe the bottom two from the following url are the ones you want I believe.
https://github.com/DarkyROM/
Kyuta Syuko said:
I believe the bottom two from the following url are the ones you want I believe.
https://github.com/DarkyROM/
Click to expand...
Click to collapse
That looks like what I need, but I hate to say I'm not that advanced to try unpacking a kernel on my phone just to change the boot image.
I guess I will just deal with it.

Droid 3 cifs.ko

This is in response to this thread in the developers forum.
I have compiled the cifs.ko kernel module for the Droid 3 from the source code for build 5.5.1_84_D3G-20_TA-9 with kernel version 2.6.35.7-g790a33c found here. Slow-work.ko is not needed as it is built into the Droid 3 kernel.
Thanks, did it work for you?
I could insmod your cifs.ko, but the mount errored:
[email protected]_solana:/# insmod /system/lib/modules/cifs.ko
[email protected]_solana:/# busybox mkdir /sdcard/winshares
[email protected]_solana:/# busybox mount -t cifs //192.168.1.3/droid /sdcard/winshares
mount: mounting //192.168.1.3/droid on /sdcard/winshares failed: Invalid argument
Looks like my kernel version is the same: 2.6.35.7-g790a33c, but my Build# is slightly different: 5.5.1_84_D3G-55.
Could it be that?
Total noob question, but I thought we couldn't load cusom kernels with the phone being locked. What gives?
Well, it's only loading a module into the kernel, you can do that once you have root.
I think the mount needs a username. Please add "-o username=guest" to your mount command.
Yes, thanks, that did it. Looks like username is not optional.
do you have the .config from the stock rom?
It was posted here:
http://forum.xda-developers.com/showpost.php?p=17088489&postcount=10
can you provide loop and ext2 ext3 support ko? thanks

[Q] tun.ko module

I'm running MyROM 1.2 and it doesn't have tun.ko which I need. I tried the installer from google play without success. I'm willing to change ROMS if necessary but I need to know which ones have it already integrated or how to install it. If I have to compile it please give details instructions.
go0 said:
I'm running MyROM 1.2 and it doesn't have tun.ko which I need. I tried the installer from google play without success. I'm willing to change ROMS if necessary but I need to know which ones have it already integrated or how to install it. If I have to compile it please give details instructions.
Click to expand...
Click to collapse
Module must be compiled exactly for your kernel version.
You have to download kernel sources, compile kernel and module, so vermagic of kernel and module will be the same.
I can try to compile this module for you, but you need to provide me content of your /proc/version file for spoof kernel version for verification.
Kostyan_nsk said:
Module must be compiled exactly for your kernel version.
You have to download kernel sources, compile kernel and module, so vermagic of kernel and module will be the same.
I can try to compile this module for you, but you need to provide me content of your /proc/version file for spoof kernel version for verification.
Click to expand...
Click to collapse
Hi Kostyan,
I'm not certain I know where to get the sources from and the next steps to compile the module. Is there a tutorial somewhere?
My /proc/version reads:
Linux version 3.0.8-00370-g3be8d90 ([email protected]) (gcc version 4.7 (GCC) ) #1 SMP PEEMPT Tue Sep 2 13:21:11 CST 2014
Click to expand...
Click to collapse
Create directory for module:
Code:
adb shell
su
mount -o rw,remount /system
cd /system/lib
mkdir modules
exit
exit
Copy module in /system/lib/modules
Set permission 644 for tun.ko
Try to load module:
Code:
adb shell
su
insmod /system/lib/modules/tun.ko
if insmod will fail, get error description by this command:
Code:
dmesg | grep insmod
P.S. All these operations requires full root access.

Categories

Resources