• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Making cifs.ko

Search This thread

bullyfrog

Senior Member
Oct 3, 2007
189
27
Hey guys

Need your help here.

Have been desperately searching the forums/net for a cifs.ko for the galaxy tab but i do not think one exists. :(

Have decided to see if i can build one on my own (this will likely crash & burn)
Anyway, i've installed ubuntu in a VM

and pulled the following down
-GT-P1000 source code (from http://opensource.samsung.com)
-toolchains (wget http://www.codesourcery.com/public/...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2)
unpacked the source
unpacked toolchains into /opt/toolchains
ran ./build_kernel.sh <--no errors
cd into source directory
-apt-get install ncurses-dev
make oldconfig
make menuconfig
set M for cifs (under fs -> networking)
exited
make prepare
make M=fs/cifs
and the cifs.ko was created!

upon copying into my tab and trying an insmod cifs.ko
I saw the following in my dmesg
cifs: Unknown symbol slow_work_register_use
cifs: Unknown symbol slow_work_enqueue

I'm guessing i need to make a slow-work.ko or hack the source of the cifs and remove all references of slow-work.

Anyone can advice how for either or better yet, make a cifs.ko for us :D

Thanks!
 
Last edited:

svmpatel

Senior Member
Oct 7, 2007
100
20
Chelmsford
Hiya,

If you ever get it working, please do share... I know a fair number of people who have the Galaxy Tab including myself who are just waiting for someone bright enough to get samba mounting available so they can play their media files without having to copy directly to the device.

Kinda like the Holy Grail this is... Especially as iPad users are able to stream avi's using Buzz Player HD which is a media player with a built in method of connecting to smb shares from the app. I hate being one-upped by my iPad weilding wife!! Heh.

Cheers.
 

rotohammer

Senior Member
Jan 2, 2007
1,386
1,066
New Jersey
Anyone can advice how for either or better yet, make a cifs.ko for us :D
Thanks!

There are several reasons why you may have missing symbols. One is that the original kernel was compiled with different driver options, so certain symbols are missing when compared to the new kernel/module you compiled. The easy fix is to install the new kernel too.

It could also be that the kernel versions are different, and the source you have is older or newer than the original.

If I have time later I plan on giving it a go myself, compile and install a complete kernel.
 

daniel.weck

Senior Member
Nov 2, 2010
574
95
daniel.weck.free.fr
From another discussion thread on this forum:

-------
You'll need to change kernel/slow-work.c to be compiled as a module which is not very hard:

move kernel/slow-work.c in fs/slow-work/slow-work.c
remove "config SLOW_WORK" from init/Kconfig
create fs/slow-work/Kconfig with config SLOW_WORK as tristate and add it to fs/Kconfig (source fs/slow_work/Kconfig)
create fs/slow-work/Makefile with obj-$(CONFIG_SLOW_WORK) += slow-work.o and add it to fs/Makefile: obj-$(CONFIG_SLOW_WORK) += slow-work/
-------

Then, some useful commands:

adb shell
su
insmod slow-work.ko
insmod cifs.ko
lsmod | grep cifs
dmesg

mount -o username=guest -t cifs //IP/SHARE /mnt/cifs
(or CifsManager)

...also add "iocharset=utf8" in CifsManager's options field (non-latin characters support).

I too need to get started with compiling the Tab's sources...when I have time ! :D
 

overridex

Member
Jan 22, 2009
43
7
Ok, I compiled cifs.ko and slow_work.ko modules using the SCH-I800 kernel source (which is the Verizon Galaxy Tab model) so I'm not sure they'll work on other tabs, but I figured I'd post them here.

I haven't done much testing yet, but I ran:

busybox insmod slow_work.ko
busybox insmod cifs.ko
mkdir /mnt/cifs
busybox mount -o username=guest //myserver/share /mnt/cifs

It mounted successfully, and I was able to watch a video directly off the mount. It was a little choppy though, I'm not sure if the default video player has any buffering options or if there's one in the market that does.

As far as how I got it to compile, it was very much a hack based on info here. The rough method was:

Built cifs.ko from the steps listed in the first post, with the exception of using the SCH-I800 source instead.

After that:

mkdir fs/slow-work
cp kernel/slow-work.* fs/slow-work/.
added fs/slow-work/Kconfig with the config section copied from init/Kconfig, but with bool changed to 'tristate' and default changed to m.
edited fs/Kconfig and added 'source "fs/slow-work/Kconfig"'
Added fs/slow-work/Makefile containing: "obj-m += slow-work.o"
Added the line "obj-m += slow-work/" to the end of fs/Makefile

I also had to edit fs/slow-work/slow-work.c and removed the round_jiffies calls, they were coming up as unresolved symbols and it's a function in timer.c, wasn't sure if there was a way to pull that into a module.

make M=fs/slow-work

I'll post more as I play around with it, just wanted to get the modules up for people to play with. I should also probably look into using my busybox utilities as the default so I don't have to keep calling busybox to use the correct ones.

-Dan
 

Attachments

  • cifs_gtab.zip
    1.2 MB · Views: 4,261
Last edited:
  • Like
Reactions: droidle

jknisley

Member
Dec 2, 2007
39
1
San Francisco, CA
CIFS on Sprint device

I'm using the updated Sprint GTab and your precompiled CIFS modules worked very well. It's just now CIFS Manager seems to keep telling me that the mount string isn't valid. I mounted with the mount command from the terminal (wow, this is tedious without a BT keyboard. Need a terminal with editable strings.) and it worked just great.

JK
 

daniel.weck

Senior Member
Nov 2, 2010
574
95
daniel.weck.free.fr
Well done ! This works on my JK1-flashed Galaxy Tab. :)

Note: I use WifiKeyboard as my input method on the tablet, to ease typing in the Terminal Emulator (or ConnectBot). It works marvelously well ! :D

The "insmod" commands worked perfectly (thanks again for compiling...personally I was stuck at the "libc" ELF headers in my toolchain Mac OS X setup...I will soon install a Linux virtual machine so I can use the default toolchain, which contains all the required "libc" stuff...I regularly compile RockBox on my Mac so I wonder what's wrong with this particular toolchain).

I switched on Samba/SMB/CIFS sharing on my Mac OS X laptop, via the "Sharing" panel in System Preferences.

Once in "su" shell mode, I pre-created the mount point: "mkdir /mnt/cifs". I then experimented various commands, including:

- EDIT - DroidWall configured with a whitelist *prevents* the "mount" command from connecting to the Samba share, despite allowing Terminal Emulator and ConnectBot to connect via wifi...as a result I have to disable DroidWall entirely, which sub-optimal :( Allowing all "root" applications to access wifi in DroidWall doesn't solve the problem: it makes a difference with commands like "ping" but the SMB mount fails to connect over the network...for some reason.

busybox mount -r -t cifs -o "username=MY_USERNAME,password=MY_PASS" //MY_IP/MY_SHARED_FOLDER /mnt/cifs

busybox mount | grep cifs
ls /mnt/cifs
umount /mnt/cifs

busybox mount -r -t cifs -o "username=guest" //MY_IP/MY_SHARED_FOLDER /mnt/cifs

Note that I chose to secure the mounted directory in read-only mode, but of course we could use "-w" instead, providing the file server accepts authenticated or anonymous connections with write credentials.

I still need to test transfer speeds...as this is often the problem with high-quality video. At any rate, I recommend using VLC Player on the server (e.g. laptop containing video/audio assets), and VLC Stream and Connect on the Android device: the live transcoding works really well ! :cool:
 
Last edited:

jknisley

Member
Dec 2, 2007
39
1
San Francisco, CA
CIFSManager

I'm a bit of a noob, actually. I put a double-slash in cifsmanager in front of the name, like you were doing in mount. It's just machine/share and not //machine/share. Makes all the difference, really.

Now I just wish there were a few more video codecs to be had.

JK
 

svmpatel

Senior Member
Oct 7, 2007
100
20
Chelmsford
Cool, now all we need is a step by step guide for doing this for noob users like me who have no idea what Busybox is or where to save the cifs and slow work files etc... Hmm... Anyone fell nice and would like to help a guy out?

Cheers
 

alias_neo

Senior Member
Jun 9, 2006
2,080
204
London
Ok, I compiled cifs.ko and slow_work.ko modules using the SCH-I800 kernel source (which is the Verizon Galaxy Tab model) so I'm not sure they'll work on other tabs, but I figured I'd post them here.

I haven't done much testing yet, but I ran:

busybox insmod slow_work.ko
busybox insmod cifs.ko
mkdir /mnt/cifs
busybox mount -o username=guest //myserver/share /mnt/cifs

It mounted successfully, and I was able to watch a video directly off the mount. It was a little choppy though, I'm not sure if the default video player has any buffering options or if there's one in the market that does.

As far as how I got it to compile, it was very much a hack based on info here. The rough method was:

Built cifs.ko from the steps listed in the first post, with the exception of using the SCH-I800 source instead.

After that:

mkdir fs/slow-work
cp kernel/slow-work.* fs/slow-work/.
added fs/slow-work/Kconfig with the config section copied from init/Kconfig, but with bool changed to 'tristate' and default changed to m.
edited fs/Kconfig and added 'source "fs/slow-work/Kconfig"'
Added fs/slow-work/Makefile containing: "obj-m += slow-work.o"
Added the line "obj-m += slow-work/" to the end of fs/Makefile

I also had to edit fs/slow-work/slow-work.c and removed the round_jiffies calls, they were coming up as unresolved symbols and it's a function in timer.c, wasn't sure if there was a way to pull that into a module.

make M=fs/slow-work

I'll post more as I play around with it, just wanted to get the modules up for people to play with. I should also probably look into using my busybox utilities as the default so I don't have to keep calling busybox to use the correct ones.

-Dan

How did you manage to remount the filesystem r/w? I can't mkdir /mnt/cifs because fs is read only.
 

bullyfrog

Senior Member
Oct 3, 2007
189
27
Ok, I compiled cifs.ko and slow_work.ko modules using the SCH-I800 kernel source (which is the Verizon Galaxy Tab model) so I'm not sure they'll work on other tabs, but I figured I'd post them here.

I haven't done much testing yet, but I ran:

busybox insmod slow_work.ko
busybox insmod cifs.ko
mkdir /mnt/cifs
busybox mount -o username=guest //myserver/share /mnt/cifs

It mounted successfully, and I was able to watch a video directly off the mount. It was a little choppy though, I'm not sure if the default video player has any buffering options or if there's one in the market that does.

As far as how I got it to compile, it was very much a hack based on info here. The rough method was:

Built cifs.ko from the steps listed in the first post, with the exception of using the SCH-I800 source instead.

After that:

mkdir fs/slow-work
cp kernel/slow-work.* fs/slow-work/.
added fs/slow-work/Kconfig with the config section copied from init/Kconfig, but with bool changed to 'tristate' and default changed to m.
edited fs/Kconfig and added 'source "fs/slow-work/Kconfig"'
Added fs/slow-work/Makefile containing: "obj-m += slow-work.o"
Added the line "obj-m += slow-work/" to the end of fs/Makefile

I also had to edit fs/slow-work/slow-work.c and removed the round_jiffies calls, they were coming up as unresolved symbols and it's a function in timer.c, wasn't sure if there was a way to pull that into a module.

make M=fs/slow-work

I'll post more as I play around with it, just wanted to get the modules up for people to play with. I should also probably look into using my busybox utilities as the default so I don't have to keep calling busybox to use the correct ones.

-Dan

Mate, you rock! I too ran into problems with the round jiffies and put this side project on hold. Your modules work and thats what matters. Thank you

Sent from my GT-P1000
 

stefan3110

Member
Sep 20, 2009
8
0
I’m a really beginner user and have a question to the install of cifs.ko .
I like to mount on my Samsung Galaxy Tab an SMB network share. The Tab is rooted.

1)Copy the cifs.ko on my Tab
2)Install busybox from the market on my Tab
3)Run Busybox
4)Write in Busybox
“busybox insmod cifs.ko
mkdir /mnt/cifs”
5)To mount I like to use the Cifs Manager

These 5 steps are correct or I have some errors in it? Where on the Tab I have to copy the file “cifs.ko”? Can I write in Busybox with the virtual keyboard?

Thanks for your help.
Stefan
 

bullyfrog

Senior Member
Oct 3, 2007
189
27
For those of you struggling with commands, an easy way is to just copy the two files to your sdcard. You can put them to /sdcard/Android if you like. Issue the following commands in your terminal app
$su -
#cd /sdcard/Android
#insmod slow-work.ko
You should see no errors

Next pull down CifsManager from the market.
Using CifsManager, specify where the cifs.ko is located. The gui is pretty intuitive. If all goes well, you should be able to watch your shared videos off your tab :)

Sent from my GT-P1000
 
  • Like
Reactions: mudstuff

myshyak

Senior Member
May 22, 2009
115
5
Kiev
For those of you struggling with commands, an easy way is to just copy the two files to your sdcard. You can put them to /sdcard/Android if you like. Issue the following commands in your terminal app
$su -
#cd /sdcard/Android
#insmod slow-work.ko
You should see no errors

Next pull down CifsManager from the market.
Using CifsManager, specify where the cifs.ko is located. The gui is pretty intuitive. If all goes well, you should be able to watch your shared videos off your tab :)
Sent from my GT-P1000
Thanks a lot.That worked perfectly for me.But, for us, noobs would add 2 points that I had problems with
1."the two files" mentioned above could be found here :
http://forum.xda-developers.com/showpost.php?p=9275507&postcount=5
2. For not latin characters in filenames needed to to the following (from http://forum.xda-developers.com/showpost.php?p=9271775&postcount=4): ...also add "iocharset=utf8" in CifsManager's mount options field (non-latin characters support).
After that, everething worked perfect. Do I need to remount it each time after reboot?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Overridex (and those who have successfully compiled both modules):

    Bump :)

    (read below)

    Here's a step-by-step on getting the modules compiled on Ubuntu 10.10. (warning: it's a hack.) :)

    1) Grab the toolchain at http://www.codesourcery.com/public/...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    2) Extract the toolchain
    Code:
    cd /opt/toolchains
    sudo tar xvjf /path/to/arm-2009q3-67-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
    3) Grab the kernel source for your Tab. I used the SCH-I800 (Verizon model) code. http://opensource.samsung.com/
    3) Extract the kernel source
    Code:
    unzip /path/to/SCH-I800_OpenSource.zip
    tar xvf SCH-I800_Kernel.tar
    4) Verify the kernel builds correctly on your system. It will throw some warnings, but just make sure it doesn't error out completely.
    Code:
    ./build_kernel.sh
    5) Copy the slow-work source files to the cifs directory
    Code:
    cd Kernel
    cp kernel/slow-work.* fs/cifs/.
    6) Remove the calls to round_jiffies in fs/cifs/slow-work.c. Fire up an editor and change the following two lines:
    Code:
    round_jiffies(jiffies + SLOW_WORK_CULL_TIMEOUT));

    to

    Code:
    jiffies + SLOW_WORK_CULL_TIMEOUT);

    and

    Code:
    round_jiffies(jiffies + SLOW_WORK_OOM_TIMEOUT));

    to

    Code:
    jiffies + SLOW_WORK_OOM_TIMEOUT);

    7) edit fs/cifs/Makefile and add slow-work.o to the obj-$(CONFIG_CIFS) += cifs.o line:
    Code:
    obj-$(CONFIG_CIFS) += cifs.o slow-work.o
    8) run 'make oldconfig'
    9) run 'make menuconfig' and set CIFS support to M under File Systems -> Network File Systems
    10) run 'make prepare'
    11) run 'make M=fs/cifs'

    The cifs.ko and slow-work.ko modules will be in the fs/cifs directory.

    Take care,

    -Dan
    1
    Ok, I compiled cifs.ko and slow_work.ko modules using the SCH-I800 kernel source (which is the Verizon Galaxy Tab model) so I'm not sure they'll work on other tabs, but I figured I'd post them here.

    I haven't done much testing yet, but I ran:

    busybox insmod slow_work.ko
    busybox insmod cifs.ko
    mkdir /mnt/cifs
    busybox mount -o username=guest //myserver/share /mnt/cifs

    It mounted successfully, and I was able to watch a video directly off the mount. It was a little choppy though, I'm not sure if the default video player has any buffering options or if there's one in the market that does.

    As far as how I got it to compile, it was very much a hack based on info here. The rough method was:

    Built cifs.ko from the steps listed in the first post, with the exception of using the SCH-I800 source instead.

    After that:

    mkdir fs/slow-work
    cp kernel/slow-work.* fs/slow-work/.
    added fs/slow-work/Kconfig with the config section copied from init/Kconfig, but with bool changed to 'tristate' and default changed to m.
    edited fs/Kconfig and added 'source "fs/slow-work/Kconfig"'
    Added fs/slow-work/Makefile containing: "obj-m += slow-work.o"
    Added the line "obj-m += slow-work/" to the end of fs/Makefile

    I also had to edit fs/slow-work/slow-work.c and removed the round_jiffies calls, they were coming up as unresolved symbols and it's a function in timer.c, wasn't sure if there was a way to pull that into a module.

    make M=fs/slow-work

    I'll post more as I play around with it, just wanted to get the modules up for people to play with. I should also probably look into using my busybox utilities as the default so I don't have to keep calling busybox to use the correct ones.

    -Dan
    1
    For those of you struggling with commands, an easy way is to just copy the two files to your sdcard. You can put them to /sdcard/Android if you like. Issue the following commands in your terminal app
    $su -
    #cd /sdcard/Android
    #insmod slow-work.ko
    You should see no errors

    Next pull down CifsManager from the market.
    Using CifsManager, specify where the cifs.ko is located. The gui is pretty intuitive. If all goes well, you should be able to watch your shared videos off your tab :)

    Sent from my GT-P1000
    1
    worked for me the first time.after reboot I get 'no such device'

    Sent from my GT-P1000 using XDA App

    You can load the 2 needed modules by just using CifsManager.
    In the options, select Load using 'insmod' and give the path to slow-work: e.g. /system/lib/modules/slow-work.ko
    Then try to connect a share: it will fail but the slow-work module will be loaded in the system.
    Now change the path in the options to your cifs.ko: e.g. /system/lib/modules/cifs.ko
    You can now mount again using Cifsmanager.

    A better solution is of course to change one of the '*.rc' system files to load those modules at start-up.
    1
    Here's an update to how I have mine setup. Might take longer to setup but really simplifies this process of mounting/unmounting a share.

    gscript lite! You can get it from the market. In short, I created a script using it to load the modules and mount the share. I made another script to unmount the shares :)

    Here's the long on how I did it.
    1)pulled down busybox and gscript lite from the market

    2)created a new directory on the sdcard and called it cifs. inside it I created another directory giving it the same name as my network share (I called it terradisk)

    hence it looks something like this
    /sdcard/cifs/terradisk

    3)As I wanted to keep things neat
    I moved the slow-work.ko and cifs.ko to /sdcard/cifs

    4)Using gscript lite, I made a new script called "mount terradisk" with the "Needs SU" option ticked.

    following lines were added

    busybox insmod /sdcard/cifs/slow-work.ko &&
    busybox insmod /sdcard/cifs/cifs.ko
    busybox mount -r -t cifs -o "username=winuser,password=winpassword",iocharset=utf8 //IP_Address/terradisk /sdcard/cifs/terradisk

    5)Using gscript lite, I made another script called it unmount terradisk with the "Needs SU" option ticked. The following line added
    busybox unmount /sdcard/cifs/terradisk

    6) uninstalled cifsmanager as I no longer needed it :)