[modules] cifs.ko, md4.ko, nls_utf8.ko, stock [4.2 / 4.2.2] 3.4.5-g4e6298b / gaf9c307

Search This thread

rufus-

Member
Apr 20, 2012
45
1
Added option.ko and usb_wwan.ko, also usbserial.ko that seems to be needed.

insmod usbseria.ko then usb_wwan.ko and option.ko last

Thank you. After insmod, if i reboot tablet is necesary repeat the proceso? Or only once. Changes any system file and i Will have problems With OTA?
 

H3g3m0n

Senior Member
Sep 15, 2009
60
16
Thank you. After insmod, if i reboot tablet is necesary repeat the proceso? Or only once. Changes any system file and i Will have problems With OTA?

You must insmod each boot. You can use script manager to do it for you.

As for OTA, I'm not exactly sure what breaks it but chances are rooting it will anyway (you need root to load the modules). But you can always keep the modules on the internal memory/sdcard rather than installing them.
 

lopez1_de

Senior Member
Jun 14, 2007
205
4
Shouldn't this modules work for use with cifsmanager or Mount Manager? I'm always getting the error "mount: Invalid argument".
 

darkuni

Senior Member
Sep 12, 2010
378
75
Thanks for the work on this. It does have a little caveat (one that makes it a manual process every time). Only apps running when you mount have access to the CIFS mount. Anything you run after? Doesn't see it. Well, sees it but nothing is there.

Totally reproducable. Am I missing something? Thanks.

Sent from my Nexus 10 using Tapatalk 2
 

darkuni

Senior Member
Sep 12, 2010
378
75
Hey, can we get a simple umount script? I took a couple of stabs at it but I must be doing something wrong. Thanks!

Sent from my Nexus 10 using Tapatalk 2
 

hoboonthegogo

Member
Dec 2, 2012
7
0
Quick question all - (sorry an Android Noob here who's spent way too many hours reading through XDA since the Nexus 10 Purchase! :)

Mounting CIFs shares in this manner are you then seeing transfer speeds that the nexus 10 is capable of over Wifi? I've been trying to get the 80-90mbps through CIFs shares that I get from Iperf tests but all File Explorers only give me 20mbps which obviously isn't great for HD Video.

Just wanted to throw it out there to see what kind of bandwidth people are getting using this solution. Cheers!
 

lopez1_de

Senior Member
Jun 14, 2007
205
4
I get an error with the shell script you posted. Line 54; syntax error: 'if' unmatched'
 

Attachments

  • mount_error.jpg
    mount_error.jpg
    44.9 KB · Views: 272

lopez1_de

Senior Member
Jun 14, 2007
205
4
Quick question all - (sorry an Android Noob here who's spent way too many hours reading through XDA since the Nexus 10 Purchase! :)

Mounting CIFs shares in this manner are you then seeing transfer speeds that the nexus 10 is capable of over Wifi? I've been trying to get the 80-90mbps through CIFs shares that I get from Iperf tests but all File Explorers only give me 20mbps which obviously isn't great for HD Video.

Just wanted to throw it out there to see what kind of bandwidth people are getting using this solution. Cheers!

The kernel module cifs is much faster!
 
  • Like
Reactions: hoboonthegogo

amans

Member
Aug 10, 2009
33
1
Hi all !

I've a problem...
I mounted it correctly (i think...), i mean i can see my files/folders under my mount point in connecbot.
But i don't see anything with solid explorer or es file explorer...
I tried to mount it in different places...same...
I don't understand why !
So it's unusable by third party apps :(

Did i miss something ??

Thanks for your help !
 

amans

Member
Aug 10, 2009
33
1
Hi all !

I've a problem...
I mounted it correctly (i think...), i mean i can see my files/folders under my mount point in connecbot.
But i don't see anything with solid explorer or es file explorer...
I tried to mount it in different places...same...
I don't understand why !
So it's unusable by third party apps :(

Did i miss something ??

Thanks for your help !

guys ?
any idea ?
thx
 

amans

Member
Aug 10, 2009
33
1
i used the script method...

other thing....
under cm 10, i get this error when i load modules :

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

alfer

Member
Jan 16, 2007
29
1
I get an error with the shell script you posted. Line 54; syntax error: 'if' unmatched'

I;m getting the same exact error. I copied the script to notepad, modified the parameters, saved as mountcifs.sh and tried to run it from terminal emulator and got the same errors. When I vi my script it has all these ^M carriage return characters that I think Windows/Notepad adds to the file. Whats the proper way to copy the script and get in on the device to avoid these errors?
 

H3g3m0n

Senior Member
Sep 15, 2009
60
16
i used the script method...

other thing....
under cm 10, i get this error when i load modules :

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

CyanogenMod 10? These modules are specific for the kernel version that ships with the stock Nexus 10 JellyBean 4.2.x. You will need to find CIFS modules for your CM10 kernel. It would be nice if the CyanogenMod guys compiled cifs modules by default but for some reason they don't.

I;m getting the same exact error. I copied the script to notepad, modified the parameters, saved as mountcifs.sh and tried to run it from terminal emulator and got the same errors. When I vi my script it has all these ^M carriage return characters that I think Windows/Notepad adds to the file. Whats the proper way to copy the script and get in on the device to avoid these errors?

To remove ^M's, If you have installed busybox on the device there is the dos2unix util and sed commands. See here. Otherwise you could look at using a different editor. There's a Windows build of gedit or gvim.
 

sam3000

Senior Member
Jul 11, 2009
365
421
Seattle
CyanogenMod 10? These modules are specific for the kernel version that ships with the stock Nexus 10 JellyBean 4.2.x. You will need to find CIFS modules for your CM10 kernel. It would be nice if the CyanogenMod guys compiled cifs modules by default but for some reason they don't.

[cut]

The cifs module should be present in the latest cm rom. It was merged here:
http://review.cyanogenmod.org/#/c/27568/
 

sam3000

Senior Member
Jul 11, 2009
365
421
Seattle
Experimental cifs fixup zip

Update: craigacgomez AOSP does not appear to work with this. I suspect libdvm.so incompatibility. If this is true, it's likely the zip only works with cm. Please still do try if you are running cm.

Okay, here's an experiment...

Attached is a flashable zip that does the following:
1) replaces /system/xbin/busybox with a version that has the unc fixup patch (for roms that don't already include it).
2) removes existing symlink /system/bin/mount and recreates it pointing to /system/xbin/mount so that the default "mount" uses the fixed version.
3) installs a patched /system/lib/libdvm.so dalvik library that has had removed the unshare() call that is partitioning the mount namespace and making cifs mounts invisible to other processes (unless you do hack around adb shell etc).

Use at your own risk and I'd certainly recommend ensuring you have your current rom available for reflashing if anything goes wrong... However, for me, with stock cm I can now simply flash this and then cifsmanager works as it always did previously without any other hackery whatsoever.

I can't see why this wouldn't work for any rom (certainly stock and cm should be good). The only thing you need to ensure is that you have the cifs module for your rom already installed.

Final note: this is a dirty hack because it entirely destroys the per user mount namespace separation feature. That said, I only have one user account on my tablet so my personal care level is zero.

Let me know if it works for you.
 

Attachments

  • manta_cifs_fixup-signed.zip
    867.1 KB · Views: 176
Last edited:

ThurstonX

Senior Member
Oct 29, 2012
255
120
Okay, here's an experiment...

Attached is a flashable zip that does the following:
1) replaces /system/xbin/busybox with a version that has the unc fixup patch (for roms that don't already include it).
2) removes existing symlink /system/bin/mount and recreates it pointing to /system/xbin/mount so that the default "mount" uses the fixed version.
3) installs a patched /system/lib/libdvm.so dalvik library that has had removed the unshare() call that is partitioning the mount namespace and making cifs mounts invisible to other processes (unless you do hack around adb shell etc).

Use at your own risk and I'd certainly recommend ensuring you have your current rom available for reflashing if anything goes wrong... However, for me, with stock cm I can now simply flash this and then cifsmanager works as it always did previously without any other hackery whatsoever.

I can't see why this wouldn't work for any rom (certainly stock and cm should be good). The only thing you need to ensure is that you have the cifs module for your rom already installed.

Final note: this is a dirty hack because it entirely destroys the per user mount namespace separation feature. That said, I only have one user account on my tablet so my personal care level is zero.

Let me know if it works for you.
Interesting. I'm following this thread as a Nexus 7 user. I'm wondering if it's worth trying this on a Nexus 7 running the stock ROM. The only thing I can think of that might cause it to not work is the patched /system/lib/libdvm.so. Any thoughts on that? If it's not a show stopper, then I'm willing to try and report my results. I'll never use the multi-user aspect of 4.2.x, so I don't care about losing that either. And it's easy enough to go back to 4.1.2 and bide my time, if this fails. Just don't want to waste my time if the patched library won't work on a Nexus 7.

Let me know. And thanks.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    I have managed to get CIFS working on stock Nexus 10.

    It's quite a bit more problematic on the Nexus 10 than normal.

    There are 2 main issues to deal with. Newer versions of the Linux kernel require a UNC variable to be passed to them and the current version of busybox doesn't do this. There is a patch out. I have extracted the patched busybox binary from craigacomez's AOSP Nexus 10 rom.
    (Check it out here: http://xdaforums.com/showthread.php?t=1998585 ). Otherwise it should work on the stock mount command if you specify the unc= mount option with the share.

    The other issue is the multiuser stuff. If you execute the mount command from inside Terminal Emulator (or a script program) it looks like it mounts ok and you can 'ls' in the directory but it doesn't work for Android apps, they just see an empty directory but if you do it via a 'adb shell' it works fine in Android apps. My theory is ADB is outside of the multiuser stuff. adb actually ships on the device.

    1) Unlock bootloader (fastboot oem unlock)
    2) Flash recovery adb flash recovery whatever.img
    3) Root device (flash CWM-SuperSU-0.98.zip)
    4) Install BusyBox (from the market)
    5) Copy md4.ko and cifs.ko to device. The files can go anywhere you like. In this example I will just use the root of the sdcard. Some people like them in /system/modules or /system/lib/modules
    6) busybox mount -o rw,remount /
    7) adb shell
    8) Override /system/bin/busybox with the patched version (maybe move it first so it's backed up).
    9) insmod /sdcard/md4.ko
    10) insmod /sdcard/cifs.ko
    11) busybox mount -t cifs -o username=MYUSER,password=MYPASS,unc=\\\\192.168.1.1\\storage //192.168.1.1/storage /data/media/0/cifs/Storage

    You will need to manually preform the last 3 commands each time you reboot the device from a adb shell.

    NOTE: You can probably get rid of the -o flags completely. In theory the patched version of busybox makes the UNC bit redundant. Possibly you can use the stock busybox with the UNC flag and avoid using the patched one totally. I have just included it to be sure.

    Make sure you type 'busybox mount' not 'mount', by default they are different binaries. Otherwise you can remove the /system/bin/mount command and make a new one linking /system/bin/mount to /system/bin/busybox.

    Possibly there is some way to get the mount working in the multiuser environment without requiring busybox. If you figure it out please tell ☺

    Some threads on the issue:
    http://xdaforums.com/showthread.php?p=34397868#post34397868
    http://xdaforums.com/showthread.php?t=733490&page=6
    http://www.mail-archive.com/busybox@busybox.net/msg17650.html

    The modules are for 3.4.5-g4e6298b.

    EDIT: I added nls_utf8.ko by request

    EDIT2: Since adb comes on the device, it is possible to use it to connect to local host:
    1) Install cifs modules to /system/lib/modules
    2) Install Script Manager from the play store
    3) Copy script to device
    4) Start SManager
    5) Find your script and open it.
    6) Tick the su box
    7) Hit save
    8) Goto home sccreen
    9) Add a 'SMShortcuts' widget to your home screen
    10) "Add one script shortcut"
    11) Choose your script
    12) Optionally use this pretty icon
    13) Give it a nice name like "Mount Shares"

    Here is a shell script...
    Code:
    #!/system/bin/sh
    
    # Your settings here
    USERNAME="USERNAME"
    PASSWORD="PASSWORD"
    IPADDRESS="192.168.1.1"
    SHARE="storage"
    MOUNT_POINT="/data/media/0/cifs/Storage"
    
    # If you need to change the mount command edit this
    MOUNT_CMD="\
    mount -t cifs                   \
                                    \
    -o                              \
    user=$USERNAME,\
    password=$PASSWORD,\
    unc=\\\\\\\\\\\\\\\\$IPADDRESS\\\\\\\\$SHARE      \
                                    \
    //$IPADDRESS/$SHARE             \
    $MOUNT_POINT"
    
    COMMANDS="\
    insmod /system/lib/modules/md4.ko;          \
    insmod /system/lib/modules/nls_utf8.ko;     \
    insmod /system/lib/modules/cifs.ko;         \
    $MOUNT_CMD
    "
    
    # Starting ADB...
    PORT=`getprop service.adb.tcp.port`
    setprop service.adb.tcp.port 5555
    adb kill-server
    adb start-server
    stop adbd
    start adbd
    adb connect localhost
    
    # Make sure we only use the first device (sometimes there is more than one)
    SERIAL=`adb devices | head -n2 | tail -n1 | cut -f1`
    if [ "$SERIAL" = "" ] ; then
        echo "ERROR: Could not find ADB device.";
    fi
    
    echo Mounting share via adb...
    adb -s $SERIAL shell su root -c "$COMMANDS"
    
    # If you started adb, then stop it here for security:
    adb disconnect localhost
    stop adbd
    setprop service.adb.tcp.port $PORT
    start adbd
    
    RESULT=`mount | grep $MOUNT_POINT`
    
    if [ "$RESULT" = "" ] ; then
        echo "Mounting failed..."
    else
        echo "Mounting sucess!"
    fi
    
    echo Done... You may close this script window.

    EDIT3: Added usbserial.ko, option.ko and usb_wwan.ko

    EDIT4: Some users have reported that the need to modify the script to get it working with their version of SU.

    EDIT5: I have uploaded modules for 4.2.2, kernel 3.4.5-gaf9c307 but I haven't actually tested them myself (still on 4.2.1). Apparently the adb loophole has also been patched but it is possible to reenable it by putting a RSA key onto the device. Check out this set of instructions here.

    EDIT6: I have updated to 4.2.2 on my Nexus 10 and can confirm the new modules work.

    You must setup the adbkey or you will get a "device: offline" message. By default adb when adb first runs it tries to create the keys in the $HOME dir which is /data/.android, but the data directory isn't accessible by the 'shell' user.

    I got it working simply by setting the HOME variable to /sdcard and restarting the adb server in the script then Android popped up a query (I have update the script above).

    IMPORTANT: The Android Media scanner recursively scans folders for media to add the the database so it shows up in programs like Google Music. On large shares this can be a long process and use heaps of battery life. To prevent this add a blank file with the name ".nomedia" to the root of your mount points (or each individual share if you aren't used 1 folder for all your mounts). This will stop music showing up in programs though.

    If you find that the device stops responding (the launcher might work but apps fail to load) or you get reboots (often after the previous bug) this is probably due to a bad wifi connection.
    2
    Got the adb script working

    For those having trouble with the adb script in POST #1 you may try this:

    Remove the word "root" from line: adb -s $SERIAL shell su root -c "$COMMANDS"
    I also changed the "mount" command by "busybox mount" (I didn't make the hardlink as recommended in some posts)

    That was driving me nuts. Everytime I executed the script I saw "SuperSU - Copyright [...] Chainfire" message until I removed the "root". Now it all works flawlessly. I guess this may be happening because of the superuser binary version I have installed.

    Merry Xmas.
    1
    Sorry for the noob ? ...

    What are the KO's do?
    What is the practical use of then.

    Sorry I did a little research on then but I could not find an answer in layman terms

    Thank you for allowing me to learn.;)

    Sent from my toroplus using xda premium

    http://en.wikipedia.org/wiki/Loadable_kernel_module
    1
    Quick question all - (sorry an Android Noob here who's spent way too many hours reading through XDA since the Nexus 10 Purchase! :)

    Mounting CIFs shares in this manner are you then seeing transfer speeds that the nexus 10 is capable of over Wifi? I've been trying to get the 80-90mbps through CIFs shares that I get from Iperf tests but all File Explorers only give me 20mbps which obviously isn't great for HD Video.

    Just wanted to throw it out there to see what kind of bandwidth people are getting using this solution. Cheers!

    The kernel module cifs is much faster!
    1
    Remove the word "root" from line: adb -s $SERIAL shell su root -c "$COMMANDS"
    I also changed the "mount" command by "busybox mount" (I didn't make the hardlink as recommended in some posts)

    That was driving me nuts. Everytime I executed the script I saw "SuperSU - Copyright [...] Chainfire" message until I removed the "root". Now it all works flawlessly. I guess this may be happening because of the superuser binary version I have installed.

    Merry Xmas.

    I spent HOURS messing with this.. Finally!! his worked for me.Thanks.
    I still have other issues.. but this got me closer to something that resembles working.