FORUMS

Analysis & Opinion

Top Forum Discussions

[Q] loading cifs module

154 posts
Thanks Meter: 10
 
By enigma0456, Senior Member on 2nd May 2011, 02:35 AM
Post Reply Subscribe to Thread Email Thread
Vegan ginger - loaded the standard with pershoot kernel but it has no cifs support. Replaced with clemsyn and cifs was great but after rebooting my screen hung and eventually I had to revert to my original without cuts. I think there is a way to instruct the pershoot kernel to load cifs support even thought it isn't compiled into the kernel. I'm looking for some step by step instructions to learn how to do that. Anyone know how?
 
 
2nd May 2011, 03:09 AM |#2  
aasoror's Avatar
Senior Member
Flag Kitchener, ON
Thanks Meter: 54
 
More
How about reading the instructions posted by pershoots on the very same page from which you downloaded the kernel ?!?

Quote:

To use one of the kernel modules:
Pull the one you want from lib-2632.39.tar.gz (winrar can open this),
adb remount
adb push MODULE.ko /system/lib/modules/2.6.32.39-cyanogenmod/
adb shell chmod 644 /system/lib/modules/2.6.32.39-cyanogenmod/MODULE.ko
adb shell insmod /system/lib/modules/2.6.32.39-cyanogenmod/MODULE.ko

- if you don't use adb then just use "terminal emulator" (from the market or preloaded with the some ROMs).
- replace "MODULE" with "cifs"
- use the lib file appropriate to your ROM and bootloader.

Best of luck,
Last edited by aasoror; 2nd May 2011 at 03:13 AM.
2nd May 2011, 05:08 PM |#3  
OP Senior Member
Thanks Meter: 10
 
More
Exclamation Yeah - that was helpful !
"How about reading the instructions posted by pershoots on THE VERY SAME PAGE FROM WHICH YOU DOWNLOADED THE KERNEL?!?"
Having a bad day were we???
The kernel came with the rom so I never downloaded a kernel and had no idea where the page was - your link was helpful in that it took me to that page (not on xda forum) so I was able to download the library anyway. Sadly, I am not using cyanogen so the paths listed in the instructions don't apply I don't think. I'm also not using adb yet although I'm working up to it. I can use terminal emulator so that shouldn't be a problem assuming I find where to put the module. Possibly it can go anywhere in the system/lib/modules directory as long as I can point to it? I guess we'll have to try it and see.
The real question that you have raised is "use the lib file appropriate to your ROM and bootloader." How do you determine what is "appropriate"?
So perhaps someone would be willing to share a tad more knowledge and perhaps we will have a thread that other g-tab owners can use to learn from.
2nd May 2011, 06:16 PM |#4  
thebadfrog's Avatar
Senior Member
Thanks Meter: 470
 
More
Pushing modules in the kernel is the same no matter the rom and vegan ginger is built from cm source anyway
2nd May 2011, 06:36 PM |#5  
OP Senior Member
Thanks Meter: 10
 
More
Quote:
Originally Posted by thebadfrog

Pushing modules in the kernel is the same no matter the rom and vegan ginger is built from cm source anyway

So I downloaded lib-2632.39.tar.gz and unpacked it, searched around and found the cifs.ko file. I'm guessing that I can put that anywhere logical in /system/library and point to it. My app (CIFS Manager) has an option to load via insmod and asks for a path to it. I'm assuming that insmod is available and my app will call it to load the module? I'd also like to know how I would know without someone telling me that the module was in lib-2632.39.tar.gz? Is there some rationale that would tell me how this library and the kernel are related or are these libraries just generic in some way? Thanks for the helping hand.
2nd May 2011, 07:27 PM |#6  
thebadfrog's Avatar
Senior Member
Thanks Meter: 470
 
More
http://forum.xda-developers.com/showthread.php?t=903505
2nd May 2011, 09:38 PM |#7  
Senior Member
Thanks Meter: 57
 
More
Quote:
Originally Posted by enigma0456

I would know without someone telling me that the module was in lib-2632.39.tar.gz?

The kernel developers who provide the kernels and the extra optional modules provide information on their blogs when they post the availability of the kernel. For example, pershoot's blog has this info, as well as install instructions.

or you ask here.
2nd May 2011, 09:46 PM |#8  
aasoror's Avatar
Senior Member
Flag Kitchener, ON
Thanks Meter: 54
 
More
Quote:
Originally Posted by enigma0456

The kernel came with the rom so I never downloaded a kernel and had no idea where the page was.

Sorry I mistakenly assumed since you mentioned pershoot that you have been to his thread (the most active in the development section).

Quote:
Originally Posted by enigma0456

Possibly it can go anywhere in the system/lib/modules directory as long as I can point to it?

Yes you certainly can.

Quote:
Originally Posted by enigma0456

How do you determine what is "appropriate"?

If you have a gingerbread based ROM download the the lib file with "gb" in its file name.
If you have a the new bootloader on the your gtab use the ones with "newbl" in the file name.

Quote:
Originally Posted by enigma0456

So I downloaded lib-2632.39.tar.gz and unpacked it, searched around and found the cifs.ko file.

Thats the wrong file (this is the one for Froyo ROMs).

Quote:
Originally Posted by enigma0456

I'm assuming that insmod is available and my app will call it to load the module?

True

Quote:
Originally Posted by enigma0456

I'd also like to know how I would know without someone telling me that the module was in lib-2632.39.tar.gz?

You wouldn't.

Quote:
Originally Posted by enigma0456

Is there some rationale that would tell me how this library and the kernel are related or are these libraries just generic in some way?

There isn't any, just the developers choice.
The Following User Says Thank You to aasoror For This Useful Post: [ View ]
2nd May 2011, 09:54 PM |#9  
thebadfrog's Avatar
Senior Member
Thanks Meter: 470
 
More
^^^^ Good job lol
3rd May 2011, 02:08 AM |#10  
OP Senior Member
Thanks Meter: 10
 
More
Thanks - that was really helpful. I like direct answers to questions. So I went and got the right library (looked for gb in name as directed). Moved the module onto my tab into a download directory via usb. Went to /System/Lib via terminal and there was no modules directory. I tried to make one and got an error that the file system is mounted read only. Arghhh I remember fighting with this when I was trying to install another keyboard. I never was able to resolve it. Theoretically "remount" should work but I searched and tried all different examples and I was never able to get it to work for me. I tested my cifs manager and it errors out - providing a base that cifs doesn't work without the module. I'm going to try pointing it at my download folder for now to see if the module would work. That is pretty messy so I would still like to put it in the proper place - if you feel up to it would you instruct me on how to overcome the deadly "mounted read only" file system problem?
________________________________
Update - put the cifs.ko file in /sdcard/download. Went into cifs manager and told it to load via insmod. Made path to cifs.ko = /sdcard/download (also tried /sdcard/download/cifs.ko) In all cases I get the message "... failed no such device". If I turn off the insmod feature I get the same message which leads me to believe that the cifs.ko isn't loading. As a test, I am using the exact same path to share, mount point, etc. on my other tab running Clemsyn/Calkulin that has cifs built into the kernel and it connects almost instantly. It is likely therefor that my problem revolves around this kernel loading cifs. Not sure what I'm doing wrong but suggestions are welcome.
Last edited by enigma0456; 3rd May 2011 at 02:32 AM. Reason: update
3rd May 2011, 03:34 AM |#11  
Senior Member
Flag Bangalore
Thanks Meter: 406
 
More
Quote:
Originally Posted by enigma0456

I'm guessing that I can put that anywhere logical in /system/library and point to it.

It's better if you put it in the standard place. What's the standard place? The paths in the kernel zip file and the module tar file should give you a clue:

Code:
$ tar -tzvf /mnt/sdcard/kernel/lib-2632.39_gb.tar.gz 
drwxr-xr-x root/root         0 2011-04-30 20:14:37 lib/
drwxr-xr-x root/root         0 2011-04-30 20:14:37 lib/modules/
drwxr-xr-x root/root         0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/
-rw-r--r-- root/root        73 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/modules.ieee1394map
-rw-r--r-- root/root     10709 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/modules.symbols.bin
-rw-r--r-- root/root       271 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/modules.alias
drwxr-xr-x root/root         0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/
drwxr-xr-x root/root         0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/
drwxr-xr-x root/root         0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/
drwxr-xr-x root/root         0 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/auth_gss/
-rw-r--r-- root/root    408035 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/auth_gss/rpcsec_gss_krb5.ko
-rw-r--r-- root/root    532157 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/auth_gss/auth_rpcgss.ko
-rw-r--r-- root/root   3424305 2011-04-30 20:14:37 lib/modules/2.6.32.39-cyanogenmod/kernel/net/sunrpc/sunrpc.ko
Looks like the kernel modules need to be in a lib/modules/KERNEL-VERSION/ directory. That looks very Linux-ish. Can we just untar it to / as we do in Linux? Better check:

Code:
$ ls -l / | /system/xbin/fgrep lib
$
Yikes! No /lib directory at all on Android. Where the heck do the kernel modules go? Let's look at the kernel zip file to see if there is a clue--the unzip on the gTablet doesn't understand this zip file format, so check on a Linux system:

Code:
$ unzip -l boot-cm_2632.39_gb-oc-uv-xtra-vfp_fp-043011.zip 
Archive:  boot-cm_2632.39_gb-oc-uv-xtra-vfp_fp-043011.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
     1123  2008-02-28 21:33   META-INF/MANIFEST.MF
     1176  2008-02-28 21:33   META-INF/CERT.SF
     1714  2008-02-28 21:33   META-INF/CERT.RSA
   252000  2008-02-28 19:33   META-INF/com/google/android/update-binary
     1015  2098-06-15 19:23   META-INF/com/google/android/updater-script
    88544  2098-01-27 05:41   kernel/dump_image
    76132  2098-01-27 05:54   kernel/mkbootimg
      303  2098-03-22 09:35   kernel/mkbootimg.sh
    70992  2098-01-27 05:53   kernel/unpackbootimg
       56  2098-01-27 06:09   kernel/unpackbootimg.sh
  2219848  2098-06-22 03:05   kernel/zImage
    12234  2098-03-04 12:32   system/lib/hw/wlan/LICENSE.TXT
   258778  2011-04-30 16:14   system/lib/hw/wlan/bcm4329.ko
   249144  2011-04-11 01:13   system/lib/hw/wlan/fw_bcm4329.bin
   249467  2011-04-11 01:13   system/lib/hw/wlan/fw_bcm4329_apsta.bin
        0  2011-01-07 02:11   system/lib/modules/2.6.32.39-cyanogenmod/placeholder
---------                     -------
  3482526                     16 files
Hmm, there is a placeholder file in system/lib/modules/KERNEL-VERSION/, so /system's where the modules are supposed to go.

Code:
$ su
# /system/xbin/mount -w -o remount /system
# cd /system
# /system/xbin/tar -xzvf /mnt/sdcard/kernel/lib-2632.39_gb.tar.gz
# /system/xbin/mount -r -o remount /system
Quote:

My app (CIFS Manager) has an option to load via insmod and asks for a path to it. I'm assuming that insmod is available and my app will call it to load the module?

Asks a path to what? Insmod or the kernel module?

Quote:

I'd also like to know how I would know without someone telling me that the module was in lib-2632.39.tar.gz?

Kernel functionality, like filesystems, are either built into the kernel or added using kernel modules. (You can also have filesystems implemented in userspace, but, we'll skip that complexity for now). So, the guy who gave you the kernel would either have compiled the filesystem in or must supply the module file for it. First, check if the filesystem is built-in:

Code:
$ cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   debugfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   inotifyfs
nodev   configfs
nodev   devpts
        ext3
        ext2
        ext4
nodev   ramfs
        vfat
        msdos
        yaffs
        yaffs2
No CIFS, so it's not compiled in; we'll have to load the module:

Code:
$ su
# insmod /system/lib/modules/2.6.32.39-cyanogenmod/kernel/fs/cifs/cifs.ko
# cat /proc/filesystems
nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   tmpfs
nodev   debugfs
nodev   sockfs
nodev   usbfs
nodev   pipefs
nodev   anon_inodefs
nodev   inotifyfs
nodev   configfs
nodev   devpts
        ext3
        ext2
        ext4
nodev   ramfs
        vfat
        msdos
        yaffs
        yaffs2
nodev   cifs
Yup, CIFS is there now. But, this sort of thing gets tedious. You can use a shell script to make things easier. Here's what I use to mount my external USB HDD:

Code:
#!/system/bin/sh

PATH=/system/bin:/system/xbin

lsmod | fgrep -q nls_utf8 || insmod /system/lib/modules/`uname -r`/kernel/fs/nls/nls_utf8.ko
lsmod | fgrep -q ntfs     || insmod /system/lib/modules/`uname -r`/kernel/fs/ntfs/ntfs.ko

exec mount -r -t ntfs -o fmask=0111,dmask=0022,nls=utf8 /dev/block/sda1 /mnt/usbdisk
Just save the file somewhere and make it executable and run the script as superuser to mount the USB HDD.

Quote:

Is there some rationale that would tell me how this library and the kernel are related or are these libraries just generic in some way?

Since these are kernel modules, they are by definition related, no?

Note that you need a Terminal Emulator and the Superuser app (both from Market) and busybox (also from Market) for the above commands to work. Also, do not type in the prompts (the '$' and '#' characters) at the beginning of the commands. They are there as a reference to show you when you're in superuser mode and when you're a normal user.
Last edited by rajeevvp; 3rd May 2011 at 03:36 AM.
The Following 2 Users Say Thank You to rajeevvp For This Useful Post: [ View ]

Read More
Post Reply Subscribe to Thread

Tags
cifs, kernel
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes