[DEV] netfilter for x8 - XPERIA X8 Original Android Development

Well, another module. A guy called me a module man
If we can compile this module we can (hopefully) have native usb/wifi tether on our phone.
Other benefits:
- Firewall apps
- Transparent proxies
- NAT
I'll start trying to make this work on our current kernel. Contribution is appreciated.
Github repo is here : https://github.com/doixanh/X8Features
PLEASE DON'T SPAM THIS DEV THREAD WITH UNCONTRIBUTED POSTS

Once again, great work!
Continue with the modules, you are solving many things extremely fast!
Big thank you from me for contributing to the X8 community!

All u need to do is implement the needed hooks missing from the stock kernel for iptables to attach on.
Sent from my GB MiniCM

Hello. If this module get worked, will be able the reverse usb tether(PC -> phone). I.e to have internet on my phone from the computer via USB.

Can someone explain what is this?

Great job! I use third-party programs, but is good to have native tether. One question. Will I need drivers for PC with native tether?

http://www.google.com/url?sa=t&sour...sg=AFQjCNGsYN4VLe4oQLOtuPksDb87g537lg&cad=rja
maybe it help

He3aBuCuM said:
Hello. If this module get worked, will be able the reverse usb tether(PC -> phone). I.e to have internet on my phone from the computer via USB.
Click to expand...
Click to collapse
no this would allow your phone to become a wifi hot spot, why would you need it the other way? if you have no wifi network you can download APK's to your computer and move to phone and install from your SD card
it would also allow you to use firewall apps to block all apps but the ones you want from connecting to your mobile internet to save you money.

So far, I managed to compile and insmod "netfilter.ko" with no error. But whenever I try to insmod iptable_filter.ko, I got a kernel crash.
The following modules has been insmoded - ordered to solve module dependencies.
insmod netfilter.ko
insmod x_tables.ko
insmod xt_tcpudp.ko
insmod nf_sockopt.ko
insmod ip_tables.ko
insmod ipt_addrtype.ko
insmod iptable_filter.ko <--- crashed here
Kernel crash message:
Code:
[ 466.135716] [<bf06b354>] (nf_register_hook+0x0/0x90 [netfilter]) from [<bf06b408>] (nf_register_hooks+0x24/0x64 [netfilter])
It seems the our nf_register_hook is not working.
Some logs:
Code:
[ 163.394843] nf_register_hook reg=BF059844
[ 163.395055] mutex locking
[ 163.395905] list for each entry pf=2, hooknum=1
<1>Unable to handle kernel NULL pointer dereference at virtual address 00000000

Could u share sources for those? Thanks.
Sent from my X10mini using XDA App

I'm at home now, I put all sources at work I changed lots of things to be able to compile it as module. Maybe I will need to upload whole /kernel/net/ipv4 and /kernel/net/netfilter branches.
I'll upload tomorrow.

It seems that the linked list is empty, that's why it couldn't initialize the list.
nobodyAtall: I've just created a github repo for X8Netfilter, I will push modifications soon.

doixanh said:
It seems that the linked list is empty, that's why it couldn't initialize the list.
nobodyAtall: I've just created a github repo for X8Netfilter, I will push modifications soon.
Click to expand...
Click to collapse
Thanks mate. I'll take a look and see if I can help.

Ok, everything pushed. Let's have fun with it my friend.
Repo is here : https://github.com/doixanh/X8Netfilter
The last time there were null pointers in linked lists because the initialization code (netfilter_init) was not executed. I forgot that now it's a module, so we have to declare module_init.
I added module_init into it. Insmoded fine now, but iptables tool still complains:
iptables v1.3.7: can't initialize iptables table `filter'
Click to expand...
Click to collapse
What are we missing?
/edit : post #200
/edit #2 : during xRecovery to switch to another ROM for testing, I bricked my lovely phone. There are lots of junk files in /system. Now I have to save my X8
/edit #3 : oh and I forgot that x10 mini has another offset for synchronize_rcu() - it should be 0xC0098F88. You have to modify it in netfilter.h

In the kernel config I didn't include xtables (required by iptable_filter) so maybe it's a problem.
I included, compiled, but still the same. I think the problem comes from the iptables userspace tool.
@nobodyAtall: can you modify and compile iptables.c (included in CM6/7 source). We need to know the reason that TC_INIT returns null. Before each "return NULL" you can put a printf so we can know why it's unable to load the table.
I cannot compile android iptables now (at work, the PC is really really slow).
I also pushed kernel config for my current kernel build, and a script to load the modules in order to solve dependencies.
Thanks.

doixanh said:
In the kernel config I didn't include xtables (required by iptable_filter) so maybe it's a problem.
I included, compiled, but still the same. I think the problem comes from the iptables userspace tool.
@nobodyAtall: can you modify and compile iptables.c (included in CM6/7 source). We need to know the reason that TC_INIT returns null. Before each "return NULL" you can put a printf so we can know why it's unable to load the table.
I cannot compile android iptables now (at work, the PC is really really slow).
I also pushed kernel config for my current kernel build, and a script to load the modules in order to solve dependencies.
Thanks.
Click to expand...
Click to collapse
I'm getting undefined references when building the kernel with your github files / .config file. Specifically:
kernel/include/linux/netfilter.h:193: undefined reference to `nf_hook_slow'
kernel/net/ipv4/ip_input.c:270: undefined reference to `nf_hooks'
kernel/net/ipv4/ip_input.c:270: undefined reference to `nf_hooks'
and many more.

Strange, I don't have any problem at all. I compiled those modules with
Code:
ARCH=arm CROSS_COMPILE=arm-eabi- make modules
oh and btw, I compiled with this kernel from SE: x10_x10mini_x10minipro_x8_eclair_2.1.A.0.390.tar.gz

doixanh said:
Strange, I don't have any problem at all. I compiled those modules with
Code:
ARCH=arm CROSS_COMPILE=arm-eabi- make modules
oh and btw, I compiled with this kernel from SE: x10_x10mini_x10minipro_x8_eclair_2.1.A.0.390.tar.gz
Click to expand...
Click to collapse
Ok, it wont make the kernel image but makes the modules.
Here's what's loaded:
Code:
localhost netfilter # ls
arp_tables.ko nfnetlink.ko xt_hashlimit.ko xt_realm.ko
ip_tables.ko nfnetlink_log.ko xt_iprange.ko xt_recent.ko
ipt_LOG.ko x_tables.ko xt_length.ko xt_sctp.ko
ipt_ULOG.ko xt_CLASSIFY.ko xt_limit.ko xt_statistic.ko
ipt_addrtype.ko xt_NFLOG.ko xt_mac.ko xt_string.ko
ipt_ah.ko xt_NFQUEUE.ko xt_multiport.ko xt_tcpudp.ko
iptable_filter.ko xt_TCPOPTSTRIP.ko xt_owner.ko xt_time.ko
iptable_mangle.ko xt_TRACE.ko xt_pkttype.ko xt_u32.ko
iptable_raw.ko xt_comment.ko xt_policy.ko
netfilter.ko xt_esp.ko xt_quota.ko
localhost netfilter # sh /sdcard/insmodnet
[B]insmod: init_module 'xt_NFLOG.ko' failed (No such file or directory)
insmod: init_module 'xt_string.ko' failed (No such file or directory)[/B]
localhost netfilter # lsmod
iptable_filter 2700 0 - Live 0xbf1e7000
ipt_addrtype 2388 0 - Live 0xbf1e1000
ip_tables 11264 1 iptable_filter, Live 0xbf1d9000
xt_u32 2036 0 - Live 0xbf1d3000
xt_time 2880 0 - Live 0xbf1cd000
xt_tcpudp 3016 0 - Live 0xbf1c7000
xt_statistic 1844 0 - Live 0xbf1bb000
xt_sctp 2672 0 - Live 0xbf1b5000
xt_recent 9308 0 - Live 0xbf1ad000
xt_realm 1492 0 - Live 0xbf1a7000
xt_quota 1752 0 - Live 0xbf1a1000
xt_policy 3120 0 - Live 0xbf19b000
xt_pkttype 1596 0 - Live 0xbf195000
xt_owner 2668 0 - Live 0xbf18f000
xt_multiport 3160 0 - Live 0xbf189000
xt_mac 1576 0 - Live 0xbf183000
xt_limit 2224 0 - Live 0xbf17d000
xt_length 1760 0 - Live 0xbf177000
xt_iprange 2640 0 - Live 0xbf171000
xt_hashlimit 9964 0 - Live 0xbf169000
xt_esp 1852 0 - Live 0xbf163000
xt_comment 1492 0 - Live 0xbf15d000
xt_TRACE 1484 0 - Live 0xbf157000
xt_TCPOPTSTRIP 1956 0 - Live 0xbf151000
xt_NFQUEUE 1716 0 - Live 0xbf070000
xt_CLASSIFY 1536 0 - Live 0xbf023000
x_tables 14212 25 ipt_addrtype,ip_tables,xt_u32,xt_time,xt_tcpudp,xt_statistic,xt_sctp,xt_recent,xt_realm,xt_quota,xt_policy,xt_pkttype,xt_owner,xt_multiport,xt_mac,xt_limit,xt_length,xt_iprange,xt_hashlimit,xt_esp,xt_comment,xt_TRACE,xt_TCPOPTSTRIP,xt_NFQUEUE,xt_CLASSIFY, Live 0xbf148000
netfilter 13564 3 iptable_filter,ip_tables,xt_TCPOPTSTRIP,[permanent], Live 0xbf142000
tiwlan_drv 838420 0 - Live 0xbf073000
ext3 110952 1 - Live 0xbf052000
jbd 49480 1 ext3, Live 0xbf040000
x8oc 6664 0 - Live 0xbf039000
synaptics_i2c_rmi4 11068 0 - Live 0xbf034000
twofish 9308 0 - Live 0xbf02c000
twofish_common 15740 1 twofish, Live 0xbf026000
dm_crypt 13052 0 - Live 0xbf01d000
dm_mod 53216 1 dm_crypt, Live 0xbf00b000
sdio 20724 1 tiwlan_drv, Live 0xbf000000
Do we need all there modules?
xt_NFLOG fails with:
xt_NFLOG: Unknown symbol nfulnl_log_packet
xt_string fails with:
xt_string: Unknown symbol textsearch_destroy
xt_string: Unknown symbol textsearch_prepare

I'm not sure, but I tried to compile and load all those modules to make it work first.
iptables tool still gives out error with
iptables -L

doixanh said:
I'm not sure, but I tried to compile and load all those modules to make it work first.
iptables tool still gives out error with
iptables -L
Click to expand...
Click to collapse
The actual error is:
iptables v1.4.7: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Which is quite *disturbing*
The actual error reported from kernel space is ENOENT (see file libiptc.c in CM sources).

Related

[Q] xpad.ko

hello, i got the cifs module to work, but when i try to add the xpad.ko in the terminal it says read only. then when i do insmod it says can not find directory. i placed the xpad.ko where i placed the cifs.ko . the cifs works fine. i have cm7 with pershots 2.6.32.41 kernel. everything is placed in /system/lib/modules/2.6.32.41-cyanogenmod/.... what am i doing wrong ??
It would help if you gave us the exact command you used and the exact error message you got back.
this is what i did. placed xpad.ko in /system/lib/modules/2.6.32.41-cyanogenmod/ , then in terminal chmod 644 /system/lib/modules/2.6.32.41-cyanogenmod/xpad.ko , terminal replys chmod 644 /system/lib/modules/2.6.32.41-cyanogenmod/xpad.ko: Read-only file system ... then in terminal insmod /system/lib/modules/2.6.32.41-cyanogenmod/xpad.ko , reply from terminal, insmod: init_module '/system/lib/modules/2.6.32,41-cyanogenmod/xpad.ko' failed (no such file or directory) ....i followed pershots directions from droid basement. i had no problems installing the cifs module, that works fine.
Save yourself a lot of trouble:
Don't copy the xpad.ko file (or any other kernel module file for that matter) into /system--just leave it on the SD card.
You can also skip the chmod command. Since the insmod command needs to be run as superuser, permissions for the kernel module files don't matter.
All you have to do is specify the correct path to the .ko file when giving the insmod command which you must run as root--loading modules into a running kernel is a privileged operation, and normal users cannot do it.
Assuming your xpad.ko file is in /mnt/sdcard/tmp/, do:
Code:
$ su [I]# become superuser[/I]
# insmod /mnt/sdcard/tmp/xpad.ko
thank you for your help... tried doing it like you wrote , but it keeps telling me no such file or directory . i don't get it , why does it work for the cifs module and not the xpad module ?? if i can set up the cifs correctly, i should be able to do the xpad , it's all the same commands you just add in the module ko. , right? thanks for your time.. tired of messing with trying to get a game pad to work. i give up on this . at least i got the cifs to work..... thanks
The xpad.ko module needs another module to be loaded first, before it can be loaded. Otherwise you get this error:
Code:
$ su
# insmod /mnt/sdcard/tmp/xpad.ko
insmod: can't insert 'xpad.ko': unknown symbol in module or invalid parameter
I ran modinfo (on a Linux machine) on the xpad.ko file and it told me that xpad.ko depends on a ff-memless module. So load that module first (this module is also available in lib-2632.41_gb.tar.gz):
Code:
$ su
# insmod /mnt/sdcard/tmp/ff-memless.ko
# insmod /mnt/sdcard/tmp/xpad.ko
# dmesg | tail -n5
[79594.956918] CPU1 attaching NULL sched-domain.
[79595.074521] CPU0 attaching NULL sched-domain.
[79595.075957] CPU1: clean shutdown
[79608.912964] usbcore: registered new interface driver xpad
[79608.918576] xpad: X-Box pad driver
Looks like the drivers loaded successfully.
thank you, thank you, thank you, that worked....this is a really easy way to load in the modules , so much faster... just have to set up gscript lite now to do the work for me. thank you so much for your time ... thanks
Forgive my ignorance but in Pershoot's kernel would that xpad.ko file have to be compiled for the Android flavor you have? For instance on his blog he has both the Froyo and GB kernels, but I have seen his latest kernel on a few Honeycomb roms. Just wondering because I've tried to load the xpad.ko file in terminal with admin rights on a few and can't get them to work. Again, forgive my ignorance I'm trying to learn. Feel free to smack me about.
sixvoltsystem said:
Just wondering because I've tried to load the xpad.ko file in terminal with admin rights on a few and can't get them to work.
Click to expand...
Click to collapse
Did you load the ff-memless.ko module before loading xpad.ko as per post #6 in this thread?
rajeevvp said:
Did you load the ff-memless.ko module before loading xpad.ko as per post #6 in this thread?
Click to expand...
Click to collapse
Yes sir. Running Flashback Alpha 5.4 Rom. I can't get either one to run. My ff-memless.ko module is located in:
/system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/ff-memless.ko
My Xpad.ko file is located in:
/system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/joystick/xpad.ko
I get this:
Permission Denied even though I have "Needs SU" checked in Gscript
Thank you for the help I'm a bit of an idiot so I appreciate the look see
sixvoltsystem said:
I get this:
Permission Denied even though I have "Needs SU" checked in Gscript
Click to expand...
Click to collapse
Send me the output of these commands. Open the Terminal app on the gTablet and then type:
Code:
gTablet$ [B]su[/B]
gTablet# [B]find / -name ff-memless*[/B]
gTablet# [B]find / -name xpad.ko[/B]
EDIT: Just ran these exact commands in the terminal and the modules appear to have loaded just fine on my gTab (I'm running GtabComb beta 3.1):
Code:
gTablet$ [B]su[/B]
gTablet# [B]insmod /system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/ff-memless.ko[/B]
gTablet# [B]insmod /system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/joystick/xpad.ko[/B]
gTablet# [B]dmesg | tail -n 5[/B]
[ 1073.826181] CPU1 attaching NULL sched-domain.
[ 1073.942055] CPU0 attaching NULL sched-domain.
[ 1073.945705] CPU1: clean shutdown
[ 1283.649241] usbcore: registered new interface driver xpad
[ 1283.654886] xpad: X-Box pad driver
/system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/ff-memless.ko
Then if I try running it in terminal it says failed ( File exists )
both the ff-memless.ko & xpad.ko files are located in the same place yours are. Should I format and start over? Odd
By the way much appreciated for the help
sixvoltsystem said:
Then if I try running it in terminal it says failed ( File exists )
Click to expand...
Click to collapse
That means that the modules are already loaded. Check using the dmesg command I gave previously, and also check using lsmod like this:
Code:
gTablet$ [B]su[/B]
gTablet# [B]lsmod[/B]
Module Size Used by Tainted: G
xpad 8315 0
ff_memless 4200 1 xpad
dhd 201288 0
tun 10899 0
nls_utf8 1143 0
ntfs 207149 0
cifs 235684 0
As you can see, both xpad.ko and ff_memless.ko are loaded and xpad.ko is using ff_memless.ko as it should. You should be good to go at this point.
rajeevvp said:
That means that the modules are already loaded. Check using the dmesg command I gave previously, and also check using lsmod like this:
Code:
gTablet$ [B]su[/B]
gTablet# [B]lsmod[/B]
Module Size Used by Tainted: G
xpad 8315 0
ff_memless 4200 1 xpad
dhd 201288 0
tun 10899 0
nls_utf8 1143 0
ntfs 207149 0
cifs 235684 0
As you can see, both xpad.ko and ff_memless.ko are loaded and xpad.ko is using ff_memless.ko as it should. You should be good to go at this point.
Click to expand...
Click to collapse
dmesg command gave this:
nvrm_notifier_show: blocking
CPU0 attaching NULL sched-domain.
CPU1 attaching NULL sched-domain.
CPU0 attaching NULL sched-domain.
CPU1: clean shutdown
lsmod command shows:
xpad 8315 0 - Live 0xbf043000
ff_memless 4200 1 xpad, Live oxbf03c000
dhd 201288 0 - Live 0xbf000000
You sir are awesome for helping me, it works! Wired Xbox 360 controller is working perfectly!! I thanked you in every post here.
sixvoltsystem said:
dmesg command gave this:
nvrm_notifier_show: blocking
CPU0 attaching NULL sched-domain.
CPU1 attaching NULL sched-domain.
CPU0 attaching NULL sched-domain.
CPU1: clean shutdown
Click to expand...
Click to collapse
You were too late with that dmesg command. It should've been executed right after the insmod stuff. Or, just plain dmesg without the tail and then look through its output.
Wired Xbox 360 controller is working perfectly!! I thanked you in every post here.
Click to expand...
Click to collapse
Oh, boy! And I don't even own an Xbox. Of any variety.
Really, you should be thanking the guy(s) who wrote the code.
rajeevvp said:
You were too late with that dmesg command. It should've been executed right after the insmod stuff. Or, just plain dmesg without the tail and then look through its output.
Oh, boy! And I don't even own an Xbox. Of any variety.
Really, you should be thanking the guy(s) who wrote the code.
Click to expand...
Click to collapse
No problem, I will thank them. Thank you for helping me understand it a bit more. You were very helpful and patient. We have an xbox, but it is my son's, I'd rather play some Atari or 8-bit Nintendo....which is what I'll do now that this works
Hello all of you, maybe anyone can help with this...
Im trying to use a generic usb gamepad with the gtab but only work the buttons and not the direction pad. Anyone have any idea? I dont have any wired xbox controller...
Thanks a lot!
first off, a million thank yous to rajeevp and everyone else on this thread. I'm not all that knowledgeable with this stuff but after coming across these posts I was able to install xpad.ko, using terminal emulator that I got of the android market and now I can use the xbox wireless gaming adapter and xbox360 wireless controller on my rooted gtablet. I'm using gtabcomb 3.3 bootloader 1.1 and I play nest, snes, n64, Sega roms and emulators that I got free from 4shared.com,. I was cracking my head trying to get the 360 controller to work with the usb adapter and now it all works. The thank god I found this thread!! You hackers and developers out there are awesome!!!
after the drivers loaded. Whats next
rajeevvp said:
The xpad.ko module needs another module to be loaded first, before it can be loaded. Otherwise you get this error:
Code:
$ su
# insmod /mnt/sdcard/tmp/xpad.ko
insmod: can't insert 'xpad.ko': unknown symbol in module or invalid parameter
I ran modinfo (on a Linux machine) on the xpad.ko file and it told me that xpad.ko depends on a ff-memless module. So load that module first (this module is also available in lib-2632.41_gb.tar.gz):
Code:
$ su
# insmod /mnt/sdcard/tmp/ff-memless.ko
# insmod /mnt/sdcard/tmp/xpad.ko
# dmesg | tail -n5
[79594.956918] CPU1 attaching NULL sched-domain.
[79595.074521] CPU0 attaching NULL sched-domain.
[79595.075957] CPU1: clean shutdown
[79608.912964] usbcore: registered new interface driver xpad
[79608.918576] xpad: X-Box pad driver
Looks like the drivers loaded successfully.
Click to expand...
Click to collapse
So what would the next step be after the ff-memless.ko and xpad.ko drivers have been installed????

[Q] Can any kernel developer help me?

I am trying to compile and insert the CFG80211.ko module
I have built an Ubuntu VM and installed the correct codesourcery cross compiler.
I have been able to build several modules which successfully insert. (ntfs, lib80211, all three lib80211_crypt modules, all three wusb modules, uwb, veth etc etc)
however the cfg80211.ko module always fails with invalid argument.
dmesg reports :-
Code:
[140146.246732] cfg80211: disagrees about version of symbol wireless_send_event
[140146.246751] cfg80211: Unknown symbol wireless_send_event (err -22)
cfg80211 depends on rfkill which is, as far as I cant tell, precompiled into the phone kernel.
the relevant section of the config file is as follows:-
Code:
#
# Bluetooth device drivers
#
# CONFIG_BT_HCIBTUSB is not set
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_BCSP is not set
# CONFIG_BT_HCIUART_LL is not set
# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIVHCI is not set
# CONFIG_BT_MRVL is not set
CONFIG_BT_HID=m
# CONFIG_AF_RXRPC is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_WIRELESS_COMPAT=m
CONFIG_CFG80211=m
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
# CONFIG_CFG80211_DEFAULT_PS is not set
# CONFIG_CFG80211_DEBUGFS is not set
# CONFIG_CFG80211_INTERNAL_REGDB is not set
CONFIG_CFG80211_WEXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set
CONFIG_LIB80211=m
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=m
CONFIG_MAC80211_HAS_RC=y
# CONFIG_MAC80211_RC_PID is not set
CONFIG_MAC80211_RC_MINSTREL=y
# CONFIG_MAC80211_RC_DEFAULT_PID is not set
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel"
# CONFIG_MAC80211_MESH is not set
# CONFIG_MAC80211_LEDS is not set
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_PM=y
# CONFIG_RFKILL_INPUT is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
#
# Device Drivers
#
Full .config file attached below.
I have tried converting RFKILL to a module, in order to enable CONFIG_RFKILL_INPUT to yes but the compile completely fails when this is set.
I have added WIRELESS_COMPAT details in the Kconfig file but this did not help and I am now lost as to how to troubleshoot this?
Anyone have any idea on what might be missing?
If you're able to compile the modules, you should be able to compile the kernel - do the modules insmod against the compiled kernel?
Entropy512 said:
If you're able to compile the modules, you should be able to compile the kernel - do the modules insmod against the compiled kernel?
Click to expand...
Click to collapse
Yes all the other modules I mentioned all insert fine the ones that I have compiled that dont insert have dependancies that all stem back to the cfg80211.ko that is giving me the messages in the first post.
from the documentation cfg80211 is dependant on RFKILL which is precompiled into the kernel.
Entropy512 said:
If you're able to compile the modules, you should be able to compile the kernel - do the modules insmod against the compiled kernel?
Click to expand...
Click to collapse
Ahhh rereading your post, I see what you mean, I haven't installed the built kernel (though I did do the full build) on the phone, not entirely sure how to package it and I haven't tried to look because I really dont want to install a full kernel on the phone.
In any case I have used the default samsung config to build from fro the correct kernel.
curioct said:
I am trying to compile and insert the CFG80211.ko module
I have built an Ubuntu VM and installed the correct codesourcery cross compiler.
I have been able to build several modules which successfully insert. (ntfs, lib80211, all three lib80211_crypt modules, all three wusb modules, uwb, veth etc etc)
however the cfg80211.ko module always fails with invalid argument.
dmesg reports :-
Code:
[140146.246732] cfg80211: disagrees about version of symbol wireless_send_event
[140146.246751] cfg80211: Unknown symbol wireless_send_event (err -22)
cfg80211 depends on rfkill which is, as far as I cant tell, precompiled into the phone kernel.
the relevant section of the config file is as follows:-
Code:
#
# Bluetooth device drivers
#
# CONFIG_BT_HCIBTUSB is not set
# CONFIG_BT_HCIBTSDIO is not set
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
# CONFIG_BT_HCIUART_BCSP is not set
# CONFIG_BT_HCIUART_LL is not set
# CONFIG_BT_HCIBCM203X is not set
# CONFIG_BT_HCIBPA10X is not set
# CONFIG_BT_HCIBFUSB is not set
# CONFIG_BT_HCIVHCI is not set
# CONFIG_BT_MRVL is not set
CONFIG_BT_HID=m
# CONFIG_AF_RXRPC is not set
CONFIG_FIB_RULES=y
CONFIG_WIRELESS=y
CONFIG_WIRELESS_EXT=y
CONFIG_WEXT_CORE=y
CONFIG_WEXT_PROC=y
CONFIG_WEXT_SPY=y
CONFIG_WEXT_PRIV=y
CONFIG_WIRELESS_COMPAT=m
CONFIG_CFG80211=m
# CONFIG_NL80211_TESTMODE is not set
# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
# CONFIG_CFG80211_REG_DEBUG is not set
# CONFIG_CFG80211_DEFAULT_PS is not set
# CONFIG_CFG80211_DEBUGFS is not set
# CONFIG_CFG80211_INTERNAL_REGDB is not set
CONFIG_CFG80211_WEXT=y
# CONFIG_WIRELESS_EXT_SYSFS is not set
CONFIG_LIB80211=m
CONFIG_LIB80211_CRYPT_WEP=m
CONFIG_LIB80211_CRYPT_CCMP=m
CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG is not set
CONFIG_MAC80211=m
CONFIG_MAC80211_HAS_RC=y
# CONFIG_MAC80211_RC_PID is not set
CONFIG_MAC80211_RC_MINSTREL=y
# CONFIG_MAC80211_RC_DEFAULT_PID is not set
CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
CONFIG_MAC80211_RC_DEFAULT="minstrel"
# CONFIG_MAC80211_MESH is not set
# CONFIG_MAC80211_LEDS is not set
# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
CONFIG_RFKILL_PM=y
# CONFIG_RFKILL_INPUT is not set
# CONFIG_NET_9P is not set
# CONFIG_CAIF is not set
#
# Device Drivers
#
Full .config file attached below.
I have tried converting RFKILL to a module, in order to enable CONFIG_RFKILL_INPUT to yes but the compile completely fails when this is set.
I have added WIRELESS_COMPAT details in the Kconfig file but this did not help and I am now lost as to how to troubleshoot this?
Anyone have any idea on what might be missing?
Click to expand...
Click to collapse
Are you installing the kernel and modules, or just the modules? If you are just installing the modules, are you using an IDENTICAL version of gcc, with nothing changed between N<=>M<=>Y except for your rt2x00 module in the .config?
useful information would be:
Your kernel version string from the phone: uname -a
A diff of the base .config and the new .config: diff -ubw orig.config new.config
A diff of the phone's working .config and your .config.
You can generally get the .config your running kernel was compiled with from /proc/config.gz on the device. You would then need to gunzip that and compare it to your .config with the diff command above.
s0be said:
Are you installing the kernel and modules, or just the modules? If you are just installing the modules, are you using an IDENTICAL version of gcc, with nothing changed between N<=>M<=>Y except for your rt2x00 module in the .config?
useful information would be:
Your kernel version string from the phone: uname -a
A diff of the base .config and the new .config: diff -ubw orig.config new.config
A diff of the phone's working .config and your .config.
You can generally get the .config your running kernel was compiled with from /proc/config.gz on the device. You would then need to gunzip that and compare it to your .config with the diff command above.
Click to expand...
Click to collapse
Unfortunately /proc/config.gz support is not configured in the samsung kernel by default therefore the file is not present. uname gives 2.6.35.7-I9100XXKH3-CL479037
And I have tried the recommended codesourcery cross compiler and one other variant of this and the results are the same.
it's a stock rom with an insecure kernel (basically a repack of the stock kernel) to allow rooting from what I can gather.
I have tried many configuration of build from the default .config and just building the top dependancy module from the default config
In this case the top of the tree is CFG80211
(rt2x00usb depends on rt2x00lib, depends upon mac80211, mac8211 depends upon cfg80211 and cfg80211 depends upon rfkill. There are also some dependencies on kernel crypto libraries which I am unclear about but should be in the kernel build)
I have found it makes no difference at all if I build lots of modules at once or just the very bare CFG80211.ko with as few options as possible. The failures are the same trying to insert cfg80211.ko. as it is whether I use busybox insmod, standard insmod or insmod from within a chroot. (in the searches I read modules can behave differently with busybox)
the only changes I made from the samsung default config is switching some debugging options off as per this thread http://forum.xda-developers.com/showthread.php?t=1123643
other than that it is a stock samsung default config for a 2.6.25.7 kernel build, as distributed in the samsung source code.
I haven't had the nerve to install the fully built kernel because the phone is a key tool for me reflashing a kernel is kind of a last resort
The attached rar file includes the default config (c1_rev02_premium_defconfig) the config used (.config) the output of diff -uwb between the two (differences.txt) and the two modules built ntfs.ko and cfg80211.ko.
file reveal ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped on both modules. (done chroot)
I use ntfs.ko as a control since it's a small module and in this build it inserts just fine. cfg80211.ko fails with the same message and dmesg info mentioned in the first post.
As I previously mentioned I did try modifying the RFKILL sections to be built as a module but when this is attempt the kernel build fails completely with the error:-
Code:
ERROR: "s3c_gpio_slp_cfgpin" [arch/arm/mach-s5pv310/c1-rfkill.ko] undefined!
ERROR: "s3c_gpio_slp_setpull_updown" [arch/arm/mach-s5pv310/c1-rfkill.ko] undefined!
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
Thanks for looking at this for me
Do you have a link to your kernel tree? I'd suspect that CFG80211_WEXT being enabled makes some changes in the WEXT functions that get compiled in kernel. With CONFIG_WEXT_* being =Y, your enableing CFG80211_WEXT probably made things not agree. Also, I believe the rt2x00 driver is a mac80211 one, so you'll likely need that too.
In summary, you'll very likely have to use your own kernel to get this going. At least loading the ntfs.ko answers that it's not a toolchain/source tree issue.
curioct said:
I use ntfs.ko as a control since it's a small module and in this build it inserts just fine. cfg80211.ko fails with the same message and dmesg info mentioned in the first post.
As I previously mentioned I did try modifying the RFKILL sections to be built as a module but when this is attempt the kernel build fails completely with the error:-
Code:
ERROR: "s3c_gpio_slp_cfgpin" [arch/arm/mach-s5pv310/c1-rfkill.ko] undefined!
ERROR: "s3c_gpio_slp_setpull_updown" [arch/arm/mach-s5pv310/c1-rfkill.ko] undefined!
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
Click to expand...
Click to collapse
This error is due to another missing dependency (and the lack of proper dependency definitions in KCONFIG). You need to do:
egrep "s3c_gpio_slp_" -rsn
to find where those functions are defined, and find out why they're not being compiled. It's quite likely something like enabling rfkill for your arch/tree pulled in that c1-rfkill file (is your board a c1?) which is either not for your actual device, or dependent on something else being enabled. This is wholly based on previous experience with HTC kernel trees, where files from other Boards seemed to tag along.
I have no samsung hardware (although the GSII is on the list of what I'm considering ;-) )
s0be said:
Do you have a link to your kernel tree? I'd suspect that CFG80211_WEXT being enabled makes some changes in the WEXT functions that get compiled in kernel. With CONFIG_WEXT_* being =Y, your enableing CFG80211_WEXT probably made things not agree. Also, I believe the rt2x00 driver is a mac80211 one, so you'll likely need that too.
In summary, you'll very likely have to use your own kernel to get this going. At least loading the ntfs.ko answers that it's not a toolchain/source tree issue.
Click to expand...
Click to collapse
I am aware I'll need other modules but they all come back to dependancy on CFG80211 so I am concentrating my efforts around that.
The link to the kernel tree is
git://opensource.samsung.com/p_497
but I have also used :-
https://github.com/GalaxySII/samsung-kernel-galaxysii
with the exact same results.
The config_wext elements are listed under the bluetooth elements, but I am firstly concerned that disabling these elements with adversely effect the standard wifi comms. which would not be acceptable even if I could package and install a fully kernel build. (which I can probably do enough research, on this site, to work out eventually, although I admit to some trepidation about this).
curioct said:
I am aware I'll need other modules but they all come back to dependancy on CFG80211 so I am concentrating my efforts around that.
The link to the kernel tree is
git://opensource.samsung.com/p_497
but I have also used :-
https://github.com/GalaxySII/samsung-kernel-galaxysii
with the exact same results.
The config_wext elements are listed under the bluetooth elements, but I am firstly concerned that disabling these elements with adversely effect the standard wifi comms. which would not be acceptable even if I could package and install a fully kernel build. (which I can probably do enough research, on this site, to work out eventually, although I admit to some trepidation about this).
Click to expand...
Click to collapse
Ok, per:
https://github.com/GalaxySII/samsun...gt-i9100-gingerbread/net/wireless/wext-core.c
Lines: 434, 548, and 613, 653
Your kernel will have to be replaced to have cfg80211, mac80211, and rt2x00 working. There is no way around this, as that code is compiled into the kernel, and cfg80211 and mac80211 depend on those function doing more than your kernel does. There's no way around it. That's only analyzing the wext-core... there may be other differences.
s0be said:
Ok, per:
https://github.com/GalaxySII/samsun...gt-i9100-gingerbread/net/wireless/wext-core.c
Lines: 434, 548, and 613, 653
Your kernel will have to be replaced to have cfg80211, mac80211, and rt2x00 working. There is no way around this, as that code is compiled into the kernel, and cfg80211 and mac80211 depend on those function doing more than your kernel does. There's no way around it. That's only analyzing the wext-core... there may be other differences.
Click to expand...
Click to collapse
thanks for a definitive answer
I guess I need to go away and learn about kernel packaging and the bootloader stuff cant afford to brick my phone regularly trying this stuff and must keep CWM alive
Thanks for your help

I need help about bnep.ko module

I just migrated to android land and I have very limited linux experience.
I need bluetooth PAN for a reason but AFAIK, including stock,none of kernels support it but CM kernels.
After spending some hours, I finally built a bnep.ko module for my sgs2
insmod worked fine
# lsmod
lsmod
bnep 10272 0 - Live 0xbf014000
j4fs 65002 1 - Live 0xbf018000 (P)
Si4709_driver 17347 0 - Live 0xbf00d000
bthid 3432 0 - Live 0xbf007000
vibrator 6724 2 - Live 0xbf000000
Click to expand...
Click to collapse
I tried to connect to SGS2's BT PAN from a Win7pc but PC can't find any BT PAN device
# ndc pan start
ndc pan start
400 Pan operation failed (No such device)
Click to expand...
Click to collapse
What (or where) am I doing wrong?
Compiled module for 2.6.35.7 kernel is attached

Galaxy S2 Compile a Kernel Module

I'm having an issue insmoding a kernel I built for my rooted galaxy s2. My end game is to get USB-ethernet working by building the asix module but I cant even get a ko from the default build to insmod.
I compiled a kernel based on what I downloaded from samsungs website "GT-I9100_OpenSource_Update3.zip" and followed the instructions included (basically run make with defconfig) I chose scsi_wait_scan.ko as a test because it was built with the default config and currently wasn't loaded on my phone.
Here's some info that's pertinent. Any help would be appreciated. I'm running Ubuntu 11.
# lsmod
lsmod
dhd 242604 0 - Live 0xbf02e000
j4fs 65002 1 - Live 0xbf018000 (P)
Si4709_driver 17347 0 - Live 0xbf00d000
bthid 3384 0 - Live 0xbf007000
vibrator 6724 2 - Live 0xbf000000
# insmod scsi_wait_scan.ko
insmod scsi_wait_scan.ko
insmod: init_module 'scsi_wait_scan.ko' failed (Exec format error)
# dmesg
...
<4>[19668.986907] scsi_wait_scan: disagrees about version of symbol module_layout
# modinfo scsi_wait_scan.ko
modinfo scsi_wait_scan.ko
modinfo: can't open '/2.6.35.7-I9100XWKI4-CL575468/': No such file or directory
# pwd
/mnt/sdcard
# ls -l
...
-rwxrwxr-x system sdcard_rw 32484 2012-01-12 10:21 scsi_wait_scan.ko
$ file scsi_wait_scan.ko
scsi_wait_scan.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
Solved:
I actually got this working after I met another developer through work. You need a ramdisk to compile into the kernel.
I can't post links yet but you can search for the thread on the google forms by googling: 'Tal Alon kernel' and it should give you a pretty good description of what to do.
unpack a boot.img from a backup with unpack-bootimg.pl and uncpio the bootdisk.
The geist of what i learned is that there is a line in the .config file that should read CONFIG_INITRAMFS_SOURCE="/path/to/bootimg/boot.img-ramdisk"
After you build the kernel, copy your .ko's to the ram disk folder in boot.img-ramdisk/system/lib/modules
compile the kernel again then tar the zImage and load with odin.
njdevi11 said:
I actually got this working after I met another developer through work. You need a ramdisk to compile into the kernel.
I can't post links yet but you can search for the thread on the google forms by googling: 'Tal Alon kernel' and it should give you a pretty good description of what to do.
unpack a boot.img from a backup with unpack-bootimg.pl and uncpio the bootdisk.
The geist of what i learned is that there is a line in the .config file that should read CONFIG_INITRAMFS_SOURCE="/path/to/bootimg/boot.img-ramdisk"
After you build the kernel, copy your .ko's to the ram disk folder in boot.img-ramdisk/system/lib/modules
compile the kernel again then tar the zImage and load with odin.
Click to expand...
Click to collapse
Hi, did you get your asix.ko to work? I'm trying the same thing, got the module to compile and load, even eth0 showed up but now I'm stuck. I'm unable to get any communication going, i get "invalid rx length" errors in dmesg for the eth0 interface.
Thanks

[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

Categories

Resources