1. Download the #1 Android News App:   EarlyBird - News for Android
    Dismiss Notice

[Suggestion] cifs.ko that works with stock kernel or custom virtuous kernel?

Last Updated:

  1. ap42

    ap42 Member

    I've tried to find a version of cifs.ko that I can load up with insmod, but they all error out for me since they apparently weren't compiled to the kernel.

    I was able to find a version of tun.ko out there that would work after I changed it's kernel version to the above with a hex editor, and now I have working VPN on my DInc. I tried doing the same to a cifs.ko I found on this thread, but it was a no-go. It would be nice to be able to mount samba(cifs) shares when I'm at home so I can stream videos over my local network.

    Since it's being done for other kernels, I was hoping maybe it could be an option for Virtuous as well?

  2. rmk

    rmk Well-Known Member Developer

    Reasonable request. Should be doable for the custom kernel. I'll look into it.
  3. ap42

    ap42 Member

    Thanks! It'll be great if it can be done. Would be the incentive I need to ditch the stock kernel (which has been fine for me so far).
  4. rmk

    rmk Well-Known Member Developer

    I was thinking about it last night and it would actually be trivial to provide this with the stock kernel, without touching the compiled binary from HTC.

    My thought, for those interested, is to build the HTC kernel from source using the same EXTRAVERSION as the official binary, enabling builds of the modules we're interested in using. Then, pull only the .ko files from the result and make them available. This leaves the original binary untouched.

    I'll see what I can whip up tonight. :)
  5. ap42

    ap42 Member

    Well now you've got me excited. It would be nice to have a portable streaming media player at home.

    I'd be willing to test out cifs.ko/tun.ko if needed. Should just be a matter of loading it with insmod on my end and then trying to connect to my network shares with xmount or "busybox xmount".

    I already have a hacked-up tun.ko that works for VPN, so I can just swap it out, reboot, and verify it still works.

    I'm not sure what other modules folks would be interested in. Some kernels are released with a nls_utf8.ko, but I'm not sure what that's needed for. Maybe it's needed as well for cifs/samba shares?

    Thanks for looking into it. Great rom.
  6. vr6slc

    vr6slc New Member

    x2 I would love to have a cifs module for stock kernel I am using the same tun.ko as the OP, and that seems fine, but I have had no luck finding or making a cifs module. If I can use my existing rom, that's a bonus!
  7. rmk

    rmk Well-Known Member Developer

    I started working on this last night and got the modules built with matching version magic. Problem is, I have no idea what HTC used to compile the binary. Long story short, doesn't seem possible to add the modules to the stock kernel binary itself. I can, however, build a new stock kernel with the modules.

    I think the better option is to add this to the custom kernel, because I want the stock kernel to really mean stock (i.e. binary untouched). That's probably what I will pursue.
  8. ap42

    ap42 Member

    If it can only be done in the custom kernel, that's fine by me. I was planning on switching to it anyway for the disabled perflock (so I don't have to manually turn it off for SetCPU to be able to crank the clock speed down when my screen is off).

    In the thread I linked to in my first post, the guy mentioned having to edit the cifs source code to remove all refs to some slow_work setting to get the module to work with his stock kernel. Not just as simple as compiling it & dropping it in. So your idea of putting it the custom kernel seems the best way to go about it.
  9. ap42

    ap42 Member

    For those interested, I was able to compile a cifs.ko that works with the stock kernel. I installed it in a virtualbox ubuntu session with the correct vermagic setting, and had to edit some files in fs/cifs to remove all reference to slow_work (the same thing the person had to do in the linked post in my OP).

    I then copied the cifs.ko to my sdcard, ran 'adb shell' to connect, and loaded it with insmod. Then I mounted some local drives to my sdcard & was able to browse the shares with rockplayer. FYI my shares are simple shares from an XP machine, so I had to same -o username-guest to get a share to mount. Took me a while to figure that one out.

    I just watched a tv episode with no issues on it as a test. Pretty damn sweet. I had to duplicate the mounts on /sdcard since rockplayer would only look at sdcard dirs.

    I'm going to attach the *ko files I generated.
    cifs.ko should be all that is needed for cifs shares.
    nls_utf8.ko I believe is used for special characters in share or file names.
    tun.ko is used (by me) only for VPN connections.
    mount.sh just gives some examples of how you can mount with busybox or regular mount. You could use CIFS Manager as well.

    Hope someone finds it as useful as I did. Who knows, maybe I'll try loading one of my compiled kernels onto my phone. For now I just did this to get a working cifs.ko for samba/cifs shares.

    Attached Files:

    MeiserHans likes this.
  10. MeiserHans

    MeiserHans New Member


    i read your thread and i have the same request but for a different kernel Version. I tryed it with your kernel and adapted it by editing the .ko files with a hex editor and after that it was doing it well.. I could mount my xp shares and so an browse an them with cifs manager.

    But if i try to open a file..mp3 or avi or whatever the phone goes dark and i have a fulll reboot. So that means just editing the kernel label is not the full solution.

    It would be very nice of you to build me the needed files (cifs.ko and nls_utf8.ko). I just started with android and linux in general and my experience is to low to do it by myself.

    I have the stock HTC Kernel.

    Android 2.2
    htc-kernel@and18-2 #1

    i browsing with google for 2 days now to find the files adapted to my kernel version but no luck. The only thing i found is some posts of other which have the same problems. So maybee its a help to them too.

    I really would appreciate your help in that. Or let me know who i have to contact who can help me further or if you need more information...
  11. MeiserHans

    MeiserHans New Member

Share This Page