[HOWTO] (+2.3.4) build cifs.ko (for stock kernel) - Galaxy S II Original Android Development

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!

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 [B](no reply, so I think it goes well)[/B]
#insmod cifs.ko [B](I get two messages of error "[I]insmod: can't insert 'cifs.ko': unknown symbol in module or invalid paramete[/I]r" or "[I]insmod: can't insert 'cifs.ko': invalid parameter[/I]", it depends)[/B]
I'm doing something wrong? I'm sorry but I need this function but I'm not a good hacker

m_pascal said:
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 [B](no reply, so I think it goes well)[/B]
#insmod cifs.ko [B](I get two messages of error "[I]insmod: can't insert 'cifs.ko': unknown symbol in module or invalid paramete[/I]r" or "[I]insmod: can't insert 'cifs.ko': invalid parameter[/I]", it depends)[/B]
I'm doing something wrong? I'm sorry but I need this function but I'm not a good hacker
Click to expand...
Click to collapse
Download it again. I've just uploaded rebuilt modules and it worked on KE7 kernel.

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

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!!!

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?

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?

m_pascal said:
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?
Click to expand...
Click to collapse
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

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):
$su
#insmod /mnt/sdcard/slow-work.ko
#insmod /mnt/sdcard/cifs.ko
Click to expand...
Click to collapse
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?

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?

jackleung said:
Hi I have some files/folders in Chinese. Where can I find the nls_utf8.ko for Galxay SII, thx?
Click to expand...
Click to collapse
Should not be necessary, AFAIK the kernel has this built in. You do need to use the mount option 'iocharset=utf8' though.

mdalacu said:
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.
Click to expand...
Click to collapse
I am interested in this as well, any video with a high bit rate seems to be jumpy.

All of this quiet over whelming is there a simpler way to enable this for stock kernel?
the *nood* way. Just wondering, not trying to piss anyone off.

jps1974 said:
Should not be necessary, AFAIK the kernel has this built in. You do need to use the mount option 'iocharset=utf8' though.
Click to expand...
Click to collapse
I am root and using stock KE7 kernel. Once I use this option in CifsManager, it reports segmentation fault error. Without such option, I can mount ok but with garbage characters for those Chinese named folder.
edit: you are right. It's built-in and I can mount properly with CLI. Probably something wrong with CifsManager. Someone already report this issue to the developer (http://forum.xda-developers.com/showpost.php?p=13480264&postcount=351)

adverse said:
All of this quiet over whelming is there a simpler way to enable this for stock kernel?
the *nood* way. Just wondering, not trying to piss anyone off.
Click to expand...
Click to collapse
This is all really simple(requires root) - download the cifs. ko and slow-work.ko files and put them on your sdcard. Then just download "terminal emulator" from the market and "cifs manager". Now open up the terminal and input the following:
$su
# insmod /mnt/sdcard/slow-work.ko
# insmod /mnt/sdcard/cifs.ko
(remember to click "Allow" at the root privlidges popup)
Then open cifs manager and click "Add new share.." and input the ip adress and folder for your share and voila you're done! Shouldn't take you more than a minute or so!
Note: I got an input/output error when I tried mounting a shared folder on an account without a password(Windows 7 64-bit).

adverse said:
All of this quiet over whelming is there a simpler way to enable this for stock kernel?
the *nood* way. Just wondering, not trying to piss anyone off.
Click to expand...
Click to collapse
Copy the two files to the sdcard and use cifsmanager from the Android market. Add the line "/mnt/sdcard/slow-work.ko:/mnt/sdcard/cifs.ko" to the advanced settings. Activate the "load per insmod " and the load on start options.
Sent from my GT-I9100 using XDA Premium App

Many thanks this made very simple for me too.
However for me I have to type the the following in cisfs manger to get it to work
/sdcard/slow-work.ko:/sdcard/cifs.ko
Many Thanks
Slick_42 said:
Copy the two files to the sdcard and use cifsmanager from the Android market. Add the line "/mnt/sdcard/slow-work.ko:/mnt/sdcard/cifs.ko" to the advanced settings. Activate the "load per insmod " and the load on start options.
Sent from my GT-I9100 using XDA Premium App
Click to expand...
Click to collapse

Great Stuff, thanks for tegrak!
Thought is it me or streaming files is laggy on the other hand plex works great, odd :/ Also on the same network my XOOM streams just fine via cifs itself.
Cheers.

The only solution for the lag I found so far is using the rock player in software mode.
Sent from my GT-I9100 using XDA Premium App

huzz said:
Great Stuff, thanks for tegrak!
Thought is it me or streaming files is laggy on the other hand plex works great, odd :/ Also on the same network my XOOM streams just fine via cifs itself.
Cheers.
Click to expand...
Click to collapse
You're welcome XOOM.. my address is.. I'm waiting to arrive your zoom to me.

Related

tun driver for our hero

Hi!
For the ones interested in openvpn or vpnc I attach the tun.ko module.
Have fun.
Here is the tun driver package. Think you should have a rooted device to make use of it.
To install:
1. copy it to your <sdk>/tools folder
2. adb push hero-tun-module-signed.zip /sdcard/update.zip
3. Type 'adb shell reboot bootloader' to enter the bootloader.(or turn it off and then, holding back button, turn it on)
4. Type 'fastboot boot cm-hero-recovery.img' - the device will now boot into the recovery image.
5. Select the option to 'apply update.zip from SD card'. Let it complete.
6. select reboot
Hi!
Good idea and thanks for packaging it. I just made a quick shot ;-)
Will add this to 1.2.
P
get-a-robot-vpnc does not work using the tun driver included in
2.0-update-hero-modacocustomrom-enhanced-signed.zip
The message appears after entering the pasword for sign on.
The application VPN Connections (process org.codeandroid.vpnc_frontend) has stopped unexpectedly.
# insmod /system/lib/modules/tun.ko
insmod /system/lib/modules/tun.ko
insmod: can't insert '/system/lib/modules/tun.ko': invalid module format
whether tun.ko is fron the 2.0 zero,
or installed via update.zip from hero-tun-module-signed.zip - above.
dmesg says
tun: version magic '2.6.27-a5504199 preempt mod_unload ARMv6 ' should be '2.6.27-8dd6deee preempt mod_unload ARMv6 '
the /etc/net folder does not exist, neither does /etc/tun
tun for 2.6.27-8dd6deee
See attachment for tun driver kernel version: 2.6.27-8dd6deee
(MoDaCo 2.0)
Thanks gogh57,
insmod ran OK.
installed to /dev/tun
vpn is now Trying to connect...
I'll have to check the VPN parameters.
Will let you know.
Brilliant work, many thanks.
I've check and verified my vpn parameters, but get a failed to connect. I'll keep reading and trying and will let you all know.
For info, all I have done - just in case I have missed a fundamental step...
1. Installed VPN connections from the market
2. Configured a network to connect to
3. copied tun.ko to SD card
4. ran adb shell to get on phone then insmod tun.ko - no errors, and shows with lsmod
5. tried to connect.
Getting closer....!
Bryan
How to install it on my Hero?
Hi all,
I have the same problem. Currently using Modaco's 1.5.1 and I do not want to move to 2.0 as it seems that it does not offer any advantage and I am happy until now with 1.5.1.
I am trying to install tun.ko which exists in system/lib/modules (installed with Modaco's ROM). When installing the tun.ko, I get "Exec format error" with dmesg:
# dmesg | grep tun
<3>[152396.817749] tun: version magic '2.6.27-a5504199 preempt mod_unload ARMv6
' should be '2.6.27-44690c1a preempt mod_unload ARMv6 '
How can I find the 2.6.27-44690c1a version ?
Or else I will wait for Bryan's tests and if successful, I will move to 2.0
Thanks for any help
Yiannis
<EDIT> - Moved to Modaco 2.1, Insmod runs OK, VPN-Connect does not connect. I'll dig more and let u know
Newby question, but what can you do with it?
YiannisM said:
Hi all,
I have the same problem. Currently using Modaco's 1.5.1 and I do not want to move to 2.0 as it seems that it does not offer any advantage and I am happy until now with 1.5.1.
I am trying to install tun.ko which exists in system/lib/modules (installed with Modaco's ROM). When installing the tun.ko, I get "Exec format error" with dmesg:
# dmesg | grep tun
<3>[152396.817749] tun: version magic '2.6.27-a5504199 preempt mod_unload ARMv6
' should be '2.6.27-44690c1a preempt mod_unload ARMv6 '
How can I find the 2.6.27-44690c1a version ?
Or else I will wait for Bryan's tests and if successful, I will move to 2.0
Thanks for any help
Yiannis
<EDIT> - Moved to Modaco 2.1, Insmod runs OK, VPN-Connect does not connect. I'll dig more and let u know
Click to expand...
Click to collapse
I'm getting nowhere with this. I'll have to look on the phone to see if it logs anywhere to help diagnose
Let use know YiannisM if you get anywhere?!
Bryan
On my HTC Hero
Using Modaco 2.2
tun.zip included in above
VPN Connections installed
and modified scripts described here:
http://techha.us/2009/06/android-vpn-vpnc/
VPN works now,
stared via an adapted 'go' script. (but not using VPN Connections UI)
I use ConnectBot for terminal.
I'll post exact details tonight.
pvlagsma said:
I'll post exact details tonight.
Click to expand...
Click to collapse
Look forward to it, I had a quick go following the link you gave, but it *****ed (unsurprisingly) at the location of the tun device.
Well done for cracking it
So close now!
J-Zeus said:
Newby question, but what can you do with it?
Click to expand...
Click to collapse
From Wiki....
A virtual private network (VPN) is a computer network in which some of the links between nodes are carried by open connections or virtual circuits in some larger networks (such as the Internet), as opposed to running across a single private network. The Link Layer protocols of the virtual network are said to be tunneled through the transport network. One common application is to secure communications through the public Internet, but a VPN does not need to have explicit security features such as authentication or content encryption. For example, VPNs can also be used to separate the traffic of different user communities over an underlying network with strong security features, or to provide access to a network via customized or private routing mechanisms.
Simply put, for most people I imagine, it allows us to connect to work.
Bryan
pvlagsma said:
On my HTC Hero
Using Modaco 2.2
tun.zip included in above
VPN Connections installed
and modified scripts described here:
http://techha.us/2009/06/android-vpn-vpnc/
VPN works now,
stared via an adapted 'go' script. (but not using VPN Connections UI)
I use ConnectBot for terminal.
I'll post exact details tonight.
Click to expand...
Click to collapse
Also looking forward to this.
Installing VPN on the HTC Hero.
References:
----------
A: This thread - http://forum.xda-developers.com/showthread.php?p=4503502
B: vpnc details - http://techha.us/2009/06/android-vpn-vpnc/
C: ROM 2.2 - http://android.modaco.com/content/h...m-is-here-2-versions-based-on-the-new-update/
D: VPN_Connections: - http://code.google.com/p/get-a-robot-vpnc/downloads/list
E: ConnectBot - android market - the terminal app I use on my Hero. You can do all this from an 'adb shell' on your PC.
1. Flash the 2.2 ROM (others probably work, but the correct tun.ko for the linux build is included in the ROM) from Ref C.
2. Download the latest version (VPN_Connections_v09.apk at time of writing) from get-a-robot-vpnc (Ref D), and install on your Hero.
This provides the vpn modules that are needed.
However I could not get this UI to work on the Hero. It kept hanging, sometimes asking for the password, sometimes not.
Note: the android market version is still 0.6
3. Install the tun.ko module with a script, or manually. This needs to be done each time you boot the Hero.
The script is:
'prep' script ( the following 3 lines: )
-----------
insmod /system/lib/modules/tun.ko
mkdir /dev/net
ln -s /dev/tun /dev/net/tun
Install tun by typing:
sh /sdcard/prep
or typing the 3 commands. (you need to be root, to do this)
(I placed my script on the microSD card, /sdcard/prep)
You can call this script anything you like.
4. Make an 'vpn.conf' file .
IPSec gateway vpn.aa.bb.com
IPSec ID youroffice
IPSec secret yourofficepassword
Xauth username youruid
Place it on /sdcard/vpn.conf
See Ref B for details.
You can call this configuration file anything you like.
5. Make a 'go' script, like this (one long line)
/data/data/org.codeandroid.vpnc_frontend/files/vpnc /sdcard/vpn.conf --script /data/data/org.codeandroid.vpnc_frontend/files/vpnc-script --pid-file /sdcard/vpnc-pid --no-detach --debug 1
Put it in a file /sdcard/go .
N.B. The 'go' script refers to the 'vpn.conf' file which you created earlier.
See Ref B for details.
You can call this script anything you like.
(Note: VPN Connections (Ref D) installs its files to /data/data/org.codeandroid.vpnc_frontend )
6. Start VPN by typing:
sh /sdcard/go
hopefully you will see
# sh /sdcard/go
sh /sdcard/go
Enter password for [email protected]: <this is where you type in your password>
vpnc version ERSION
IKE SA selected psk+xauth-3des-sha1
NAT status: no NAT-T VID seen
got address 33.333.333.333
RTNETLINK answers: File exists
backing up dns and resolve.conf
cp: cannot stat '/etc/resolv.conf': No such file or directory
vpnc-script ran to completion
IPSEC SA selected 3des-sha1
VPNC started in foreground...
&. Start an ssh connection, or a browser to an internal website, or whatever
Brilliant, many thanks!!
couldn't find a /etc/resolv.conf have put a couple of address' into /etc/hosts so I can browse my intranet.
How are you doing DNS??
Bryan
Is it possible to configure for IPSec over tcp?
Just an update from me, the VPN Connect frontend does not work, I have used pvlagsm's instructions and worked for me.
Thanks

[krn.module] CIFS kernel module for X10 GB (SAMBA shares)

Hello guys,
I've compiled the CIFS module for our X10 (stock kernel version for 2.3.3, that is 2.6.29-00054-g5f01537 ).
Introduction
CIFS is for allowing to mount SAMBA/CIFS shares from Windows (mostly), so that they appear like a folder on the phone.
Specifically, you can watch movies on your X10 from a share, without first copying them to the phone. In fact you can mount any SAMBA share and do all operations with it.
There are two modules that do the job: cifs.ko (which is the main one) as well as nls_utf8.ko which just provides UTF-8 support for file/folder names within the shares.
Installation
Once you have unpacked the zip and extracted the two modules into the folder of your choice, the commands are these:
Code:
adb push "nls_utf8.ko" /sdcard/nls_utf8.ko
adb push "cifs.ko" /sdcard/cifs.ko
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/lib/modules
cp /sdcard/nls_utf8.ko .
cp /sdcard/cifs.ko .
insmod nls_utf8.ko
insmod cifs.ko
mkdir /sdcard/cifs
mount -o username=<yours>,password=<yours>,iocharset=utf8 -t cifs //<serverip>/<sharename> /sdcard/cifs
Now you can cd to your /sdcard/cifs and see the files shared there.
Observations
1. nls_utf8.ko is not mandatory and if your files don't have UTF-8 characters and only ascii, you can skip it IF you remove the isocharset=utf8 from the mount command above.
2. Music will stutter with all players I've tried. found an opinion that might be android lowlevel subsystem for reading mp3 files, and that they don't buffer enough - and given the latency over WIFI, this will create pauses / stuttering in the music. However, you can still copy the audio files, etc.
3. Movie playing works! I've tried RockPlayer for few minutes and didn't have an issue (seems it handles buffering very well) since it is software and thus they don't rely on some Android codec / etc.
4. Skip works! Again in Rock Player, you can skip in the movie and it takes a bit to skip there, but it does.
5. umount usually fails, since I assume, Android apps don't really exit and don't really free the resources. Once a file open, it doesn't let me un-mount saying that the resource / device is busy.
Download
Use it at your own risk!
cifs.zip
Chefs can bundle the files within the ROMs they offer - but please add this link into descriptions so that people can discuss issues they might encounter.
Cool.. Will try..
Sent from my X10i using XDA Premium App
nice! i am gonna try this!
New toy I'll give this a go tonight and report back. Thanks!
Hi viulian,
Thanks for the module. Would you mind if I include it in the hotfix for my rom?
Cheers,
z
zdzihu said:
Hi viulian,
Thanks for the module. Would you mind if I include it in the hotfix for my rom?
Cheers,
z
Click to expand...
Click to collapse
Absolutely no problem Z please do.
This module definetly requires an app to manage CIFS, mounting them with selected user/pass/path.
You can try cifs manager, its good.
Btw i thought the new sources weren't released yet.
I'm using old 2.1 sources and I could build these modules using Sony's blog post about how to compile kernels (with their CodeSourcery compiler) and a bit of Google foo.
Btw, I have another one ready, the cpufreq_interactive one which I'm creating a new thread now.
Later edit:
Although initially I read posts complaining about Sony's decision to keep the old 2.1 kernel (2.6.29) instead of the recommended (2.6.32) for GingerBread, it turned out that it was actually a smart move
Basically, the cifs module at least was much more difficult to port, due to the slow_work.ko module that needed to be compiled as well and inserted before.
viulian said:
Hello guys,
I've compiled the CIFS module for our X10 (stock kernel version for 2.3.3, that is 2.6.29-00054-g5f01537 ).
Introduction
CIFS is for allowing to mount SAMBA/CIFS shares from Windows (mostly), so that they appear like a folder on the phone.
Specifically, you can watch movies on your X10 from a share, without first copying them to the phone. In fact you can mount any SAMBA share and do all operations with it.
There are two modules that do the job: cifs.ko (which is the main one) as well as nls_utf8.ko which just provides UTF-8 support for file/folder names within the shares.
Installation
Once you have unpacked the zip and extracted the two modules into the folder of your choice, the commands are these:
Code:
adb push "nls_utf8.ko" /sdcard/nls_utf8.ko
adb push "cifs.ko" /sdcard/cifs.ko
adb shell
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cd /system/lib/modules
cp /sdcard/nls_utf8.ko .
cp /sdcard/cifs.ko .
insmod nls_utf8.ko
insmod cifs.ko
mkdir /sdcard/cifs
mount -o username=<yours>,password=<yours>,iocharset=utf8 -t cifs //<serverip>/<sharename> /sdcard/cifs
Now you can cd to your /sdcard/cifs and see the files shared there.
Observations
1. nls_utf8.ko is not mandatory and if your files don't have UTF-8 characters and only ascii, you can skip it IF you remove the isocharset=utf8 from the mount command above.
2. Music will stutter with all players I've tried. found an opinion that might be android lowlevel subsystem for reading mp3 files, and that they don't buffer enough - and given the latency over WIFI, this will create pauses / stuttering in the music. However, you can still copy the audio files, etc.
3. Movie playing works! I've tried RockPlayer for few minutes and didn't have an issue (seems it handles buffering very well) since it is software and thus they don't rely on some Android codec / etc.
4. Skip works! Again in Rock Player, you can skip in the movie and it takes a bit to skip there, but it does.
5. umount usually fails, since I assume, Android apps don't really exit and don't really free the resources. Once a file open, it doesn't let me un-mount saying that the resource / device is busy.
Download
Use it at your own risk!
cifs.zip
Chefs can bundle the files within the ROMs they offer - but please add this link into descriptions so that people can discuss issues they might encounter.
Click to expand...
Click to collapse
Thanks viulian, very nice modules! May I include it in my rom?
Regards
Erick
Hello Erick, yes. Please add a link in your descriptions / thread / patches page etc, so people would also come here to check for possible issues, share experiences etc.
viulian said:
Hello Erick, yes. Please add a link in your descriptions / thread / patches page etc, so people would also come here to check for possible issues, share experiences etc.
Click to expand...
Click to collapse
For sure, thanks!
Hello friend,
Just wondering if I can install this through android terminal rather than adb?
Same commands/process? Thx
Aphex33 said:
Hello friend,
Just wondering if I can install this through android terminal rather than adb?
Same commands/process? Thx
Click to expand...
Click to collapse
Yes - if you handle copying the module to sdcard separately and then you become root in terminal, then it's the same.
viulian said:
Yes - if you handle copying the module to sdcard separately and then you become root in terminal, then it's the same.
Click to expand...
Click to collapse
Thx for quick response, become root in terminal? Explain please.....buy the way your modules rock! Currently using interactive.ko
Aphex33 said:
Thx for quick response, become root in terminal?
Click to expand...
Click to collapse
When you start the terminal, you notice you have a $ sign displayed to the left of the command prompt. That means you do not have the rights to do most things, since $ is for standard (limited) user.
What you need is to type command
Code:
su
And then your prompt will change to the dash sign #.
That means now you have full control over the phone, and you can start typing the commands.
Please double check what you do, and that you typed correctly - otherwise, as root, you might render your phone useless. Do not attempt if you don't feel confident enough and that you know what you are doing.
viulian said:
When you start the terminal, you notice you have a $ sign displayed to the left of the command prompt. That means you do not have the rights to do most things, since $ is for standard (limited) user.
What you need is to type command
Code:
su
And then your prompt will change to the dash sign #.
That means now you have full control over the phone, and you can start typing the commands.
Please double check what you do, and that you typed correctly - otherwise, as root, you might render your phone useless. Do not attempt if you don't feel confident enough and that you know what you are doing.
Click to expand...
Click to collapse
Thank you once again.
viulian said:
When you start the terminal, you notice you have a $ sign displayed to the left of the command prompt. That means you do not have the rights to do most things, since $ is for standard (limited) user.
What you need is to type command
Code:
su
And then your prompt will change to the dash sign #.
That means now you have full control over the phone, and you can start typing the commands.
Please double check what you do, and that you typed correctly - otherwise, as root, you might render your phone useless. Do not attempt if you don't feel confident enough and that you know what you are doing.
Click to expand...
Click to collapse
Hello, so If I have this correct, after placing the module in the correct place I have to type the commands in the first post word for word, correct? Apologize for being a noob, just wanna make sure.
hello guy
I dont know how to mount files from Windows. Someone explains clearly , please
Sorry for being noob. I think this module is awesome but dont know how to use
Got an exec format error when trying to insmod.
What can i try to solve this please ?
Thanks !

Help adding CIFS support to kernels?

Often I find myself really liking a particular kernel for a particular device. The common problem I have found is that no CIFS support is added to the kernel.
I have donated to several kernel devs. I don't expect anything from them, I just wanted to show my appreciation.
However, usually my CIFS inquiries go unnoticed.
I would like to add CIFS support to other people's kernels for my personal use on my device.
I presume I will have to decompile and recompile kernels in the process?
Here is the specific case that I have :
Current setup:
Phone - Verizon Galaxy Note 2
ROM - Beans build 22 (Touchwiz)
Kernel - Perseus 36
I would like to use Imnuts' PBJ kernel. It doesn't support CIFS, whereas Perseus does.
So in theory I could extract the CIFS modules and inject them into PBJ? Any ideas? Any help would be appreciated. I would also be willing to donate to someone willing to build one for me (mods, let me know if that isn't cool to mention. ) I don't have a Linux box or the current means of acquiring a Linux box until early next year. I am curious if this can be done on Windows 7?
xdadevnube said:
Often I find myself really liking a particular kernel for a particular device. The common problem I have found is that no CIFS support is added to the kernel.
I have donated to several kernel devs. I don't expect anything from them, I just wanted to show my appreciation.
However, usually my CIFS inquiries go unnoticed.
I would like to add CIFS support to other people's kernels for my personal use on my device.
I presume I will have to decompile and recompile kernels in the process?
Here is the specific case that I have :
Current setup:
Phone - Verizon Galaxy Note 2
ROM - Beans build 22 (Touchwiz)
Kernel - Perseus 36
I would like to use Imnuts' PBJ kernel. It doesn't support CIFS, whereas Perseus does.
So in theory I could extract the CIFS modules and inject them into PBJ? Any ideas? Any help would be appreciated. I would also be willing to donate to someone willing to build one for me (mods, let me know if that isn't cool to mention. ) I don't have a Linux box or the current means of acquiring a Linux box until early next year. I am curious if this can be done on Windows 7?
Click to expand...
Click to collapse
There may be a simpler method of doing this using insmod and downloadable cifs.ko module rather then taking the developers kernel source and then compiling it to include the cifs.ko module, using the following steps:
1. Make sure you have the latest version of Busybox installed
2. Download this .7z file and extract it's contents the modules you want are md4.ko and cifs.ko (Even though the .zip says Nexus 10 it should still work on your device).
3. Take the md4.ko module and cifs.ko module and place them in your /system/lib/modules folder (Make sure to mount the /system folder as read/write first and if the /system/lib/modules folder doesn't exist make sure to create it and set the proper permissions which should be the same as the /system/lib folder).
4. Now that you have placed the md4.ko and cifs.ko module in the /system/lib/modules folder run the following command:
Code:
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
5. After that completes you should now be able to use the cifs.ko module to perform your desired task.
Let me know if you still have questions I'll be happy to help you out.
shimp208 said:
There may be a simpler method of doing this using insmod and downloadable cifs.ko module rather then taking the developers kernel source and then compiling it to include the cifs.ko module, using the following steps:
1. Make sure you have the latest version of Busybox installed
2. Download this .7z file and extract it's contents the modules you want are md4.ko and cifs.ko (Even though the .zip says Nexus 10 it should still work on your device).
3. Take the md4.ko module and cifs.ko module and place them in your /system/lib/modules folder (Make sure to mount the /system folder as read/write first and if the /system/lib/modules folder doesn't exist make sure to create it and set the proper permissions which should be the same as the /system/lib folder).
4. Now that you have placed the md4.ko and cifs.ko module in the /system/lib/modules folder run the following command:
Code:
insmod /system/lib/modules/md4.ko
insmod /system/lib/modules/cifs.ko
5. After that completes you should now be able to use the cifs.ko module to perform your desired task.
Let me know if you still have questions I'll be happy to help you out.
Click to expand...
Click to collapse
I'm trying to do this on my Nexus 10 with stock 5.1.1 rooted and busyboxed but i get the following error when attempting to insmount the modules:
255|[email protected]:/ # insmod /system/lib/modules/md4.ko
insmod: init_module '/system/lib/modules/md4.ko' failed (function not implemented)
Click to expand...
Click to collapse
modules folder and files are chmod 777, btw.
Did you ever find a solution to this? I'm stuck at the same error message.

[DEV only] Random Development thoughts

I have started this thread as a place to discuss random development thought that probably don't need their own threads, and as a place to discuss issues so other threads don't go too far off topic.
Table of Contents:
DBV for c6843: Posts 1 - 6
GPL: Post 7
F2FS: Post 8
wlan: post 9, 11 -
Optimisation Bookmark: post 10
Original Post 1:
First thought
@dbolivar Have you tried building you (DooMKernel) with CONFIG_DVB_CORE = y/m to see if you can get the TV function to work?
blueether said:
I have started this thread as a place to discuss random development thought that probably don't need their own threads, and as a place to discuss issues so other threads don't go too far off topic.
First thought
@dbolivar Have you tried building you (DooMKernel) with CONFIG_DVB_CORE = y/m to see if you can get the TV function to work?
Click to expand...
Click to collapse
Hi, good start. In fact I have, the differences in the kernel options between C6833 and C6843 (Brazilian model with digital TV) are:
Code:
47c47
< CONFIG_MACH_SONY_TOGARI_BRAZIL=y
---
> CONFIG_MACH_SONY_TOGARI_ROW=y
275d274
< CONFIG_ISDBT_TUNER_SMTEJ11X=y
325a325,327
> CONFIG_TOUCHSCREEN_CLEARPAD=y
> CONFIG_TOUCHSCREEN_CLEARPAD_I2C=y
> CONFIG_TOUCHSCREEN_CLEARPAD_RMI_DEV=y
Yes, I don't know why the Clearpad touchscreen is enabled for the C6833, but not for the C6843; I think it's just garbage (perhaps they made the togari defconfig based off honami, and corrected that when making the togari_brazil defconfig). It doesn't make any difference for me, disabling them keep the touchscreen (MAX1187) functions normal.
Well, back to the point: even when applying these differences to the ZU DooMKernel, the digital TV doesn't work. The app stays a long time in a black screen, and finally closes (FC). I investigated the kmsg and logcat, but nothing useful.
CONFIG_DVB_CORE is "m" by default. I tried insmod'ing every module in /system/lib/modules, but same result. I temporarily gave up, because I don't watch the crap they broadcast on the open TV here. But yeah, it would be good to have everything working...
dbolivar said:
Hi, good start. In fact I have, the differences in the kernel options between C6833 and C6843 (Brazilian model with digital TV) are:
Code:
47c47
< CONFIG_MACH_SONY_TOGARI_BRAZIL=y
---
> CONFIG_MACH_SONY_TOGARI_ROW=y
275d274
< CONFIG_ISDBT_TUNER_SMTEJ11X=y
325a325,327
> CONFIG_TOUCHSCREEN_CLEARPAD=y
> CONFIG_TOUCHSCREEN_CLEARPAD_I2C=y
> CONFIG_TOUCHSCREEN_CLEARPAD_RMI_DEV=y
Yes, I don't know why the Clearpad touchscreen is enabled for the C6833, but not for the C6843; I think it's just garbage (perhaps they made the togari defconfig based off honami, and corrected that when making the togari_brazil defconfig). It doesn't make any difference for me, disabling them keep the touchscreen (MAX1187) functions normal.
Well, back to the point: even when applying these differences to the ZU DooMKernel, the digital TV doesn't work. The app stays a long time in a black screen, and finally closes (FC). I investigated the kmsg and logcat, but nothing useful.
CONFIG_DVB_CORE is "m" by default. I tried insmod'ing every module in /system/lib/modules, but same result. I temporarily gave up, because I don't watch the crap they broadcast on the open TV here. But yeah, it would be good to have everything working...
Click to expand...
Click to collapse
I hadn't got around to diff'ing them I just noticed the DVB line and had a quick look at the brazil defconfig.
I guess there is a binary blob that is needed?
For some reason I have to include the clearpad stuff at the moment in the pimped kernel, I should dig to find out why so the kernel is a tad smaller.
blueether said:
I hadn't got around to diff'ing them I just noticed the DVB line and had a quick look at the brazil defconfig.
I guess there is a binary blob that is needed?
For some reason I have to include the clearpad stuff at the moment in the pimped kernel, I should dig to find out why so the kernel is a tad smaller.
Click to expand...
Click to collapse
Hmm very good insight about the binary blob... It's very possible. I have FTFs for the C6833 and C6843, I'll extract them and compare the file list.
I made it work!! Well, involves some manual steps, but it's a very good progress. I started by comparing the file listing in /system from stock C6833 and C6843 firmwares, and although there is no kernel blob, there ARE some files related to DTV, mostly dynamic libs (.so), some configuration, but most importantly, these two:
Code:
/system/bin/dtvsdserver
/system/bin/dtvserver
So, I insmod'ed every module related to DTV/DVB, and then started these guys... And the TV works! BUT, as soon as I quit the Mobile TV app, the process "dtvserver" is killed with a hangup signal, and opening the app again does not restart it, so I have to manually bring the dtvserver up first (otherwise the same previous issue happens, black screen and finally Mobile TV FC's).
I notice some DTV/DVB modules couldn't be insmod'ed:
Code:
insmod: init_module 'dib3000mc.ko' failed (No such file or directory)
insmod: init_module 'dib7000m.ko' failed (No such file or directory)
insmod: init_module 'dib7000p.ko' failed (No such file or directory)
insmod: init_module 'dib8000.ko' failed (No such file or directory)
insmod: init_module 'dib9000.ko' failed (No such file or directory)
insmod: init_module 'mpq-dmx-hw-plugin.ko' failed (No such file or directory)
insmod: init_module 'tuner-simple.ko' failed (No such file or directory)
But the modules are there, and they are the new ones... I don't get it why they can't be insmod'ed, perhaps something is missing from the kernel config? It could be one of the reasons.
Another thing I've been wondering, is why the DVB modules necessary for the Mobile TV are not loaded automatically, like the wlan module is, for instance. Perhaps a difference in the ramdisk? Something to investigate next.
dbolivar said:
I made it work!! Well, involves some manual steps...
Another thing I've been wondering, is why the DVB modules necessary for the Mobile TV are not loaded automatically, like the wlan module is, for instance. Perhaps a difference in the ramdisk? Something to investigate next.
Click to expand...
Click to collapse
Congrats on getting that far with the DTV, will make for a more complete device for the c6843 users that want to use custom ROMs
Any differences in udev or init.rc or whatever android uses?
Development using the GPL and GPL'd code
The GPL is a very powerful tool, as are the other OSS licences. One has to know how they are used and can/can't be enforced before publishing any code under these licences or modifying code that that been published under a OSS licence. Using a OSS licence brings with it risks and rewords, often these are one and the same.
When we do anything with Android [Linux] kernels we fall under the bounds of the GPL v2 that it is published under. Any modification to the kernel has to be published under the same licence, and we have to publish the newly modified source in a sate that can recreate the binary that you publish to the public/xda.
I'll leave you with this quote from http://programmers.stackexchange.com
...are you prepared to live by it, and let other people use what you've written, rather than just liking it because of what you can get out of it?
Click to expand...
Click to collapse
F2FS mount and sysfs options
Now that we have an F2FS-enabled firmware by default, I've been reading about the mount options and sysfs entries available. As many of us know, there are lots of tweaks out there for EXT4, but what about F2FS? Well, here is the official documentation from the Linux kernel:
https://www.kernel.org/doc/Documentation/filesystems/f2fs.txt
As for the mount options, I think only discard could be interesting (but it's questionable, some people say it's better to schedule a regular fstrim call instead). There are also some sysfs tunables which I think can have a noticeable impact in battery life, and performance. Testing them would require a lot of trial and error. I'm pasting them below for those who don't want to go through the full document:
Code:
================================================================================
SYSFS ENTRIES
================================================================================
Information about mounted f2f2 file systems can be found in
/sys/fs/f2fs. Each mounted filesystem will have a directory in
/sys/fs/f2fs based on its device name (i.e., /sys/fs/f2fs/sda).
The files in each per-device directory are shown in table below.
Files in /sys/fs/f2fs/<devname>
(see also Documentation/ABI/testing/sysfs-fs-f2fs)
..............................................................................
File Content
gc_max_sleep_time This tuning parameter controls the maximum sleep
time for the garbage collection thread. Time is
in milliseconds.
gc_min_sleep_time This tuning parameter controls the minimum sleep
time for the garbage collection thread. Time is
in milliseconds.
gc_no_gc_sleep_time This tuning parameter controls the default sleep
time for the garbage collection thread. Time is
in milliseconds.
gc_idle This parameter controls the selection of victim
policy for garbage collection. Setting gc_idle = 0
(default) will disable this option. Setting
gc_idle = 1 will select the Cost Benefit approach
& setting gc_idle = 2 will select the greedy aproach.
reclaim_segments This parameter controls the number of prefree
segments to be reclaimed. If the number of prefree
segments is larger than the number of segments
in the proportion to the percentage over total
volume size, f2fs tries to conduct checkpoint to
reclaim the prefree segments to free segments.
By default, 5% over total # of segments.
max_small_discards This parameter controls the number of discard
commands that consist small blocks less than 2MB.
The candidates to be discarded are cached until
checkpoint is triggered, and issued during the
checkpoint. By default, it is disabled with 0.
ipu_policy This parameter controls the policy of in-place
updates in f2fs. There are five policies:
0: F2FS_IPU_FORCE, 1: F2FS_IPU_SSR,
2: F2FS_IPU_UTIL, 3: F2FS_IPU_SSR_UTIL,
4: F2FS_IPU_DISABLE.
min_ipu_util This parameter controls the threshold to trigger
in-place-updates. The number indicates percentage
of the filesystem utilization, and used by
F2FS_IPU_UTIL and F2FS_IPU_SSR_UTIL policies.
max_victim_search This parameter controls the number of trials to
find a victim segment when conducting SSR and
cleaning operations. The default value is 4096
which covers 8GB block address range.
dir_level This parameter controls the directory level to
support large directory. If a directory has a
number of files, it can reduce the file lookup
latency by increasing this dir_level value.
Otherwise, it needs to decrease this value to
reduce the space overhead. The default value is 0.
ram_thresh This parameter controls the memory footprint used
by free nids and cached nat entries. By default,
10 is set, which indicates 10 MB / 1 GB RAM.
@blueether & @dbolivar :
our primary concern should be to get custom wlan (prima/pronto) drivers working on custom compiled kernel for stock ROMs.. once we have that there are a LOT of features which we can add!
so far I havent had much luck but you can find all my tests here
https://github.com/DooMLoRD/android_kernel_sony_msm8974/commits/testing_stock_4.3_wlan
https://github.com/DooMLoRD/android_kernel_sony_msm8974/commits/testing_stock_4.3_wlan_clean
https://github.com/DooMLoRD/android_kernel_sony_msm8974/commits/testing_z1_gpe_port_wlan
A bookmark
Worth the read @dbolivar
http://forum.xda-developers.com/showthread.php?t=2754997
DooMLoRD said:
@blueether & @dbolivar :
our primary concern should be to get custom wlan (prima/pronto) drivers working on custom compiled kernel for stock ROMs.. once we have that there are a LOT of features which we can add!
so far I havent had much luck but you can find all my tests here
https://github.com/DooMLoRD/android_kernel_sony_msm8974/commits/testing_stock_4.3_wlan
https://github.com/DooMLoRD/android_kernel_sony_msm8974/commits/testing_stock_4.3_wlan_clean
https://github.com/DooMLoRD/android_kernel_sony_msm8974/commits/testing_z1_gpe_port_wlan
Click to expand...
Click to collapse
I'm giving it a try - downloaded the latest sources from CodeAurora and applied to your kernel (adjusting Kconfigs, Makefiles and defconfig). The compilation stops here:
Code:
drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c: In function ‘wlan_hdd_send_avoid_freq_event’:
drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c:574:18: warning: assignment makes pointer from integer without a cast
error, forbidden warning: wlan_hdd_cfg80211.c:574
make[3]: *** [drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.o] Error 1
OK, so I edited wlan_hdd_cfg80211.c and changed line 574 to add an explicit cast:
Code:
vendor_event = (struct sk_buff *)cfg80211_vendor_event_alloc(pHddCtx->wiphy,
Then it passes by this point, but stops in following lines with similar errors (not even pasting here). What I noticed from these errors it that CodeAurora's sources seem to be incompatible with Sony's kernel, because for instance, the function cfg80211_vendor_event_alloc is not defined anywhere (ran a grep over all *.c and *.h files in the kernel).
Comparing with a CM11 kernel, this function is also not defined anywhere, but the prima sources are very different, they don't call it. So I thought: let's use CM11's prima sources.
Bingo!
Compiled fine, booted, and with the correspoding firmware in /system/etc/firmware/wlan/prima, WLAN came up normally after boot. :victory:
Now you mentioned something about CM11's prima sources, from what I understood they are not ideal. Is that true? Because there are CM11-based custom kernels which implement intelliplug (dependent on custom WLAN drivers), for instance.
Hope it works for you. In this case, I'll put together a more organized how-to of what I did.
dbolivar said:
I'm giving it a try - downloaded the latest sources from CodeAurora and applied to your kernel (adjusting Kconfigs, Makefiles and defconfig). The compilation stops here:
Code:
drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c: In function ‘wlan_hdd_send_avoid_freq_event’:
drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.c:574:18: warning: assignment makes pointer from integer without a cast
error, forbidden warning: wlan_hdd_cfg80211.c:574
make[3]: *** [drivers/staging/prima/CORE/HDD/src/wlan_hdd_cfg80211.o] Error 1
OK, so I edited wlan_hdd_cfg80211.c and changed line 574 to add an explicit cast:
Code:
vendor_event = (struct sk_buff *)cfg80211_vendor_event_alloc(pHddCtx->wiphy,
Then it passes by this point, but stops in following lines with similar errors (not even pasting here). What I noticed from these errors it that CodeAurora's sources seem to be incompatible with Sony's kernel, because for instance, the function cfg80211_vendor_event_alloc is not defined anywhere (ran a grep over all *.c and *.h files in the kernel).
Comparing with a CM11 kernel, this function is also not defined anywhere, but the prima sources are very different, they don't call it. So I thought: let's use CM11's prima sources.
Bingo!
Compiled fine, booted, and with the correspoding firmware in /system/etc/firmware/wlan/prima, WLAN came up normally after boot. :victory:
Now you mentioned something about CM11's prima sources, from what I understood they are not ideal. Is that true? Because there are CM11-based custom kernels which implement intelliplug (dependent on custom WLAN drivers), for instance.
Hope it works for you. In this case, I'll put together a more organized how-to of what I did.
Click to expand...
Click to collapse
great!
can you just fork my repo and shift to the branch which worked for you, then send pull request? i will investigate on the Z1...
and yes please do send the steps!
well if we get custom compiled WLAN modules properly working on custom compiled kernel for stock ROM then i can have features like intelli-plug, F2FS, AsyncFS and lots more on stock ROMs!
DooMLoRD said:
great!
can you just fork my repo and shift to the branch which worked for you, then send pull request? i will investigate on the Z1...
and yes please do send the steps!
well if we get custom compiled WLAN modules properly working on custom compiled kernel for stock ROM then i can have features like intelli-plug, F2FS, AsyncFS and lots more on stock ROMs!
Click to expand...
Click to collapse
Well I'm still learning my way around git & GitHub, so I think it will be faster if you just reproduce the steps below:
1) Copy Prima WLAN sources from CM11-based kernel:
I copied from SlimRom's kernel source. Put the sources under drivers/staging/prima.
2) Modify related Kconfig and Makefile:
drivers/staging/Kconfig
Code:
131,132d130
< source "drivers/staging/prima/Kconfig"
<
drivers/staging/Makefile
Code:
58,59d57
< obj-$(CONFIG_PRIMA_WLAN) += prima/
< obj-$(CONFIG_PRONTO_WLAN) += prima/
3) Modify defconfig:
I'm pasting every option related to WLAN. The Prima options should appear after a "make menuconfig".
Code:
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS is not set
CONFIG_CFG80211_INTERNAL_REGDB=y
# CONFIG_CFG80211_WEXT is not set
# CONFIG_WIRELESS_EXT_SYSFS is not set
# CONFIG_LIB80211 is not set
# CONFIG_CFG80211_ALLOW_RECONNECT is not set
# CONFIG_MAC80211 is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_PM=y
CONFIG_RFKILL_LEDS=y
# CONFIG_RFKILL_INPUT is not set
# CONFIG_RFKILL_REGULATOR is not set
# CONFIG_RFKILL_GPIO is not set
...
# CONFIG_WIFI_CONTROL_FUNC is not set
...
CONFIG_WLAN=y
# CONFIG_USB_ZD1201 is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_LIBRA_SDIOIF is not set
# CONFIG_ATH6K_LEGACY_EXT is not set
CONFIG_WCNSS_CORE=y
CONFIG_WCNSS_CORE_PRONTO=y
CONFIG_WCNSS_MEM_PRE_ALLOC=y
CONFIG_WCNSS_REGISTER_DUMP_ON_BITE=y
# CONFIG_ATH_COMMON is not set
# CONFIG_BCMDHD is not set
# CONFIG_BRCMFMAC is not set
# CONFIG_HOSTAP is not set
# CONFIG_IWM is not set
# CONFIG_LIBERTAS is not set
# CONFIG_MWIFIEX is not set
...
#
# Qualcomm Atheros Prima WLAN module
#
CONFIG_PRIMA_WLAN=m
CONFIG_PRONTO_WLAN=y
# CONFIG_PRIMA_WLAN_BTAMP is not set
CONFIG_PRIMA_WLAN_LFR=y
CONFIG_PRIMA_WLAN_OKC=y
CONFIG_PRIMA_WLAN_11AC_HIGH_TP=y
CONFIG_WLAN_FEATURE_11W=y
CONFIG_QCOM_VOWIFI_11R=y
CONFIG_CONFIG_ENABLE_LINUX_REG=y
4) Include Prima WLAN firmware in kernel ZIP file:
Copy from a CM11-based firmware (I used PAC-Rom). Remember to set permissions as 644.
/system/etc/firmware/wlan/prima
Code:
WCNSS_cfg.dat
WCNSS_qcom_cfg.ini
WCNSS_qcom_wlan_nv.bin
5) Include wlan.ko in kernel ZIP file:
Actually I include every compiled kernel module, because we are using a different toolchain and they may benefit from it too. Remember that /system/lib/module/wlan.ko is a symlink, but in my test the target got updated accordingly.
dbolivar said:
Well I'm still learning my way around git & GitHub, so I think it will be faster if you just reproduce the steps below:
1) Copy Prima WLAN sources from CM11-based kernel:
I copied from SlimRom's kernel source. Put the sources under drivers/staging/prima.
2) Modify related Kconfig and Makefile:
drivers/staging/Kconfig
Code:
131,132d130
< source "drivers/staging/prima/Kconfig"
<
drivers/staging/Makefile
Code:
58,59d57
< obj-$(CONFIG_PRIMA_WLAN) += prima/
< obj-$(CONFIG_PRONTO_WLAN) += prima/
3) Modify defconfig:
I'm pasting every option related to WLAN. The Prima options should appear after a "make menuconfig".
Code:
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS is not set
CONFIG_CFG80211_INTERNAL_REGDB=y
# CONFIG_CFG80211_WEXT is not set
# CONFIG_WIRELESS_EXT_SYSFS is not set
# CONFIG_LIB80211 is not set
# CONFIG_CFG80211_ALLOW_RECONNECT is not set
# CONFIG_MAC80211 is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_PM=y
CONFIG_RFKILL_LEDS=y
# CONFIG_RFKILL_INPUT is not set
# CONFIG_RFKILL_REGULATOR is not set
# CONFIG_RFKILL_GPIO is not set
...
# CONFIG_WIFI_CONTROL_FUNC is not set
...
CONFIG_WLAN=y
# CONFIG_USB_ZD1201 is not set
# CONFIG_USB_NET_RNDIS_WLAN is not set
# CONFIG_LIBRA_SDIOIF is not set
# CONFIG_ATH6K_LEGACY_EXT is not set
CONFIG_WCNSS_CORE=y
CONFIG_WCNSS_CORE_PRONTO=y
CONFIG_WCNSS_MEM_PRE_ALLOC=y
CONFIG_WCNSS_REGISTER_DUMP_ON_BITE=y
# CONFIG_ATH_COMMON is not set
# CONFIG_BCMDHD is not set
# CONFIG_BRCMFMAC is not set
# CONFIG_HOSTAP is not set
# CONFIG_IWM is not set
# CONFIG_LIBERTAS is not set
# CONFIG_MWIFIEX is not set
...
#
# Qualcomm Atheros Prima WLAN module
#
CONFIG_PRIMA_WLAN=m
CONFIG_PRONTO_WLAN=y
# CONFIG_PRIMA_WLAN_BTAMP is not set
CONFIG_PRIMA_WLAN_LFR=y
CONFIG_PRIMA_WLAN_OKC=y
CONFIG_PRIMA_WLAN_11AC_HIGH_TP=y
CONFIG_WLAN_FEATURE_11W=y
CONFIG_QCOM_VOWIFI_11R=y
CONFIG_CONFIG_ENABLE_LINUX_REG=y
4) Include Prima WLAN firmware in kernel ZIP file:
Copy from a CM11-based firmware (I used PAC-Rom). Remember to set permissions as 644.
/system/etc/firmware/wlan/prima
Code:
WCNSS_cfg.dat
WCNSS_qcom_cfg.ini
WCNSS_qcom_wlan_nv.bin
5) Include wlan.ko in kernel ZIP file:
Actually I include every compiled kernel module, because we are using a different toolchain and they may benefit from it too. Remember that /system/lib/module/wlan.ko is a symlink, but in my test the target got updated accordingly.
Click to expand...
Click to collapse
which branch did u test this with?
also can you please upload the correct firmware (/system/etc/firmware/wlan/prima) which worked for you?
DooMLoRD said:
which branch did u test this with?
also can you please upload the correct firmware (/system/etc/firmware/wlan/prima) which worked for you?
Click to expand...
Click to collapse
The branch from your kernel was master_kk-4.4.2. The Prima WLAN sources were, as I mentioned, from SlimRom's kernel, branch kk4.4.
I'm attaching the firmware to this post.
blueether said:
A bookmark
Worth the read @dbolivar
http://forum.xda-developers.com/showthread.php?t=2754997
Click to expand...
Click to collapse
Wow this is very nice! Follows the same line of research I've been doing, but this is more "elegant" and in-depth, especially because of all the benchmarks and other comparisons he has done. I'll try this approach myself on my custom builds.
One thing I noticed is that we may still have to use the "hammer" approach with the find & replace of the "-O" flags in *.mk and Makefiles I've been doing, because some of them have these flags hardcoded (i.e. they don't take the value from core/combo/TARGET_linux-arm.mk or other base files). I'll tip JustArchi in his thread about it.
Hi guys, I posted this in the general android section and have had no answer, maybe some one here might know?
I'm trying to build AOSP using CM 11's device tree for togari/togari_gpe and have hit a brick wall after solving the first few make errors.
I have to errors, that I suspect are the same problem:
The first is if I just build with make I get this error:
Code:
Import includes file: out/target/product/togari/obj/SHARED_LIBRARIES/copybit.msm8974_intermediates/import_includes
Import includes file: out/target/product/togari/obj/SHARED_LIBRARIES/libmemalloc_intermediates/import_includes
target thumb C++: libqdutils <= hardware/qcom/display/msm8974/libqdutils/profiler.cpp
target thumb C++: libqdutils <= hardware/qcom/display/msm8974/libqdutils/mdp_version.cpp
target thumb C++: libqdutils <= hardware/qcom/display/msm8974/libqdutils/idle_invalidator.cpp
target thumb C++: libqdutils <= hardware/qcom/display/msm8974/libqdutils/comptype.cpp
hardware/qcom/display/msm8974/libqdutils/mdp_version.cpp:33:27: fatal error: linux/msm_mdp.h: No such file or directory
#include <linux/msm_mdp.h>
^
Import includes file: out/target/product/togari/obj/SHARED_LIBRARIES/gps.msm8974_intermediates/import_includes
compilation terminated.
make: *** [out/target/product/togari/obj/SHARED_LIBRARIES/libqdutils_intermediates/mdp_version.o] Error 1
make: *** Waiting for unfinished jobs....
and if I do make bootimage I get this:
Code:
make: *** No rule to make target `out/target/product/togari/kernel', needed by `out/target/product/togari/boot.img'. Stop.
I suspect that both stem from aosp not finding the kernel source?
kernel source is at ~/dev/aosp/kernel/sony/msm8974/ and I'm building in ~/dev/aosp
I'm also trying to build vanir aosp using the same device tree and kernel and make bootimage completes fine.
Any help would be great
Yo, @DooMLoRD, @blueether @dbolivar
You guys have probably registred that Geohot (iPhone, PS3 jailbreaker) has successfully rooted the Galaxy S5 (and can now claim the $18,000 bounty), but i just read that this one-click root tool should work on any device running a pre-June 3rd kernel, i.e Android 4.4.2. The question is, does it work on the Ultra? I'm aware that it's easy to root an UItra AS LONG as the bootloader is unlocked, but this thing circumvents that part, and roots it. I think.
Are there anyone here still left on 4.4.2 that can try?
More here: Click
LordManhattan said:
Yo, @DooMLoRD, @blueether @dbolivar
You guys have probably registred that Geohot (iPhone, PS3 jailbreaker) has successfully rooted the Galaxy S5 (and can now claim the $18,000 bounty), but i just read that this one-click root tool should work on any device running a pre-June 3rd kernel, i.e Android 4.4.2. The question is, does it work on the Ultra? I'm aware that it's easy to root an UItra AS LONG as the bootloader is unlocked, but this thing circumvents that part, and roots it. I think.
Are there anyone here still left on 4.4.2 that can try?
More here: Click
Click to expand...
Click to collapse
Can't say... Will have to test
Sent from my C6902 using XDA Free mobile app
DooMLoRD said:
Can't say... Will have to test
Sent from my C6902 using XDA Free mobile app
Click to expand...
Click to collapse
I made a thread here. It should work.
http://forum.xda-developers.com/showthread.php?t=2783982

[Q][SOLVED]Writing into ramdisk from init.rc

EDIT: The solution is in post #6.
Hi,
I'm trying to make a kernel modification which would create a file on boot before any partition is mounted. I wrote a simple shell script which tries to create a file in the root directory. The problem is I can't write any file to the / directory from a program or a script called by exec from init.rc. If I run dmesg, I can't find any indication of a problem there. I tried to modify the script to write to the /data directory on post-fs, and that worked, but that is not what I want.
I can't find out where the problem is. Do you have any ideas? Thanks.
simplified init.rc snippet:
Code:
on fs
# some work
exec /sbin/busybox sh /test.sh
# some other work
mount_all /fstab.grouper
# and another work
/test.sh
Code:
#!/sbin/busybox sh
echo "test" > /test
/ mounts as ro pretty early...
try to remount it rw before making files, or change the part of init.rc that mounts it ro.
frantisek.nesveda said:
Hi,
I'm trying to make a kernel modification which would create a file on boot before any partition is mounted. I wrote a simple shell script which tries to create a file in the root directory. The problem is I can't write any file to the / directory from a program or a script called by exec from init.rc. If I run dmesg, I can't find any indication of a problem there. I tried to modify the script to write to the /data directory on post-fs, and that worked, but that is not what I want.
I can't find out where the problem is. Do you have any ideas? Thanks.
simplified init.rc snippet:
Code:
on fs
# some work
exec /sbin/busybox sh /test.sh
# some other work
mount_all /fstab.grouper
# and another work
/test.sh
Code:
#!/sbin/busybox sh
echo "test" > /test
Click to expand...
Click to collapse
I am having the same problem, my script is not called. Did you find the solution?
Khaon said:
I am having the same problem, my script is not called. Did you find the solution?
Click to expand...
Click to collapse
Not yet. But recently I got back to the project where I would use it, so maybe I can take a look again and see if I am any wiser now. I'll try to solve it this evening or tomorrow, I'll be reinstalling my tablet so I'll have a good oportunity. I'll post the results here.
frantisek.nesveda said:
Not yet. But recently I got back to the project where I would use it, so maybe I can take a look again and see if I am any wiser now. I'll try to solve it this evening or tomorrow, I'll be reinstalling my tablet so I'll have a good oportunity. I'll post the results here.
Click to expand...
Click to collapse
That would be great, the only thing I could see is upon booting its permissions are read-only. And chmod 0777 doesn't change its permissions(rootfs is rw)
Khaon said:
That would be great, the only thing I could see is upon booting its permissions are read-only. And chmod 0777 doesn't change its permissions(rootfs is rw)
Click to expand...
Click to collapse
OK, I found the cause of the problem and the solution.
The implementation of the exec command in Android init scripts is missing from the init binary by default - the source looks like this:
Code:
int do_exec(int nargs, char **args)
{
return -1;
}
So there are two options - either write the do_exec function yourself, or use a trick to execute your programs.
Writing it yourself would be probably cleaner, but it would mean compiling the init binary again and not everyone wants to do that, so I'll be using the trick.
The trick is to register your program as a service and then invoke it via the start command.
Example init.rc:
Code:
# service invocation - where you need it
# warning - this will not wait for the finish of the program
start my_awesome_program
.
.
.
# service declaration - along with other declarations at the end of the file
service my_awesome_program /sbin/my_awesome_program
disabled
oneshot
If you want to implement the do_exec function and use the exec command, you can use for example CyanogenMod's implementation.
There may be a third option, but I haven't tested that - you can copy the init binary from a kernel which has the exec command working - I suppose all CM kernels should, but I haven't tried.
It's funny how when you already know the solution, you can find so much info, but when you don't, nothing comes up since you are searching wrong.
frantisek.nesveda said:
OK, I found the cause of the problem and the solution.
The implementation of the exec command in Android init scripts is missing from the init binary by default - the source looks like this:
Code:
int do_exec(int nargs, char **args)
{
return -1;
}
So there are two options - either write the do_exec function yourself, or use a trick to execute your programs.
Writing it yourself would be probably cleaner, but it would mean compiling the init binary again and not everyone wants to do that, so I'll be using the trick.
The trick is to register your program as a service and then invoke it via the start command.
Example init.rc:
Code:
# service invocation - where you need it
start my_awesome_program
.
.
.
# service declaration - along with other declarations at the end of the file
service my_awesome_program /sbin/my_awesome_program
disabled
oneshot
If you want to implement the do_exec function and use the exec command, you can use for example CyanogenMod's implementation.
There may be a third option, but I haven't tested that - you can copy the init binary from a kernel which has the exec command working - I suppose all CM kernels should, but I haven't tried.
It's funny how when you already know the solution, you can find so much info, but when you don't, nothing comes up since you are searching wrong.
Click to expand...
Click to collapse
Oh my, many thanks! So stupid exec always return ;D, wouldn't have thought one sec on checking the implementation of those functions.
Khaon said:
Oh my, many thanks! So stupid exec always return ;D, wouldn't have thought one sec on checking the implementation of those functions.
Click to expand...
Click to collapse
A small warning - starting the program as a service will not wait for the program finish, so its results will not be available immediately after the start call. I learnt this the hard way after a few hours of debugging just now.
I added this info to my previous post too.
frantisek.nesveda said:
A small warning - starting the program as a service will not wait for the program finish, so its results will not be available immediately after the start call. I learnt this the hard way after a few hours of debugging just now.
I added this info to my previous post too.
Click to expand...
Click to collapse
I always use
Code:
class core
user root
in addition to oneshot.
Haven't you com accross SElinux restrictions using busybox? Because I do I need to set permissions.
I have this issue

Categories

Resources