Insmod cifs.ko error - Android Q&A, Help & Troubleshooting

Hello, i'm trying to add cifs.ko kernel's module to my rooted (with Magisk) Redmi Note 9 Pro (Joyeuse Global).
On my Ubuntu computer, i've cloned smb3-cifs-linux-stable-backports (linux 4.14, the same kernel version as my phone run) and compiled the cifs.ko module using
Code:
make -C . M=fs/cifs ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
The kernel module compiled successfully, then I've created a Magisk module which load into /vendor/lib/modules the compiled cifs.ko, but I get
Code:
insmod: failed to load cifs.ko: Required key not available
, but my compiled kernel module isn't signed and i've checked a factory kernel module : isn't signed too.
I don't know what i've done wrong, if someone can tells me how to do and how.
Thanks

could you resolve this? I want to add cifs in the same kernel (v4.14.180). do you have the cifs.ko file? thank you!

Related

[Q] Need help with compiling modules for Dell Streak Froyo stock kernel

Need help with compiling modules for Dell Streak kernel.
Because i could not find cifs.ko module for mounting network shares for Dell Streak stock Froyo 318, i decided to make it on my own.
I did not have any clue how can it be done, but with lot of googling and reading forum posts on xda and modaco, i got vague idea how i can do it.
There was lots of trial-and-error attempts until i learned how to use all comands and tools, and here is final list of things id did to make it:
Already had VMWare workstation with Ubuntu 10.10 instalation, i got Android Froyo source tree from net, replaced kernel with Dell Streak 3.09 kernel (from opensource.dell.com) which is also Froyo, i think, and is closest to my kernel version (318).
Got toolchains from codesourcery.com
Extracted my phone config from /proc/config.gz, renamed to .config, uncommented and changed option for CONFIG_CIFS=m. Did same for tun.ko module which i did not need, but just for comparison. Placed .config file in kernel root.
Did comand:
Code:
make ARCH=arm CROSS_COMPILE=/path-to-toolchains/bin/arm-none-eabi- modules
after confirming some options (irellevant to this), and some compiling in terminal, all went ok without errors and did produce modules in fs/cifs and drivers/net
i also did some debugging to reduce filesize, bud also had tried module without debugging with same result (see below)
transferred modules to my phone in /system/lib/modules and tried to load them via insmod.
loaded tun.ko without problem (i dunno whteher is working because i have no means to try it and have no need for it). i compiled it just to see whether it will be loaded in phone kernel. it DID load without error messages.
when tried to load cifs.ko via insmod cifs.ko, got this error message:
Code:
insmod: init_module 'cifs.ko' failed (no such file or directory)
dmesg provided following errors:
Code:
cifs: Unknown symbol slow_work_register_user
cifs: Unknown symbol slow_work_enqueue
found in similar thread for Galaky Tab that i need to compile slow_work module and load it before because of that dependancies, Found another thread with instructions for compiling slow-work, followed them:
copied all slow-work files in cifs, Remove the calls to round_jiffies in fs/cifs/slow-work.c: round_jiffies(jiffies + SLOW_WORK_CULL_TIMEOUT)); changed to
jiffies + SLOW_WORK_CULL_TIMEOUT); AND round_jiffies(jiffies + SLOW_WORK_OOM_TIMEOUT)); TO jiffies + SLOW_WORK_OOM_TIMEOUT);
edited fs/cifs/Makefile and added slow-work.o to the obj-$(CONFIG_CIFS) += cifs.o line: obj-$(CONFIG_CIFS) += cifs.o slow-work.o.
Ran make command from above, got both modules (cifs.ko and slow-work.ko) in fs/cifs directory without errors.
Copied them to phone, done insmod and got error for slow-work:
Code:
insmod: init_module 'slow-work.ko' failed (no such file or directory)
dmesg provided following message:
Code:
slow_work: module licese "unspecified" taints kernel
slow_work: Unknown symbol mutex_lock_nested
Now i'm clueless (like i haven't been all the time :-D).
All modules compiled without errors, tun.ko will load, cifs.ko apparently need slow-work to run, slow-work compiled, but can't load.
So, if somebody can help, or point me where is possible error, i will be very grateful.
UPDATE:
Found references for missing slow_work modules in cifsfs.c and misc.c, deleted them and ran make.
produced cifs.ko without error.
LOADED cifs in phone without error!!!! With lsmod it shows that module is loaded!
BUT, does not work! Cannot mount anything. When tried with cifsmanager or manually via terminal get error message "No such device" which points that there is no valid cifs.ko module in kernel.
So, module is produced and loaded in phone without errors, BUT DOES NOT WORK. It looks like Streak Froyo need slow-work module after all...
I'm desperate, please if somebody did compiling cifs.ko for Streak, or use cifs mounting with found module, share your thoughts and experiences.
Thanks everybody.
CIFS and Slow worked - compiled
I was able to successfully compile both the slow work module and the CIFS module for the most recent 4G EVO. Took me a couple of days, but I think I could walk you through the specifics fairly easily. Let me know if you want the details.
of course I do!
please write your way.
Sent from my Dell Streak using XDA Premium App
dmandic, did you ever get this working? I went through similar pains doing this for the xperia arc, and did manage to get it working. I have some thoughts about your situation if you want to discuss further.
please, any help is appreciated.
i'm open to any kind of suggestions.
write your thoughts here.
Sent from my Dell Streak using XDA Premium App
Hmm. I originally stumbled upon this thread because I was searching for others who compiled a cifs.ko against a kernel with version "2.6.32.9-perf" (from the android about phone menu), hoping to avoid going through figuring out how to do this. I saw that others with the Dell Streak also had this kernel, and then I found your thread.
Anyway, I was thinking that maybe the kernel you got from the dell website had a slightly different version than your phone (because your phone is 3.18 vs 3.09), and that's why you're getting runtime symbol errors. I thought maybe there's a chance you needed exactly 2.6.32.9-perf and I could offer you mine. However, I downloaded the dell 3.09 kernel source and found that it's also 2.6.32.9-perf... so I guess that idea's out the window. (By the way, is this what your phone shows?)
Well just for kicks, I actually compiled slow-work and cifs from the dell kernel and loaded it on my xperia arc phone and they worked (was able to use CIFSManager).
It's a long shot but just in case there's something about the way you're compiling them, I attached them here - give it a try. [Edit: Duh, I forgot I need your .config file. Email it to me and I'll re-post these]
I tried out the Xperia files from the thread [DEV]TUN, CIFS modules files on my Streak 5. It did not go well, these are my messages from dmesg.
Code:
<4>[ 341.187030] tun: Unknown symbol dynamic_debug_enabled
<4>[ 341.190600] tun: Unknown symbol dynamic_debug_enabled2
<4>[ 341.219513] slow_work: module license 'unspecified' taints kernel.
<4>[ 341.220411] slow_work: Unknown symbol mutex_lock
<4>[ 341.638099] cifs: Unknown symbol mem_section
<4>[ 341.638397] cifs: Unknown symbol mutex_lock
<4>[ 341.641609] cifs: Unknown symbol slow_work_register_user
<4>[ 341.642835] cifs: Unknown symbol slow_work_enqueue
Looks like the kernel is differently compiled and or still some modules missing.
I noticed that in another thread Samba/CIFS for Motorola defy froyo nls_utf8.ko also has been required, however I do not have the 2.6.32.9-perf version of this to try it out.
How has the progression been for you guys?

Galaxy S2 Compile a Kernel Module

I'm having an issue insmoding a kernel I built for my rooted galaxy s2. My end game is to get USB-ethernet working by building the asix module but I cant even get a ko from the default build to insmod.
I compiled a kernel based on what I downloaded from samsungs website "GT-I9100_OpenSource_Update3.zip" and followed the instructions included (basically run make with defconfig) I chose scsi_wait_scan.ko as a test because it was built with the default config and currently wasn't loaded on my phone.
Here's some info that's pertinent. Any help would be appreciated. I'm running Ubuntu 11.
# lsmod
lsmod
dhd 242604 0 - Live 0xbf02e000
j4fs 65002 1 - Live 0xbf018000 (P)
Si4709_driver 17347 0 - Live 0xbf00d000
bthid 3384 0 - Live 0xbf007000
vibrator 6724 2 - Live 0xbf000000
# insmod scsi_wait_scan.ko
insmod scsi_wait_scan.ko
insmod: init_module 'scsi_wait_scan.ko' failed (Exec format error)
# dmesg
...
<4>[19668.986907] scsi_wait_scan: disagrees about version of symbol module_layout
# modinfo scsi_wait_scan.ko
modinfo scsi_wait_scan.ko
modinfo: can't open '/2.6.35.7-I9100XWKI4-CL575468/': No such file or directory
# pwd
/mnt/sdcard
# ls -l
...
-rwxrwxr-x system sdcard_rw 32484 2012-01-12 10:21 scsi_wait_scan.ko
$ file scsi_wait_scan.ko
scsi_wait_scan.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
Solved:
I actually got this working after I met another developer through work. You need a ramdisk to compile into the kernel.
I can't post links yet but you can search for the thread on the google forms by googling: 'Tal Alon kernel' and it should give you a pretty good description of what to do.
unpack a boot.img from a backup with unpack-bootimg.pl and uncpio the bootdisk.
The geist of what i learned is that there is a line in the .config file that should read CONFIG_INITRAMFS_SOURCE="/path/to/bootimg/boot.img-ramdisk"
After you build the kernel, copy your .ko's to the ram disk folder in boot.img-ramdisk/system/lib/modules
compile the kernel again then tar the zImage and load with odin.
njdevi11 said:
I actually got this working after I met another developer through work. You need a ramdisk to compile into the kernel.
I can't post links yet but you can search for the thread on the google forms by googling: 'Tal Alon kernel' and it should give you a pretty good description of what to do.
unpack a boot.img from a backup with unpack-bootimg.pl and uncpio the bootdisk.
The geist of what i learned is that there is a line in the .config file that should read CONFIG_INITRAMFS_SOURCE="/path/to/bootimg/boot.img-ramdisk"
After you build the kernel, copy your .ko's to the ram disk folder in boot.img-ramdisk/system/lib/modules
compile the kernel again then tar the zImage and load with odin.
Click to expand...
Click to collapse
Hi, did you get your asix.ko to work? I'm trying the same thing, got the module to compile and load, even eth0 showed up but now I'm stuck. I'm unable to get any communication going, i get "invalid rx length" errors in dmesg for the eth0 interface.
Thanks

[Q] kernel modules for ICS, 2.6.39.4, error loading module

Hi there,
I would have posted this in /dev but you know...first post.
I was trying to apply these kernel modules: http://forum.xda-developers.com/showthread.php?t=1557868
but I'm getting the error "insmod: init_module '/system/lib/modules/cifs.ko' failed (Exec format error)", or if i use the busybox insmod i get the following error: "insmod: can't insert '/system/lib/modules/cifs.ko': invalid module format"
Are updated versions available for 2.6.39.4? I'm guessing the ones for 2.6.36.3 aren't inter-operable.
I haven't used the other bash-4.2.zip and config from the above link, is that necessary for this to work?
Thanks for any tips on getting these kernel modules working.
Thanks,
abactor
IRC channel
Is there an IRC channel that's in use for sony tablet S, by any chance?
compile module yourself?
You might be successful compiling the kernel modules yourself from the available source code and a crossplatform compiler on linux. It has worked for me for the tun module
Source code at sony.net, I cannot publish external links yet. But you can find the link e.g. in this thread at first page http://forum.xda-developers.com/showthread.php?t=1473621
The free Sourcery G++ Lite for ARM GNU Linux did a good job for me.
I don't know of any Tablet S IRC channels, but it would be cool if there was.
As for the modules, you do need to recompile it. Kernel modules (in practically every Linux flavour) are completely incompatible, even across minor revisions, but recompiling against the newest code and headers should yield the same result with a new module.
The Sony.net link walsera mentioned is (I believe) this one
Thanks guys,
I'll look into it. I've compiled c code for android under mingw, but I don't have a linux toolchain setup. Anyone try to compile these sorts of things on the device itself (I.e. not cross_compiled)? I just started playing around with a native android/arm gcc toolchain, but I was having linker issues I think, with crt0.o and libc and whatnot.
Thanks and take care,
Abactor
I've never tried it natively on the device, but there have been a couple of developments into native versions of gcc and whatnot, so that may be worth a look. You can always compile on your PC, then copy the ko over...
After mounting a debian chroot on the tablet and installing the needed tools, unpacking the kernel source, and copying over config.gz, and editing .config to build the needed modules then calling make modules everything seems to work. What's the best way to make them available and what modules do people need? I've done ntfs and tun so far.
Take care
A

MELE A1000 (Cortex A8) Kernel compiling - Modules

Hello,
I've recently bought a MELE A1000 [link], which currently has ICS and Linux kernel version 3.0.8.
But I've come across a problem; my Xbox 360 wired usb joystick isn't working with the MELE.
Research tells me that the module isn't compiled/included in the kernel [link]
This gives me two options, each with it's problems:
1- Re-compile the kernel, including the Xpad module:
I'd have to get the kernel source (either this "generic" kernel, or this Allwinner-specific kernel) then include it in the boot image, which is specific for the MELEA1000 link (check the first comment with the Chinese link to the official image)
Problems with this option
a) I don't know if the generic kernel will work with my device (Are there differences other than included modules?)
b) I can't compile the specific Allwinner kernel for some reason
c) Will the specific boot image work with a custom kernel? I think so.
2- Compile and include the module with insmod
I'd have to get the source of the ffmemless module [Source] and the xpad module [Source], compile them and do insmod to get them working.
Problems with this option
a) I can't seem to compile the modules in the correct version for my kernel (kernel 3.0.8+ #24 PREEMPT, armv71)
b) the precompiled modules I found were for 2.6*
Easiest scenario: compile modules + insmod.
Ideal scenario: get custom kernel, working + mod the rom (this is not within this thread's scope)
Could you give me any links, ideas or keywords to help me continue?
PS: I'm a programmer and I have previously modded/compiled kernels (from Debian's official repositories though)
Thanks
With information I've been reading I got up to this point:
Download the ARM kernel
git clone git://github.com/amery/linux-allwinner.git
Install the necessary libraries / binaries
apt-get install gcc-4.4-arm-linux-gnueabi build-essential u-boot-tools (if u-boot-tools not found, try uboot-mkimage)
Configure
make ARCH=arm sun4i_defconfig
make ARCH=arm xconfig
Check the following modules:
Input device support -> Support for memoryless force-feedback device
Input device support -> Joystick / gamepad
Input device support -> Joystick / gamepad -> X-box gamepad
Compile the modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j3 INSTALL_MOD_PATH=output modules
Then move the xpad.ko module to the MELE and run insmod xpad.ko, but I'm stuck with xpad: disagrees about version of symbol module_layout
I'm guessing this is a compile issue.
I've started a blog in which I'll try to document everything I do in the most detailed way I can.
Cheers
I think easier will be to get already compiled modules for A10 3.0.8+ from some firmware. I got cp210x.ko from "Aurora CM9 Nightly By Feiyu 0803.zip", successfully insmod-ed it into my device, and later added that insmod command to autorun with script manager app. I checked xpad module - it is in this firmware.

Help adding CIFS support to kernels?

Often I find myself really liking a particular kernel for a particular device. The common problem I have found is that no CIFS support is added to the kernel.
I have donated to several kernel devs. I don't expect anything from them, I just wanted to show my appreciation.
However, usually my CIFS inquiries go unnoticed.
I would like to add CIFS support to other people's kernels for my personal use on my device.
I presume I will have to decompile and recompile kernels in the process?
Here is the specific case that I have :
Current setup:
Phone - Verizon Galaxy Note 2
ROM - Beans build 22 (Touchwiz)
Kernel - Perseus 36
I would like to use Imnuts' PBJ kernel. It doesn't support CIFS, whereas Perseus does.
So in theory I could extract the CIFS modules and inject them into PBJ? Any ideas? Any help would be appreciated. I would also be willing to donate to someone willing to build one for me (mods, let me know if that isn't cool to mention. ) I don't have a Linux box or the current means of acquiring a Linux box until early next year. I am curious if this can be done on Windows 7?
xdadevnube said:
Often I find myself really liking a particular kernel for a particular device. The common problem I have found is that no CIFS support is added to the kernel.
I have donated to several kernel devs. I don't expect anything from them, I just wanted to show my appreciation.
However, usually my CIFS inquiries go unnoticed.
I would like to add CIFS support to other people's kernels for my personal use on my device.
I presume I will have to decompile and recompile kernels in the process?
Here is the specific case that I have :
Current setup:
Phone - Verizon Galaxy Note 2
ROM - Beans build 22 (Touchwiz)
Kernel - Perseus 36
I would like to use Imnuts' PBJ kernel. It doesn't support CIFS, whereas Perseus does.
So in theory I could extract the CIFS modules and inject them into PBJ? Any ideas? Any help would be appreciated. I would also be willing to donate to someone willing to build one for me (mods, let me know if that isn't cool to mention. ) I don't have a Linux box or the current means of acquiring a Linux box until early next year. I am curious if this can be done on Windows 7?
Click to expand...
Click to collapse
There may be a simpler method of doing this using insmod and downloadable cifs.ko module rather then taking the developers kernel source and then compiling it to include the cifs.ko module, using the following steps:
1. Make sure you have the latest version of Busybox installed
2. Download this .7z file and extract it's contents the modules you want are md4.ko and cifs.ko (Even though the .zip says Nexus 10 it should still work on your device).
3. Take the md4.ko module and cifs.ko module and place them in your /system/lib/modules folder (Make sure to mount the /system folder as read/write first and if the /system/lib/modules folder doesn't exist make sure to create it and set the proper permissions which should be the same as the /system/lib folder).
4. Now that you have placed the md4.ko and cifs.ko module in the /system/lib/modules folder run the following command:
Code:
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
5. After that completes you should now be able to use the cifs.ko module to perform your desired task.
Let me know if you still have questions I'll be happy to help you out.
shimp208 said:
There may be a simpler method of doing this using insmod and downloadable cifs.ko module rather then taking the developers kernel source and then compiling it to include the cifs.ko module, using the following steps:
1. Make sure you have the latest version of Busybox installed
2. Download this .7z file and extract it's contents the modules you want are md4.ko and cifs.ko (Even though the .zip says Nexus 10 it should still work on your device).
3. Take the md4.ko module and cifs.ko module and place them in your /system/lib/modules folder (Make sure to mount the /system folder as read/write first and if the /system/lib/modules folder doesn't exist make sure to create it and set the proper permissions which should be the same as the /system/lib folder).
4. Now that you have placed the md4.ko and cifs.ko module in the /system/lib/modules folder run the following command:
Code:
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
5. After that completes you should now be able to use the cifs.ko module to perform your desired task.
Let me know if you still have questions I'll be happy to help you out.
Click to expand...
Click to collapse
I'm trying to do this on my Nexus 10 with stock 5.1.1 rooted and busyboxed but i get the following error when attempting to insmount the modules:
255|[email protected]:/ # insmod /system/lib/modules/md4.ko
insmod: init_module '/system/lib/modules/md4.ko' failed (function not implemented)
Click to expand...
Click to collapse
modules folder and files are chmod 777, btw.
Did you ever find a solution to this? I'm stuck at the same error message.

Categories

Resources