[DEV] GOVERNORS: Interactivex, PegasusQ and others on XBSA ICS SU760 ported - LG Optimus 3D

Hello all dear xda friends.
I just compiled governors modules and i faced most of the common issue you can face building governors modules:
- version number not matching and unknown symbols, the most common is nr_running after doing:
Code:
dmesg | grep nameofmodule
- insmod addressed to a internal memory address with the command
Code:
insmod /system/lib/modules/cpufreq_interactive.ko nr_running_addr=0xXXXXXXX`grep nr_running /proc/kallsyms|cut -c1-8`
- edited the Module.symvers with the memory address and the governor file
- tried to add Export command to /kernel/sched.c
- added into the cpufreq_governor.o the whole script defining memory address
I did reasearches (the whole day, now i'm bearded on front of pc :laugh and all the method i found on the internet resource not resolved, with every method i found, i obtain the same error from dmesg:
- Unknown symbol nr_running (err 0)
This is the pack of modules compiled with the right kernel version to fit with ICS ported to P920 (3.0.21) http://www.mediafire.com/download.php?9o02xd5t8mbb7dk
These are the not compiled files: http://www.mediafire.com/?1qldd5049004snc
I hope we can soon add new governors to our rom , with the help of other, i just added in my MOD post the ondemand x which drain few battery but it's not so performant
I hope too this thread could became with the time a collections and behaviour description of compiled governors compatible with our rom

Hi! I tried to compile seperate modules that use the nr_running function too but yeah, got the nr_running undefined error when trying to load it...so I am wondering whether you solved the problem?

Ryuinferno said:
Hi! I tried to compile seperate modules that use the nr_running function too but yeah, got the nr_running undefined error when trying to load it...so I am wondering whether you solved the problem?
Click to expand...
Click to collapse
nr_running if i can't remember good is a symlink issue.
Anyway i suggest to use another version of the governor because sometimes it's hard to find right symlinks.
I had that problem with lot of governors, but samno make the most compatible, just compile it from his sources, the link is in his thread.

Well, I tried to compile by using his sources but still getting the unknown symbol error...here's what I tried so far:
1. Recompile the kernel by adding EXPORT_SYMBOL(nr_running) in the end of sched.c, since my Makefile refers to my kernel directory when compiling, it does not show "nr_running undefined" errors anymore in console, but fails when in phone...
2. Adding the address of nr_running by referring to "grep nr_running /proc/kallsyms" into a Module.symvers file in my module directory, it gets read and replaced after compiling (no more undefined errors too), however, it still fails to load in the device...
I am kinda out of ideas, do you mind sharing what you did to make it work in the end?
EDIT: Nevermind, hardcording the address of nr_running solved the problem...

Ryuinferno said:
Well, I tried to compile by using his sources but still getting the unknown symbol error...here's what I tried so far:
1. Recompile the kernel by adding EXPORT_SYMBOL(nr_running) in the end of sched.c, since my Makefile refers to my kernel directory when compiling, it does not show "nr_running undefined" errors anymore in console, but fails when in phone...
2. Adding the address of nr_running by referring to "grep nr_running /proc/kallsyms" into a Module.symvers file in my module directory, it gets read and replaced after compiling (no more undefined errors too), however, it still fails to load in the device...
I am kinda out of ideas, do you mind sharing what you did to make it work in the end?
EDIT: Nevermind, hardcording the address of nr_running solved the problem...
Click to expand...
Click to collapse
What tells -
Code:
dmesg | grep nameofmodule
in terminal?

Well, problem solved...before that it shows the same error as your first post, until I hardcoded the address in the source code of the module...things load fine now...

Ryuinferno said:
Well, problem solved...before that it shows the same error as your first post, until I hardcoded the address in the source code of the module...things load fine now...
Click to expand...
Click to collapse
Sorry for the OT, but what about seeder script?
I can see a real speed improving, but, in a interview aremcee (Ricardo Cerqueira) told the speed improving is to attribute at the more CPU using not at a substantial optimization of the script, what can you tell about?

Well, it is still controversial...My CPU speed remained the same (as scaled by cpu governor), but there is not much difference in my device as it is already fast...seems that it has different effect towards different devices...

Related

[Q] pppwidget on our tab??

Has anyone tested if it works on our tab or not....Plus does anyone know ho to find the power output of our tab's usb host mode????
I'll be geting my new usbotg cable soon so i'll also try n post the result....
For those who don't know about pppwidget, its a which allows you to use your 3G/2G stick(dongle) on your tab using the otg cable...
Market link
Read More about project here..
Hi thanks for this information, I tried this and it requires extra kernel modules (option, which is not included in cm10 kernel).
proudfoot said:
Hi thanks for this information, I tried this and it requires extra kernel modules (option, which is not included in cm10 kernel).
Click to expand...
Click to collapse
Can you please tell the steps you took and the result you got...This isn't supposed to need any modules except usb_modswitch which it already include....It works on CM10 nexus 7 too...Which dongle did you use???
Yup, it works it requires couple of modules not included in cm10 p5100 kernel, i already build the modules (see attachment) . Enjoy
I uses zte cdma modem, that modem requires 'option' module but most 3g/CDMA dongle uses this module.
You just need to copy those modules to /system/lib/modules.
edit: forgot to actually attaching the modules ~_~
Update: Vpn doesn't seem to work with pppwidget.
Update2: works, needs to manually set the gateway
cool...i'll get back to you in couple of days(waiting for my new otg cable)... can you please give the .c file for the modules also....still learning all this stuff so wlll be helpful....
kan_bleach said:
cool...i'll get back to you in couple of days(waiting for my new otg cable)... can you please give the .c file for the modules also....still learning all this stuff so wlll be helpful....
Click to expand...
Click to collapse
clone it from here -> https://github.com/cmenard/android_kernel_samsung_espresso10
as for compiling it follow/adapt from this tutorial -> http://stevechui.blogspot.com/2011/10/compiling-kernel-modules-tunko-for.html
Its giving 'port not found'....any solutions??
Did you directly connected the dongle to tab or used a powered hub???
kan_bleach said:
Its giving 'port not found'....any solutions??
Did you directly connected the dongle to tab or used a powered hub???
Click to expand...
Click to collapse
Directly, what the log (it should be in /sdcard/pppwidget/log/) say?
edit: actually with this -> http://www.amazon.com/Samsung-EPL-1PL0BEGXAR-USB-Connection-Kit/dp/B005518J6Q it's still count as directly right?
proudfoot said:
Directly, what the log (it should be in /sdcard/pppwidget/log/) say?
edit: actually with this -> http://www.amazon.com/Samsung-EPL-1PL0BEGXAR-USB-Connection-Kit/dp/B005518J6Q it's still count as directly right?
Click to expand...
Click to collapse
Yup that's direct
Checked the log...mod_switch successful, but loading option module fails...option.ko is in the correct folder..
I tried insmod but it says operation not permitted...
Tried su and then insmod but then it says failed (trying using terminal emulator)..
kan_bleach said:
Yup that's direct
Checked the log...mod_switch successful, but loading option module fails...option.ko is in the correct folder..
I tried insmod but it says operation not permitted...
Tried su and then insmod but then it says failed (trying using terminal emulator)..
Click to expand...
Click to collapse
Your option.ko probably not compatible with the kernel, try to do
Code:
strings option.ko | grep vermagic
uname -a
and compare both output, it should be similar.
also if you use insmod I think you'll need to insmod usb_wwan.ko first, because option.ko depends on that module, so it should be
Code:
insmod usb_wwan.ko
insmod option.ko
then, move the pppwidget to launcher and plug the dongle.
proudfoot said:
Your option.ko probably not compatible with the kernel, try to do
Code:
strings option.ko | grep vermagic
uname -a
and compare both output, it should be similar.
also if you use insmod I think you'll need to insmod usb_wwan.ko first, because option.ko depends on that module, so it should be
Code:
insmod usb_wwan.ko
insmod option.ko
then, move the pppwidget to launcher and plug the dongle.
Click to expand...
Click to collapse
Tried the command...output is the same...still not able to use insmod...
Log
Code:
USB_ModeSwitch log from Sat Oct 27 16:23:19 IST 2012
Raw args from udev: 1-1.4/1-1.4:1.0
Using top device dir /sys/bus/usb/devices/1-1.4
----------------
USB values from sysfs:
manufacturer ZTE, Incorporated
product USB Storage
serial 000000000002
----------------
bNumConfigurations is 1 - don't check for active configuration
SCSI attributes not needed, moving on
checking config: /data/data/de.draisberghof.pppwidget/app_tmp/19d2.fff5
! matched. Reading config data
config: TargetVendor set to 19d2
config: TargetProductList set to fff1,fffe,ffff
Driver module is "option", ID path is /sys/bus/usb-serial/drivers/option1
Logger is: /system/bin/log
Command to be run:
usb_modeswitch -I -W -D -s 20 -u -1 -b 1 -g 14 -v 19d2 -p fff5 -f $configBuffer
Verbose debug output of usb_modeswitch and libusb follows
(Note that some USB errors are to be expected in the process)
--------------------------------
Reading long config from command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 1.2.4 (C) Josua Dietze 2012
* Based on libusb0 (0.1.12 and above)
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x19d2
DefaultProduct= 0xfff5
TargetVendor= 0x19d2
TargetProduct= not set
TargetClass= not set
TargetProductList="fff1,fffe,ffff"
DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint= not set
MessageContent="5553424312345678c00000008000069f030000000000000000000000000000"
NeedResponse=0
ResponseEndpoint= not set
InquireDevice disabled
Success check enabled, max. wait time 20 seconds
System integration mode enabled
Use given bus/device number: 001/014 ...
Looking for default devices ...
bus/device number matched
searching devices, found USB ID 19d2:fff5
found matching vendor ID
found matching product ID
adding device
Found device in default mode, class or configuration (1)
Skipping the check for the current configuration
Using interface number 0
Using endpoints 0x0a (out) and 0x89 (in)
USB description data (for identification)
-------------------------
Manufacturer: ZTE, Incorporated
Product: USB Storage
Serial No.: 000000000002
-------------------------
Looking for active driver ...
OK, driver found; name unknown, limitation of libusb1
OK, driver "unkown" detached
Setting up communication with interface 0
Using endpoint 0x0a for message sending ...
Trying to send message 1 to endpoint 0x0a ...
OK, message successfully sent
Resetting response endpoint 0x89
Resetting message endpoint 0x0a
Could not reset endpoint (probably harmless): -34
Device is gone, skipping any further commands
Bus/dev search active, referring success check to wrapper. Bye.
ok:busdev
--------------------------------
(end of usb_modeswitch output)
Checking success of mode switch for max. 20 seconds ...
Waiting for device file system (1 sec.) ...
Reading attributes ...
All attributes matched
Mode switching was successful, found 19d2:fff1 (ZTE, Incorporated: ZTE CDMA Tech)
Now checking for bound driver ...
No driver has bound to interface 0
Module loader is /system/bin/insmod
Trying to find module "option"
Have you try to insert those modules manually first, before running pppwidget and plug-in the dongle? I think we use the same dongle, so it should works ~_~
anyway this is how i get this to work:
1. create directory /data/loca/modules/ on tab
2. move all those modules (option.ko, usb_wwan.ko, ppp_async.ko) to this directory.
3. su and insmod all those modules:
Code:
insmod /data/local/modules/usb_wwan.ko
insmod /data/local/modules/option.ko
insmod /data/local/modules/ppp_async.ko
5. move pppwidget to launcher and plug the dongle.
optional:
create this script and put it in /data/local/userinit.d/93loadmod directory
Code:
#!/system/bin/sh
/system/bin/insmod /data/local/modules/usb_wwan.ko
/system/bin/insmod /data/local/modules/option.ko
/system/bin/insmod /data/local/modules/ppp_async.ko
so it will load all those modules at boot time.
I am doing the same thing...but insmod is giving error
When i run the insmod command i get
insmod: init_module 'usb_wwan.ko' failed(Exec format error)
kan_bleach said:
insmod: init_module 'usb_wwan.ko' failed(Exec format error)
Click to expand...
Click to collapse
From a bit of googling it looks like your module is not build for your kernel (or even build for wrong architecture), what is your kernel? and where do you get the modules, do you compile it yourself or is it from somebody else?
try to do dmesg after you do insmod to see more information.
btw, the module that i have posted only works for p5100 and cm10 kernel (3.0.8-CM-g11fad65)
proudfoot said:
From a bit of googling it looks like your module is not build for your kernel (or even build for wrong architecture), what is your kernel? and where do you get the modules, do you compile it yourself or is it from somebody else?
try to do dmesg after you do insmod to see more information.
btw, the module that i have posted only works for p5100 and cm10 kernel (3.0.8-CM-g11fad65)
Click to expand...
Click to collapse
I used the modules you posted...I am using CMOC-10 kernel....Maybe that is the issue...But the kernels are supposed to be identical except for the OC and the governors feature...i am on 3.0.8-CM-gbd034d0
kan_bleach said:
gbd034d0
Click to expand...
Click to collapse
Yup that the problem, it needs to have the same extra version number even though it comes from same source. I guess I could compile it for you.
proudfoot said:
Yup that the problem, it needs to have the same extra version number even though it comes from same source. I guess I could compile it for you.
Click to expand...
Click to collapse
Please do...
kan_bleach said:
Please do...
Click to expand...
Click to collapse
Here, I hope it works because it comes from cm10 source, I only change the extra version to match yours.
proudfoot said:
Here, I hope it works because it comes from cm10 source, I only change the extra version to match yours.
Click to expand...
Click to collapse
Thanks i'll try and post the result...can you give me the github link for the cm10 kernal for our tab???

[R+D]Native GCC 4.6.0 + Binutils 2.22 ----- Bionic Arms Attached :)

Hi Folks
Here's a native Bonic GNU GCC ( 4.6.0 ) + BinUtils ( 2.22 ) compiled for armv7-a with c and c++ support!
Testing:
I used an HTC Sensation running CM9 for testing
[EDIT:] Using JB 4.2.1 on a Nexus 7 causes a segmentation fault when trying to compile...... Investigation Continues!
Installing:
Download and unpack this archive [ bionic_gcc_binutils.7z ]
copy the directories to the /system directory ,
adb push whilst in the directory you extracted the download to should do the trick
adb push . /system
Test the gcc
Code:
adb shell gcc /system/usr/src/hello.c -o /system/bin/hello
adb shell hello
HELLO OUTPUT: Hello Bionic
Check the Dynamic Linker
Code:
adb shell readelf -l /system/bin/hello | grep 'linker'
OUTPUT: [Requesting program interpreter: /system/bin/linker]
The GNU linker - ld
ld currently only has one search path by default, that is /system/lib, you must manually set links to other location ( i.e /vendor/lib )
Getting Help - RTFM ( Read The F***king Manual )
No seriously the man and info pages can be found in the share directory in the archive
Personal Thoughts
Although GCC is a very mature project, I'd still consider this as PRE-ALPHA R&D as I'm certainly not an expert when it comes to toolchains etc. I basically used a bruteforce attack to build this. which involves compile - test - tweak/fix - rinse - repeat and stop when it looks about right So I could have quite easily misconfigured a compiler flag or patch a file in an inappropriate manner which may manifest itself further down the line.
I suppose the acid test would be to try and compile the linux kernel using this toolchain.
I had a search around to see if this had already been covered, It looks like the C4Droid project has it covered, at a cost!! but I do see the question on native compilation come up every now and again so hopefully this should help some folks out at least.
I'm curious, although this is old by now, what CFLAGS (and other environment variable settings) and configure options did you use in order to get that to compile? I've messed around with gcc 4.9.1 and binutils 2.24 using the android toolchain from NDK version r9d, and haven't had any luck.
jdmanley87 said:
I'm curious, although this is old by now, what CFLAGS (and other environment variable settings) and configure options did you use in order to get that to compile? I've messed around with gcc 4.9.1 and binutils 2.24 using the android toolchain from NDK version r9d, and haven't had any luck.
Click to expand...
Click to collapse
Are you still curious about this? I did this just recently and it took quite a while to find the right configurations and flags.
I'd be happy to post the output of 'gcc -v' or show what config parameters I used
Surge1223 said:
Are you still curious about this? I did this just recently and it took quite a while to find the right configurations and flags.
I'd be happy to post the output of 'gcc -v' or show what config parameters I used
Click to expand...
Click to collapse
please share

Kernel-Perf/Oprofile support?

As the title implies, I'm trying to figure out is any kernel includes perf or OProfile support.
What is perf?
https://perf.wiki.kernel.org/index.php/Main_Page
What is OProfile?
http://oprofile.sourceforge.net/news/
I know that in some sources... I can see in /arch/Kconfig:::
Some options for OProfile...
/////////////////////
config OPROFILE
tristate "OProfile system profiling"
depends on PROFILING
depends on HAVE_OPROFILE
select RING_BUFFER
select RING_BUFFER_ALLOW_SWAP
help
OProfile is a profiling system capable of profiling the
whole system, include the kernel, kernel modules, libraries,
and applications.
If unsure, say N.
config OPROFILE_EVENT_MULTIPLEX
bool "OProfile multiplexing support (EXPERIMENTAL)"
default n
depends on OPROFILE && X86
help
The number of hardware counters is limited. The multiplexing
feature enables OProfile to gather more events than counters
are provided by the hardware. This is realized by switching
between events at an user specified time interval.
If unsure, say N.
config HAVE_OPROFILE
bool
/////////////
How do I enable these?
In addition to that, I see perf under tools, how do I enable it?
<><> What I want to do?
I'm doing some college research on app's performance.
And I'm well done using MethodTracing.
I want to be able to run stress test codes on the tablet and measure the different speeds every test achieves.
Thank you.
At first glance, OProfile Event Multiplex won't work because it depends on the x86 architecture.
Im not interested only in OProfile.
As you may see, I mention Perf too.
As a possibility of tracing...
OProfile is enabled in my kernel (should be in all kernels ). Perf on the other hand, I need to check.
Thanks, can you direct me to your kernel.
Also I was trying franco Kernel, I'm seeing OProfile is enabled too, but I can't see to get it running though.
To see if OProfile is enabled in the kernels I had used, i just pull out the kernel config.gz file from my phone and read it.
What I'm trying to see...
this values with y
CONFIG_PROFILING=y
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y
CONFIG_OPROFILE_ARMV7=y
Click to expand...
Click to collapse
To get the file:::
on a terminal...
adb pull /proc/config.gz
gunzip -c config.gz > .config
Click to expand...
Click to collapse
Update:
Also one can see if OProfile is installed once inside a root terminal
Just type # opcontrol --help
It should give you some usage info about opcontrol.
opcontrol: usage:
--list-events list event types
--help this message
--verbose show extra status
--verbose-log=lvl set daemon logging verbosity during setup
levels are: all,sfile,arcs,samples,module,misc
--setup setup directories
--quick setup and select CPU_CYCLES:150000
--timer timer-based profiling
--status show configuration
--start start data collection
--stop stop data collection
--reset clears out data from current session
--shutdown kill the oprofile daeman
--callgraph=depth callgraph depth
--event=eventspec
Choose an event. May be specified multiple times.
eventspec is in the form of name[:count], where :
name: event name, see "opcontrol --list-events"
count: reset counter value
--vmlinux=file vmlinux kernel image
--kernel-range=start,end
kernel range vma address in hexadecimal
xbin (busybox) MUST be installed for this to work also.
Errors I'm having, while I'm trying to use it on my nexus 7 3G+WIFI::
..Having errors when I run setup… //Can’t see to get it running .
# opcontrol --setup
it outputs:
mount: No such device
# opcontrol --start //doesn't start the trace, says can’t find folder….
it outputs:
Cannot open /dev/oprofile/enable: No such file or directory
http://forum.xda-developers.com/showthread.php?t=2373410&page=3
I too checked for these flags only. Also during the compile it actually picked up oprofile.o etc. Therefore kernel has OProfile.
Just a heads up on perf.
PERF is a modern tool and requires some kernel components that are only supported from the 2.6.36 Linux kernel (K36) and onward. If you are using the 2.6.32 Linux kernel (K32) you should use OProfile for CPU profiling.
If you are building a custom Android/Linux kernel please check that the following lines are present in your .config:
2.6.36 KERNEL (K36)
CONFIG_PROFILING=y
CONFIG_PERF_EVENTS=y
CONFIG_HW_PERF_EVENTS=y
CONFIG_PERF_ANDROID_BACKTRACE=y
CONFIG_CACHE_PL310_PERF_EVENTS=y
You can test to see if the target device already has these kernel configuration options via the following:
adb pull /proc/config.gz config.gz &&
gunzip -c config.gz | grep '\(CONFIG_O*PROFIL\)\|\(_PERF_EVENTS\)'
see more::
http://docs.nvidia.com/tegra/data/How_To_Profile_a_Tegra_Android_NDK_Application_with_PERF.html
Actually regarding OProfile, I just tested out the commands you listed earlier. They work on my kernel perfectly.
Perf is a different story though.
sgt. meow said:
Actually regarding OProfile, I just tested out the commands you listed earlier. They work on my kernel perfectly.
Perf is a different story though.
Click to expand...
Click to collapse
Perfect, then I just need to actually succesfully build your kernel from source or get the dropbox link of the compiled kernel to work.
That's what I was trying to do yesterday.
Apparently dropbox is block in my work network.
Unfortunately Dev-Host does not want to work for me. I'll try mirroring it to Sendspace or Mediafire. Wait a while.
sgt. meow said:
Unfortunately Dev-Host does not want to work for me. I'll try mirroring it to Sendspace or Mediafire. Wait a while.
Click to expand...
Click to collapse
I got dropbox to work using a proxy..
Thank you.
Any direction on a tutorial to learn on how to build the kernel from source my self?
Update::
Flashing oxydo kernel on nexus 7 3g+wifi (tilapia) right now...
http://source.android.com/source/building-kernels.html
Adjust as needed.
sgt. meow said:
http://source.android.com/source/building-kernels.html
Adjust as needed.
Click to expand...
Click to collapse
Thank you very much.
Gonna start building, and changing parameters in .config file of the kernel.
Ultimate goals:
-Get both perf and OProfile to work with your kernel.
-Know how to replicate this task so it can be replayed later in other android kernels.

[UTILITY][ANDROID] XZ Utils port to Android - managing .xz archives now possible!

what is XZ Utils
XZ Utils is free general-purpose data compression software with high compression ratio. XZ Utils were written for POSIX-like systems, but also work on some not-so-POSIX systems. XZ Utils are the successor to LZMA Utils.
The core of the XZ Utils compression code is based on LZMA SDK, but it has been modified quite a lot to be suitable for XZ Utils. The primary compression algorithm is currently LZMA2, which is used inside the .xz container format. With typical files, XZ Utils create 30 % smaller output than gzip and 15 % smaller output than bzip2.
Android port
XZ Utils makes managing .xz and .lzma (LZMA2) archives possible in Android APPs or tools .XZ Utils is easy to use and powerful . you may use it in your app or use it with terminal emulator ( push binary to /system/bin and set permissions to 755 )
This binaries support ALL Android based devices with Bionic C Library .
Download
You may download lastest binaries for Android-ARM here :
XZ Utils 5.0.5 – ARM – Android
Development
Main development of XZ Utils is running by Tukaani .
And git repo :
git clone http://git.tukaani.org/xz.git
Licence
The most interesting parts of XZ Utils (e.g. liblzma) are in the public domain. You can do whatever you want with the public domain parts.
Some parts of XZ Utils (e.g. build system and some utilities) are under different free software licenses such as GNU LGPLv2.1, GNU GPLv2, or GNU GPLv3.
Official XZ Utils and more information HERE
@alireza7991 Thanks for the work porting/compiling this for Android - exactly what I was looking for since (for some reason..) Busybox only supports xz/lzma decompression. :good:
The download link is dead now unfortunately - would you please rehost it somewhere?
Thank you in advance!
osm0sis said:
@alireza7991 Thanks for the work porting/compiling this for Android - exactly what I was looking for since (for some reason..) Busybox only supports xz/lzma decompression. :good:
The download link is dead now unfortunately - would you please rehost it somewhere?
Thank you in advance!
Click to expand...
Click to collapse
Sorry for download link,I'm gonna fix it ASAP.
UPDATE: fixed (link is available in OP)
UPDATE2: oh, It seems there 's a problem with new executable, I have to fix it. I just need some time.sorry.
Hey. I just wanted to thank you again for your work but I managed to make a static native compile (~765kb) of xz-5.0.5 using my N7 and a kbox build environment I set up. It's available in my ARM Android Image Kitchen linked in my sig. Cheers!
Since xz binary for android is missing I have compiled one static armv7 for all you, enjoy!
munjeni said:
Since xz binary for android is missing I have compiled one static armv7 for all you, enjoy!
Click to expand...
Click to collapse
@munjeni @alireza7991 Hi! Can you share the commands you used to get xz's ./configure to cross-compile to android? I'm trying to set it up on Cygwin using the NDK's standalone I made but I'm having troubles.
Edit: I think I figured out my main issue: the toolchain bin path needed to be added at the beginning of the PATH, not the end. :silly:
Now to generate configs for arm x86 and mips and figure out how switch between them and build.. (any tips here would be appreciated as well!) :good:
Edit 2: Another snag with the toolchain.. configure grabs the Windows path for ld instead of the Cygwin one, so we run into multiple targets due to the :'s. Starts happening around the libtool detection.
Edit 3: It appears I can force it to use the one in PATH with LD=arm-linux-androideabi-ld
Edit 4: Getting it to make a legit static compile is stumping me now, I've tried adding CFLAGS="-static -s" to the ./configure commandline but it doesn't work in L, meaning it's not actually static (maybe due to zlib or something?).
munjeni said:
Since xz binary for android is missing I have compiled one static armv7 for all you, enjoy!
Click to expand...
Click to collapse
@munjeni Can you please explain how you statically compiled it? Configuring with --disable-shared --enable-static doesn't seem to work. Neither does inserting the -static flag various places into the built Makefile.
Try with LDFLAGS
munjeni said:
Hope this help https://github.com/munjeni/android_real_web_server/blob/master/MUNJENI_COMPILATION.sh
Click to expand...
Click to collapse
Thanks for replying! Cool stuff, but I don't see xz in there, and am struggling to see any lessons I could apply offhand from it.
munjeni said:
Try with LDFLAGS
Click to expand...
Click to collapse
Tried adding it with -Wl,--gc-sections,-static but that results in "checking whether the C compiler works... no", trying it separate now.
Here's my setup, under config (before): http://forum.xda-developers.com/showpost.php?p=54510825&postcount=277
Here's what I'm trying now (simplified):
Code:
savedpath="$PATH";
ldflags="-Wl,--gc-sections -static";
cflags="-g -O3 -ffunction-sections -s";
export PATH="~/x-tools/arm-linux-androideabi/bin:$PATH";
cd ~/xz*;
./configure --host=arm-linux-androideabi --disable-shared --enable-static LD=arm-linux-androideabi-ld LDFLAGS="$ldflags" CFLAGS="$cflags" CPPFLAGS="$cflags" CCASFLAGS="$cflags" --disable-xzdec --disable-lzmadec --disable-lzmainfo --disable-lzma-links --disable-scripts;
export PATH="$savedpath";
I feel like I tried it in LDFLAGS before, but fingers-crossed. :fingers-crossed:
Edit: @munjeni Still no luck, unfortunately. It statically links liblzma but not libc or libdl:
Code:
[email protected] ~
$ ndk-depends() { ~/x-tools/$1/bin/$1-readelf -d $2 | grep NEEDED; }
[email protected] ~
$ ndk-depends arm-linux-androideabi xz
0x00000001 (NEEDED) Shared library: [libc.so]
0x00000001 (NEEDED) Shared library: [libdl.so]
How did you execute configure, and/or alter the resulting Makefile to get a true static compile?
I had problems with xz and sorry I forgot how I solved them, probably (I think) I have linked with static libc! Or probably (maybe) some of the depended libs was not static which caused me failed xz static compilation so maybe I have compiled staticaly other dependencies and linked with xz! Bionic is realy an sh*t Hope this help.
munjeni said:
I had problems with xz and sorry I forgot how I solved them, probably (I think) I have linked with static libc! Or probably (maybe) some of the depended libs was not static which caused me failed xz static compilation so maybe I have compiled staticaly other dependencies and linked with xz! Bionic is realy an sh*t Hope this help.
Click to expand...
Click to collapse
Tried adding --with-sysroot= to the ./configure command-line and -lc -ldl to the CFLAGS (and LDFLAGS) to try and get it to find/link them all but still no luck.
@munjeni If you ever do remember/recreate what you did to get xz to compile statically, please share it here/somewhere on xda and mention me. It's actually applicable to all autotools (./configure) built sources, so would definitely help a lot of people with a lot projects. Especially with Android L coming along, requiring everything to be static or PIE (with static preferred for backwards-compatibility). :good:
osm0sis said:
Tried adding --with-sysroot= to the ./configure command-line and -lc -ldl to the CFLAGS (and LDFLAGS) to try and get it to find/link them all but still no luck.
@munjeni If you ever do remember/recreate what you did to get xz to compile statically, please share it here/somewhere on xda and mention me. It's actually applicable to all autotools (./configure) built sources, so would definitely help a lot of people with a lot projects. Especially with Android L coming along, requiring everything to be static or PIE (with static preferred for backwards-compatibility). :good:
Click to expand...
Click to collapse
Put your libc.a and libdl.a to the new place. for example put them to new folder caled /tmp/compilationfolder, than try flags:
LDFLAGS="-L/tmp/compilationfolder" LIBS="-lc -ldl"
to make sure it get linked with static libs! If compilation fail to find other libs than locate missing libs and move them to these folder and try again until...
EDIT:
If I remember corectly I think now I have removed shared libs in sysfolder of the toolchain just for compiling xz!
@osm0sis : What toolchain are you using? I really hope you're NOT trying to use the MentorGraphics/CodeBench/CodeSourcery garbage. Only trouble with their stuff. Also, when using Cygwin for these kind of things your putting yourself in deep water or trouble from the start. Use a VirtualBox VM. The list of problems when trying to compile any *nix stuff on windows is nearly endless.
Check this:
"Cross-compiling: Building_the_Kernel_using_Cygwin"
NDK all the way. Yeah I know I should fire up the Ubuntu VM, but I was having such fun (successfully) getting it all to work in Cygwin so far until this roadblock in making xz static.
Either way, I think munjeni was using Linux and ran into the same problems until he started messing with the toolchain sysroot, so it's not just Cygwin.
munjeni said:
Put your libc.a and libdl.a to the new place. for example put them to new folder caled /tmp/compilationfolder, than try flags:
LDFLAGS="-L/tmp/compilationfolder" LIBS="-lc -ldl"
to make sure it get linked with static libs! If compilation fail to find other libs than locate missing libs and move them to these folder and try again until...
EDIT:
If I remember corectly I think now I have removed shared libs in sysfolder of the toolchain just for compiling xz!
Click to expand...
Click to collapse
I believe you are on the right track with this idea but my concern with it now is that there are multiple definitions upon compiling against liblzma.a and a few others. Causes errors. I then took a shot with just libc.so libdl.so and this went fine without any errors but they still appeared as dynamic when checking with: objdump -p ./xz
@osm0sis, guess what I have
Code:
xz-5.0.5$ cd ./src/xz
xz$ objdump -p ./xz
./xz: file format elf32-littlearm
Program Header:
0x70000001 off 0x00051d58 vaddr 0x00059d58 paddr 0x00059d58 align 2**2
filesz 0x000009e8 memsz 0x000009e8 flags r--
LOAD off 0x00000000 vaddr 0x00008000 paddr 0x00008000 align 2**15
filesz 0x00052740 memsz 0x00052740 flags r-x
LOAD off 0x00058264 vaddr 0x00060264 paddr 0x00060264 align 2**15
filesz 0x00000fa0 memsz 0x0000dae4 flags rw-
NOTE off 0x00051c44 vaddr 0x00059c44 paddr 0x00059c44 align 2**2
filesz 0x00000018 memsz 0x00000018 flags r--
STACK off 0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
filesz 0x00000000 memsz 0x00000000 flags rw-
RELRO off 0x00058264 vaddr 0x00060264 paddr 0x00060264 align 2**0
filesz 0x00000d9c memsz 0x00000d9c flags r--
private flags = 5000002: [Version5 EABI] [has entry point]
xz$
---------- Post added at 01:17 AM ---------- Previous post was at 01:03 AM ----------
@osm0sis, if you wish to compile xz statically then the following example will do the trick. It's so SIMPLE I about fell out of my seat. Pay attention to what I have in bold:
./configure --build=arm --host=arm-linux-androideabi LDFLAGS="-static"
Then, when you go to run, make, just do the following:
make LDFLAGS=-all-static
Update:
After some tests with @osm0sis we learned that using configure will ultimately overwrite the original flags ordained by the source. Running the configure normally then applying your flags using "+=" will insure the ordained flags do not get overwritten as well as including your own additional flags. This will ultimately be up to the user what they want to do and their ultimate goal at the end of the day.
--- Happy Hunting!!
You freaking genius! No modification of the NDK toolchain required!?
osm0sis said:
You freaking genius! No modification of the NDK toolchain required!?
Click to expand...
Click to collapse
Nope
Modding.MyMind said:
Nope
Click to expand...
Click to collapse
Can't wait to try that out in the morning. You've just fixed static NDK compiling on anything using Autotools, bro!
osm0sis said:
Can't wait to try that out in the morning. You've just fixed static NDK compiling on anything using Autotools, bro!
Click to expand...
Click to collapse
Let me know how it works out for you. I tried this method on my phone too and it worked like a champ

T-R42 owners...please help! which is your wifi chip?

Hello T-R42/K-R42/CS918 owners,
i have a problem with wifi: it does not work more
BUT perhaps you could help me and others with similar problems:
open the terminal and type: cat /sys/class/rkwifi/chip
and post the result on this thread , adding the model and board version you have (if you know it)
Thanks a lot!
Vicolodo said:
Hello T-R42/K-R42/CS918 owners,
i have a problem with wifi: it does not work more
BUT perhaps you could help me and others with similar problems:
open the terminal and type: cat /sys/class/rkwifi/chip
and post the result on this thread , adding the model and board version you have (if you know it)
Thanks a lot!
Click to expand...
Click to collapse
I have "[email protected]" changed from "[email protected]" after I executed the command with su or without, the result is the same, Nothing else displayed. My board verion 1.0 AP6210 wifi chip.
buhohitr said:
I have "[email protected]" changed from "[email protected]" after I executed the command with su or without, the result is the same, Nothing else displayed. My board verion 1.0 AP6210 wifi chip.
Click to expand...
Click to collapse
thank you!
i found that RK901 is hard-coded into the kernel, as you can read here:
it depends on the parameters used compiling the kernel:
in fact i found this:
https://github.com/gripped/MK808-he...net/wireless.orig/wifi_sys/rkwifi_sys_iface.c
i am not an expert, but i think that is the kernel procedure that writes the attributes of the class for wifi on the file system,
one of which is the file /sys/class/rkwifi/chip
the fact that we have all RK901 is because all (almost) our kernels have been compiled with the configuration
#ifdef CONFIG_RK901
I dont know if my device instead should use a different kernel (compiled with other configuration),
but i think that probably RK901 is the right value also for my device
This because i think that the cause of my problem is different:
seems that the problem is caused by an error returned by the insmod (insert module) procedure
(called by the load driver procedure ,
that perhaps it is something like what can be found here
https://github.com/aloksinha2001/pi****u-3.0.8-alok/blob/master/RK30_MT5931_MT6622/wifi/wifi.c
)
The insmod function does these two things:
- allocates memory for the driver and loads the file (rkwifi.ko) on this area:
module = load_file(filename_release, &size);
- initialize the module
ret = init_module(module, size, args);
One of this two events went wrong, because i am sure insmod in my case returns -1
I went to this conclusion following the logcat trace and searching infomations on the web, as you can see here
http://www.freaktab.com/showthread.php?11523-why-wifi-not-working-here-there-is-the-answer
i read somewhere that the init_module may return error when the user has not the permission to insert the module into the kernel...
so can be that some permission is missing ...like a problem caused by rooting, where i have no more root permissions after flashing the ROM...or something like that...
do you have any suggestion?
Thanks a lot!
I still believe you haven't flash the full rom correctly. You need to reflash a full stock rom where it will reformat your nano and replacing all the correct files with all the correct permission. Currently you are trying to fix many holes in the rom/kernel and just a big waist of time. When you reformat your device and flash a full rom it should address all the issues. I have been working on so many Android devices and if you could format and reflash the stock rom, it solved everything unless your hardware is in question. One thing I noticed is that if you have a proper flash your device should be seen by your PC. Once your pc communication is fixed, you should able to flash full rom using batch tool. Before you flash the full rom, the batch tool is going to do a low level formatting (which did help me in the past where I soft brick my device). So the key thing here is focus on make your pc see your device. First start with the bootloader, then recovery, then the rest. Your nano is properly corrupted, so you need to reformat the nano and reflash the bootloader.

Categories

Resources