cifs module for 3.1.10-g52027f9

Search This thread

qwerp_

Senior Member
Oct 8, 2010
387
159
================================(updated 25/07/2012)
recompile new cifs.ko based on code from linux kernel 3.2.1 (with asynchronous read support).

there is 2 extra function needed in part of the kernel (which is not in the current 3.1.10 kernel).

however that doesn't stop it from working.

i am not sure under what conditions those 2 function will be called. when its being called, it might give error.

apart from that, initial test shows promising result. doubled the read speed.

please test.

do note. YMMV

new cifs.ko has a md5sum of
280303e69a92cd56f180956c838edbbd
in
cifs-async.zip

thanks.

===================================
updated,

i have re-compile a new cifs.ko with modified larger rsize, hopefully will have better read performance,

give it a try.

note: it appears that your NFS server needs to have support as well. so check out if you can set it to a bigger send buffer to have a faster read speed.

the md5sum for the new cifs.ko is
7a235de92c855b2933402dd1c62610fe

in
cifs_rsize_128k.zip

===========================================================
(require root to work).

i have created cifs module for the new 4.1.1 kernel for nexus 7
3.1.10-g52027f9

use this in conjunction with cifs manager

both
md4.ko and cifs.ko must be loaded to work.

as for the native language support (nls_utf8.ko), its down to yourself.

to use it,
under cifsmanager (when creating a new share)
set options "iocharset=utf8"

have fun streaming video!!!
 

Attachments

  • jb-3.1.10-g52027f9.zip
    1.6 MB · Views: 4,478
  • cifs_rsize_128k.zip
    1.5 MB · Views: 1,431
  • cifs-async.zip
    1.5 MB · Views: 1,490
Last edited:

Cgc2

Member
Mar 24, 2011
9
0
(require root to work).

i have created cifs module for the new 4.1.1 kernel for nexus 7
3.1.10-g52027f9

use this in conjunction with cifs manager

both
md4.ko and cifs.ko must be loaded to work.

as for the native language support (nls_utf8.ko), its down to yourself.

to use it,
under cifsmanager (when creating a new share)
set options "iocharset=utf8"

have fun streaming video!!!


I guess if I have to ask I shouldn't do it, but but what does this do?
 

Salty Wagyu

Senior Member
May 28, 2011
660
199
England
I guess if I have to ask I shouldn't do it, but but what does this do?

I may be wrong, but I believe it's to get CifsManager to mount your windows network shares automatically when rebooting your Nexus 7, so you don't have to mount a share manually every time.

Looking forward to trying this out when I get my Nexus 7. Thanks :)
 

qwerp_

Senior Member
Oct 8, 2010
387
159
I guess if I have to ask I shouldn't do it, but but what does this do?

this allow you to mount windows drive, or even network enabled storage.

so that your video player like dice player or vlc can stream/play the file as its local.

its similar to using //192.168.1.1 on windows.

I may be wrong, but I believe it's to get CifsManager to mount your windows network shares automatically when rebooting your Nexus 7, so you don't have to mount a share manually every time.

Looking forward to trying this out when I get my Nexus 7. Thanks :)

it doesn't mount automatically, but provide the interface to mount drive easily.
 

Cgc2

Member
Mar 24, 2011
9
0
Wow, interesting and thanks for educating me on this use. However, why not use Airdroid and achieve similar results? Still learning, Thx folks.
 

tylerwatt12

Senior Member
Sep 30, 2010
526
171
Cleveland
www.tylerwatt12.com
We only have 6/15 GB to work with. Now, for me I can have 500GB and the apps will even index it for me just as if there were a folder with infinite amount of space on my sdcard

Sent from my Nexus 7 using xda app-developers app
 

qwerp_

Senior Member
Oct 8, 2010
387
159
this is basically similar to

External Storage Device Compatibility Review
http://xdaforums.com/showthread.php?t=1766260

where instead of the "mounted" drive comes from your usbOTG cable reading from a external hardisk or card reader,
your mounted drive is a shared drive on your network. NAS drive, windows PC, linux, etc, anything that supports

Common Internet File System (CIFS)
http://en.wikipedia.org/wiki/Server_Message_Block

you will need to know abit of linux/android system to properlly use this,
make sure that your "nexus 7" about page, under kernel version matches "3.1.10-g52027f9", meaning you will have to OTA to 4.1.1 JRO03D to be able to use this.
 

flumpster

Senior Member
Apr 4, 2011
2,726
2,229
Rhondda Valleys
Mate this is exactly what I came looking for. Awesome.

I use cifs manager on all my android devices because ES file explorer insists on fully caching apks before installing them doubling the time to do things.

Been setting up the missus nexus and it was a bit hard to explain to her how to get to the smb movies/series in ES file explorer to stream stuff.

Installed this, mx player and MovieBrowser HD from market and she now only needs to go into MovieBrowser and she has all her movies/series with lovely artwork and synopsis,and just clicks on anything and it automatically plays in mx player.

Good job sir, I don't need a custom kernel just for cifs.
 
  • Like
Reactions: whycali

flumpster

Senior Member
Apr 4, 2011
2,726
2,229
Rhondda Valleys
Forgive me for being naive, is this a CWM flashable zip?

if not, what folder do i need to place these modules?

I created a folder in system/lib/ called modules and gave it permissions rwxr-xr-x

I extracted the 3 files into it and gave them each permissions rw-r--r--

Then install cifs manager from google play.

In cifs manager go to settings.

Click mount point prefix and type /storage/sdcard0/Shares
Tick on "load cifs module"
Tick on "Load via insmod"
Click path to cifs.ko and type /system/lib/modules/cifs.ko:/system/lib/modules/md4.ko:/system/lib/modules/nls_utf8.ko

Go back to main cifs manager page and add new share.

Under share path type "your ip of computer with shares on/sharename of folder on computer" eg. 192.168.0.6/Movies

Click under mount point and it will fill it in for you.

Under username put your username for PC that you log in with

Under password put the password that you log into your computer with.

Under options type ioch****t=utf8 (they have now banned a word that is within this word. It should be i o c h a r s e t without the spaces.)

Click save share.

Now when you click on the share name in cifs manager it should turn the light green to the right of it. If it doesn't you have done something wrong.

Now go to any file manager and go to your sdcard on tablet and there should be a "Shares" folder and inside should be the share you set up.

You can now use that as if it was a local directory. If you restart the tablet you will need to go into cifs manager again and click on the shares you want until they turn green.

HTH
 
Last edited:

fruits99

Member
Jun 10, 2011
22
25
Whenever I set "iocharset=utf8" in options, I get segmentation fault when trying to mount a share. If I remove that option, then it mounts fine. But filenames in non-English characters (Chinese in my case) will either become garbage or not show at all.
Any one got "iocharset=utf8" to work? I've verified that all three modules are loaded correctly by cifsmanager.
 

martyg7

Senior Member
Oct 19, 2011
60
12
Under share path type "your ip of computer with shares on/sharename of folder on computer" eg. 192.168.0.6/Movies

Note for some incomprehensible reason CIFS manager requires a static IP address in the share specification.
(Just as described above) Do not assume hostnames will work here. They will not.

Thanks for the guide. Getting this feature turned up was high on my list.
 

flumpster

Senior Member
Apr 4, 2011
2,726
2,229
Rhondda Valleys
One word of warning because I know a mate of mine did this by accident.

If you have a share set up on your computer with full read/write access and then wipe your SD card on android (or just delete the shares folder in your file manager) while the share is mounted in cifs manager then it will also delete the folder on your computer.

I don't have this worry because all my shares on computer are set up as read only to stop the kids accidentally deleting stuff.

Just a warning ;)
 

Salty Wagyu

Senior Member
May 28, 2011
660
199
England
Thanks for the instructions flumpster, helped a lot.

Might also advise on mounting outside of /sdcard, was seeing a lot of LAN traffic and Nexus 7 activity - turned out a number of apps were creating thumbnails and/or indexing items that was on my NAS drive. Poweramp, Gallery, QuickPic etc.
 

flumpster

Senior Member
Apr 4, 2011
2,726
2,229
Rhondda Valleys
File Manager HD (Tablet) can play / view any type of file over SMB. Very simple.

So can ES file explorer which we already mentioned but that is not what we want.

This makes the folder ( or folders ) appear local so you can add it into any other app directly (mx player, movie browser hd, gallery, play music, etc)

---------- Post added at 08:11 AM ---------- Previous post was at 08:06 AM ----------

Thanks for the instructions flumpster, helped a lot.

Might also advise on mounting outside of /sdcard, was seeing a lot of LAN traffic and Nexus 7 activity - turned out a number of apps were creating thumbnails and/or indexing items that was on my NAS drive. Poweramp, Gallery, QuickPic etc.

I have not tested this but have you tried putting a .nomedia file inside the "Shares" folder after it is first created? In theory it should stop them apps doing that.
 
Last edited:

xdadevnube

Senior Member
Jun 28, 2011
1,038
178
@ OP
Thank you! This is exactly what I was looking for. I don't even have my order yet (was merely hoping for CIFS support), but this is about the only thing that makes this 8GB tablet usable, IMO.
I will provide feedback once I get the tablet in hand and have some time to experiment with CIFS.
 

martyg7

Senior Member
Oct 19, 2011
60
12
Just wondering how these mounts behave as the tablet is moved around in/out of WiFi coverage and between LANs.
Is everything well-behaved? Any gotchas I should be aware of?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 17
    ================================(updated 25/07/2012)
    recompile new cifs.ko based on code from linux kernel 3.2.1 (with asynchronous read support).

    there is 2 extra function needed in part of the kernel (which is not in the current 3.1.10 kernel).

    however that doesn't stop it from working.

    i am not sure under what conditions those 2 function will be called. when its being called, it might give error.

    apart from that, initial test shows promising result. doubled the read speed.

    please test.

    do note. YMMV

    new cifs.ko has a md5sum of
    280303e69a92cd56f180956c838edbbd
    in
    cifs-async.zip

    thanks.

    ===================================
    updated,

    i have re-compile a new cifs.ko with modified larger rsize, hopefully will have better read performance,

    give it a try.

    note: it appears that your NFS server needs to have support as well. so check out if you can set it to a bigger send buffer to have a faster read speed.

    the md5sum for the new cifs.ko is
    7a235de92c855b2933402dd1c62610fe

    in
    cifs_rsize_128k.zip

    ===========================================================
    (require root to work).

    i have created cifs module for the new 4.1.1 kernel for nexus 7
    3.1.10-g52027f9

    use this in conjunction with cifs manager

    both
    md4.ko and cifs.ko must be loaded to work.

    as for the native language support (nls_utf8.ko), its down to yourself.

    to use it,
    under cifsmanager (when creating a new share)
    set options "iocharset=utf8"

    have fun streaming video!!!
    15
    Forgive me for being naive, is this a CWM flashable zip?

    if not, what folder do i need to place these modules?

    I created a folder in system/lib/ called modules and gave it permissions rwxr-xr-x

    I extracted the 3 files into it and gave them each permissions rw-r--r--

    Then install cifs manager from google play.

    In cifs manager go to settings.

    Click mount point prefix and type /storage/sdcard0/Shares
    Tick on "load cifs module"
    Tick on "Load via insmod"
    Click path to cifs.ko and type /system/lib/modules/cifs.ko:/system/lib/modules/md4.ko:/system/lib/modules/nls_utf8.ko

    Go back to main cifs manager page and add new share.

    Under share path type "your ip of computer with shares on/sharename of folder on computer" eg. 192.168.0.6/Movies

    Click under mount point and it will fill it in for you.

    Under username put your username for PC that you log in with

    Under password put the password that you log into your computer with.

    Under options type ioch****t=utf8 (they have now banned a word that is within this word. It should be i o c h a r s e t without the spaces.)

    Click save share.

    Now when you click on the share name in cifs manager it should turn the light green to the right of it. If it doesn't you have done something wrong.

    Now go to any file manager and go to your sdcard on tablet and there should be a "Shares" folder and inside should be the share you set up.

    You can now use that as if it was a local directory. If you restart the tablet you will need to go into cifs manager again and click on the shares you want until they turn green.

    HTH
    10
    I'd love to get it working on stock+root though.

    Care to try out my attempt at getting the cifs modules compiled for (stock Android) Nexus 7? I don't have a device myself so I can't verify that these works. They are however built for Nexus 7, 4.1.2 (JZO54K), kernel 3.1.10-g009b6d1 (Wed Sep 26 12:53:01 PDT 2012).

    cifs.ko (MD5) b9833b309a50f94585f24f7f73d80f95
    md4.ko (MD5) 48ddff41470e792e400963f4a79f6590
    nls_utf8.ko (MD5) a845e0db30599a33b9847c032d4b9b6a
    7
    OK, I think I finally got it working again in 4.2.2. Google changed adb so you need to use the RSA authentication now, which makes doing this EVEN MORE difficult. But, thanks to the posters over at http://code.google.com/p/android/issues/detail?id=48126 I got it working. So, here's the step by step guide I promised to get CifsManager working in 4.2.2. Attached you will find the new kernel modules and the mount/umount scripts.

    Disclaimer: I have no idea what I'm doing and don't claim to. Follow this guide at your own risk. I take no responsibility for anything that gets messed up.


    1. You need to have a rooted Nexus 7 (Duh!) and you need to have busybox installed (as google broke something in toolbox which now segfaults when you try to mount CIFS shares).

    2. We need to create the public/private RSA keys for ADB and append the public key to /data/misc/adb/adb_keys.

    Open a terminal on your Nexus 7 and run these commands:

    Code:
    su
    adb kill-server
    export HOME=/sdcard
    setprop service.adb.tcp.port 5555
    adb start-server
    cat /sdcard/.android/adbkey.pub >> /data/misc/adb/adb_keys
    stop adbd
    start adbd

    That should fix ADB to allow you to connect locally. Note that there will now be a .android directory on your sdcard. Don't delete this or you'll break ADB and mounting CIFS won't work.


    3. Check to make sure you can connect locally to the device through adb. In the same terminal you ran the above commands in run:

    Code:
    adb connect localhost 
    adb devices

    You should see something like:

    Code:
    List of devices attached
    localhost:5555    device

    If not something's wrong.



    4. Now, we need to replace the mount/umount links with the attached scripts. Download the attached file and unzip it to your sdcard. Then run the following commands in the same terminal you used above.

    Code:
    busybox mount -o rw,remount /system
    rm /system/bin/mount /system/bin/umount
    cp /sdcard/mount /system/bin/
    cp /sdcard/umount /system/bin/
    chmod 755 /system/bin/mount
    chmod 755 /system/bin/umount
    busybox mount -o ro,remount /system


    5. In CifsManager's settings, check "Load cifs module" and "Load via insmod". Then set "Path to cifs.ko[:<modpath>]*" to "/sdcard/modules/cifs.ko:/sdcard/modules/md4.ko:/sdcard/modules/nls_utf8.ko"

    6. Create your share in CifsManager and under options put "rw,file_mode=0777,dir_mode=0777,uid=1015,gid=1015" (and any others you may need) . For the mount point, the mount script creates a dir "/cifsmnt", and 10 mountpoints under it (0-9). You can use these for your different shares. If you need more mount points, edit the dirnum variable in the mount script.


    That's it, you should be able to mount your shares and access them from any app :fingers-crossed:
    4
    CIFS 3.1.10-g22b4fcd

    Here´s the cifs for stock 3.1.10-g22b4fcd (4.2 JOP40C). Didn´t test it though, I baked mine in my custom kernel.