FORUMS

[HOWTO] (+2.3.4) build cifs.ko (for stock kernel)

575 posts
Thanks Meter: 354
 
By tegrak, Senior Member on 6th June 2011, 09:57 PM
Post Reply Email Thread
Complied cifs.ko and slow-work.ko
2.3.4 I9100-XXKG2-CIFS.zip
2.3.3 cifs-for-GT-I9100.zip

1. get the SHW-M250L kernel source from OSRC.
https://opensource.samsung.com/

2. copy files to fs/cifs folder.
kernel/slow-work.c
kernel/slow-work.h

3. add below codes to top of fs/cifs/slow-work.c (in kernel/timer.c)
Code:
static unsigned long round_jiffies_common(unsigned long j, int cpu,
		bool force_up)
{
	int rem;
	unsigned long original = j;

	/*
	 * We don't want all cpus firing their timers at once hitting the
	 * same lock or cachelines, so we skew each extra cpu with an extra
	 * 3 jiffies. This 3 jiffies came originally from the mm/ code which
	 * already did this.
	 * The skew is done by adding 3*cpunr, then round, then subtract this
	 * extra offset again.
	 */
	j += cpu * 3;

	rem = j % HZ;

	/*
	 * If the target jiffie is just after a whole second (which can happen
	 * due to delays of the timer irq, long irq off times etc etc) then
	 * we should round down to the whole second, not up. Use 1/4th second
	 * as cutoff for this rounding as an extreme upper bound for this.
	 * But never round down if @force_up is set.
	 */
	if (rem < HZ/4 && !force_up) /* round down */
		j = j - rem;
	else /* round up */
		j = j - rem + HZ;

	/* now that we have rounded, subtract the extra skew again */
	j -= cpu * 3;

	if (j <= jiffies) /* rounding ate our timeout entirely; */
		return original;
	return j;
}

unsigned long round_jiffies(unsigned long j)
{
	return round_jiffies_common(j, raw_smp_processor_id(), false);
}
4. edit fs/cifs/Makefile
obj-$(CONFIG_CIFS) += cifs.o slow-work.o

5. make menuconfig
File systems >[*] Network File Systems > <M> CIFS Support

6. make modules

7. put files to your phone.
fs/cifs/slow-work.ko
fs/cifs/cifs.ko

8. insert modules.
insmod slow-work.ko
insmod cifs.ko

Done! Enjoy!
Attached Files
File Type: zip cifs-for-GT-I9100.zip - [Click for QR Code] (105.1 KB, 2068 views)
File Type: zip I9100-XXKG2-CIFS.zip - [Click for QR Code] (108.5 KB, 2621 views)
The Following 10 Users Say Thank You to tegrak For This Useful Post: [ View ] Gift tegrak Ad-Free
7th June 2011, 01:37 AM |#2  
m_pascal's Avatar
Member
Flag Parma
Thanks Meter: 5
 
More
I'm on stock KE7+CF Root and I have some problems.
I've downloaded cifs-for-GT-I9100.zip, uncompressed it and put the two files in /fs/cifs

ROOT---cf---cifs---cifs.ko
..................... |__slow-work.ko

I've started ADB SHELL and I typed
Code:
$su
#cd fs
#cd cifs
#insmod slow-work.ko (no reply, so I think it goes well)
#insmod cifs.ko (I get two messages of error "insmod: can't insert 'cifs.ko': unknown symbol in module or invalid parameter" or "insmod: can't insert 'cifs.ko': invalid parameter", it depends)
I'm doing something wrong? I'm sorry but I need this function but I'm not a good hacker
7th June 2011, 03:17 AM |#3  
tegrak's Avatar
OP Senior Member
Flag Seoul
Thanks Meter: 354
 
Donate to Me
More
Quote:
Originally Posted by m_pascal

I'm on stock KE7+CF Root and I have some problems.
I've downloaded cifs-for-GT-I9100.zip, uncompressed it and put the two files in /fs/cifs

ROOT---cf---cifs---cifs.ko
..................... |__slow-work.ko

I've started ADB SHELL and I typed

Code:
$su
#cd fs
#cd cifs
#insmod slow-work.ko (no reply, so I think it goes well)
#insmod cifs.ko (I get two messages of error "insmod: can't insert 'cifs.ko': unknown symbol in module or invalid parameter" or "insmod: can't insert 'cifs.ko': invalid parameter", it depends)
I'm doing something wrong? I'm sorry but I need this function but I'm not a good hacker

Download it again. I've just uploaded rebuilt modules and it worked on KE7 kernel.
The Following 3 Users Say Thank You to tegrak For This Useful Post: [ View ] Gift tegrak Ad-Free
7th June 2011, 10:13 AM |#4  
Senior Member
Flag Budapest
Thanks Meter: 29
 
More
Working for me.

Thanks

Just a quick question because I failed with it: did you do any config other than enabling cifs?

Sent from my GT-I9100 using XDA App
7th June 2011, 10:31 AM |#5  
m_pascal's Avatar
Member
Flag Parma
Thanks Meter: 5
 
More
Now "insmod cifs.ko" command has been accepted but "insmod slow-work.ko" tell me that that module has been inserited.
If the actual module is the same of yesterday there are no problem because yesterday I inserited it, otherwise I need the command for to remove the old module.

Let's go for try this hack!!! Thanks!!!
7th June 2011, 10:38 AM |#6  
Senior Member
Flag Vienna
Thanks Meter: 47
 
More
The new version is working for me on stock KE2 (now Mount Manager isn't working with the Galaxy S II, but that's a different story -> CifsManager works fine). Thanks!

May I ask what was changed in the latest version to make it work?
7th June 2011, 10:58 AM |#7  
m_pascal's Avatar
Member
Flag Parma
Thanks Meter: 5
 
More
Grrrr!!!! I've installed Astro and his SMB module but, when I click on wifi button in the program, Astro crashes.
On Galaxy S I had the same problem.
Is there another program for to try this cifs.ko with pc?

Question 2: With this hack is possible to stream videos from pc to SGS2, viceversa, or both the directions? And It's the same for http/ftp connections?
7th June 2011, 11:24 AM |#8  
Senior Member
Flag Vienna
Thanks Meter: 47
 
More
Quote:
Originally Posted by m_pascal

Grrrr!!!! I've installed Astro and his SMB module but, when I click on wifi button in the program, Astro crashes.
On Galaxy S I had the same problem.
Is there another program for to try this cifs.ko with pc?

Question 2: With this hack is possible to stream videos from pc to SGS2, viceversa, or both the directions? And It's the same for http/ftp connections?

You don't need the SMB module - that's the whole point of the cifs module, so you can mount your shares within the phone's file system. Try CifsManager from the market, it will mount your shares to /mnt/cifs/<share> by default so you can access it with any file manager, and yes, any video player. It can also load the modules - put in the following to load both (my modules are in /sdcard/):

Code:
slow-work.ko;insmod /sdcard/cifs.ko
The Following 2 Users Say Thank You to jps1974 For This Useful Post: [ View ] Gift jps1974 Ad-Free
7th June 2011, 08:00 PM |#9  
mdalacu's Avatar
Senior Member
Flag Bucharest
Thanks Meter: 198
 
Donate to Me
More
I've used Android Terminal and Cifs Manager to get this working. And really works!
Can we increase the read ahead buffer for cifs, does such a thing even exists? I need this because i've tried to play a 480p avi with mobo player and it was choppy because of constant buffering.
Thank you.

This is what i've used with Android Terminal after i've extracted the contents of cifs-for-GT-I9100.zip (from first post) to the root of my internal sdcard (/mnt/sdcard):
Quote:

$su
#insmod /mnt/sdcard/slow-work.ko
#insmod /mnt/sdcard/cifs.ko



Note: After i have disabled wifi and put the phone in standbay for 30 minutes, it was very hot so i have restated it. Any ideeas?
The Following User Says Thank You to mdalacu For This Useful Post: [ View ] Gift mdalacu Ad-Free
9th June 2011, 08:15 AM |#10  
jackleung's Avatar
Inactive Recognized Developer
Flag USA
Thanks Meter: 48
 
More
nls_utf8.ko for Galaxy SII?
Hi I have some files/folders in Chinese. Where can I find the nls_utf8.ko for Galxay SII, thx?
9th June 2011, 09:50 AM |#11  
Senior Member
Flag Vienna
Thanks Meter: 47
 
More
Quote:
Originally Posted by jackleung

Hi I have some files/folders in Chinese. Where can I find the nls_utf8.ko for Galxay SII, thx?

Should not be necessary, AFAIK the kernel has this built in. You do need to use the mount option 'iocharset=utf8' though.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes