missing a command building android kernel - android

I have been trying to build an android kernel for a certain device, the Huawei Vitria, they finally uploaded their kernel source about 2 months ago so I try to build it the normal way which fails so I fix the main errors I see and get the kernel to build finally but, then I notice one error while building. I look into this file and see that they are using a weird way of building I think instead of the normal defconfigs, using a generic defconfig then a configuration file to configure their devices ontop of that(they've done this before but not to this extent), which leads me to think I'm missing a command to select the device config ontop of the defconfig to set up the drivers, but don't know what command was used.
So might there be a way to find out the command by looking at these two files
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product.pl
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product_id.pl
thanks

I'm not sure how much help this is, but the first command seems to want to be called with a parameter of a path to an XML file.
./parse_product.pl /ab/cd/hw_xxy_configs.xml
PRODUCT: xxy
reads: '/ab/cd/hw_xxy_configs.xml'
It pulls out some data from that file and pastes it into a .c file which presumably goes into the build configuration.
So, you're looking for an XML file containing your product-name.
The second file calls the first repeatedly to generate a set of .c files. Now - this second script takes an XML file as an argument, but I'm afraid I can't tell what it might be called. The file looks like it should contain product names and board-ids if that is any help.

Related

How to solve this valgrind issue?

I'm trying to run valgrind on an android OS but it couldn't start and it shows this errors that i couldn't find how to solve:
valgrind: Startup or configuration error:
Can't create client cmdline file in /tmp/valgrind_proc_87_cmdline_876a7612
valgrind: Unable to start up properly. Giving up.
Thanks in advance !
I tried to change the default path that valgrind use and which is shown on the error log but i couldn't make it
The problem is happening in the code where the Valgrind host is creating a fake /proc/<pid>/cmdline.
This file should be created in the location given by the first valid item in the following list:
The TMPDIR environment variable
The constant VG_TMPDIR that gets baked into the binary via a configure time option. This defaults to /tmp but can be overriden using configure --with-tmpdir=/your/tmp/dir. That would require that you get the Valgrind source and configure and build it. It is possible that you are using a package that was built using this option and is not compatible with your system.
Last resort, "/tmp"
All of the above checks just test that the string is non-null and not empty. They do not test for the existance and accessibility of the directory. That gets determined by the Valgrind version of mkstemp and the error message comes from 'valgrind_main'.
Valgrind needs to create a file TMPDIR/valgrind_proc_PID_cmdline_RAND where TMPDIR is described above, PID is the pid of the Valgrind process and RAND is a random number.
There is at least one other similar files that get created, for auxv.
There are no Valgrind command line options to turn off the creation of these files.

Rebuilding Android LK

We are trying to bringup a new MIPI display that we are using for our smart glasses solution. To do this we have roughly followed the guide provided by Qualcomm: https://developer.qualcomm.com/download/db410c/dsi-display-porting-guide-linux-android.pdf
The method of porting a new display required that we modify the Android bootloader (Little Kernel) with the new configuration for the display we are using. This allows us to select the new display using the command:
$ fastboot oem select-display-panel <display-name>
The problem is that to add this new configuration to LK we need to rebuild the image (emmc_appsboot.mbn). This has been unsuccessful so far.
We found a file within the LK directory that is called AndroidBoot.mk. A comment in this file says “#Android makefile to build lk bootloader as a part of Android Build”
According to that comment, it seems that LK should be built as a part of Android build, however we cannot seem to do so. Is this thinking correct?
As per the LK github build instructions, we've also tried running
$ make msm8909
from the LK directory but we are getting the following error:
unrecognised option '-mcpu=cortex-a8'
I suspect this may be due to missing part of the toolchain as I've had to manually add arm-eabi-gcc to the path variable.
Can anyone provide any information on what command we need to use or what process needs to be followed in order to generate a new LK bootloader file with the updated config?
The problem was due to an incorrect PATH variable set. I fixed the issue by adding the correct path: ".../prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/" to the .bashrc file and re-logging in.

System can't find specifed path ndkbuild in android

I want to build an ocr app in android.For that i am using tessaract library.I am following this turorial ocr tutoial it says follow below steps
Download the NDK & extract to C:\ drive-Done
Set NDK Path & Android SDK path to PATH variable in Enviorment Variable.-Done
Download tessaract library and extract it to C:-Done
open command line & go inside tessract folder ibn downloaded library.-
Write ndk-build-Not Done
When i write ndk-build it says the system can't find the specified path.
Please tell me how to resolve this issue.I have already spent lot of hard time on this.
Thanks in advance.
If you re-read the link you posted, you may notice this line from the author:
Attention: if you fail at any of the above steps, you are not ready for this shit yet. Better grab an introduction to android development course, read a book, then come back to this tutorial. You’ll just waste time and nerves and you’ll bitch about it in the comments that this crash, this doesn’t work. (PS. no, I will not send you the source code on your email, stop spamming k thx.)
You should seriously consider his advice - working with the Android NDK only gets more difficult from here.
You're probably getting that error message because cmd couldn't find the ndk-build program, which is located inside the root of android-ndk-r10e. Possible causes:
You made an error when editing your PATH variable - make sure each file path is separated by a semicolon and that you provided the full path to your NDK install.
Your PATH is too long - the max length is 260 characters. See this page for more info. tl;dr: prefix \?\ to your PATH to get around this length limit.
You had cmd open when you set the variables - try restarting the cmd
program or even restarting your machine.

Hunting a memory leak with Eclipse and Mat, stuck converting the hprof file

This seems to be a question asked many times. I'm using Eclipse to write an Android app, in OS X. So far, no problem, except the app crashes sometimes, and I want to see whats going on so I can fix the problem. (Its probably related to bitmaps or variables not recycling correctly. But I don't know where else to start to look into it.)
I used the DDMS tool (in eclipse) to create a dump file. Then I downloaded the MemoryAnalyzer application to open it. Here is where I have been stuck for an hour: I have to convert the file first because Eclipse writes the hprof file in a different format. How do I convert it?
The answers to this question, error openning HPROF file, directly address my question. The top answer is the same as the reference for the hprof-conv tool.
The hprof file you get from Android has android specific format. You should convert hprof >file take from Android OS into standard hprof format. For this you can use hprof-conv tool >that is located at AndrodiSDK/tools/hprof-conv.
For example:
hprof-conv android.hprof mat.hprof
And then open mat.hprof in Memory Analyzer.
I have a couple problems with this.
when I open the hprof-conv tool, it shows a handful of lines about it then says "[Process completed]". And there is no place to enter any text. The only relevant info on the screen is this:
Usage: hprof-conf infile outfile
I'm in Terminal, so I open "new command..." or tried using the shell thats also open. Then when I run "hprof-conv dump1.hprof dump1a.hprof" I get the error "command not found". So I think I'm off track. I also tried "hprof-conf", instead of "hprof-conv", the way it suggests in point 1. Same error. Also tried various paths to the file, no change.
if I was on the right track, how do I correctly point this command to the file location? I have it on my desktop, and its named dump1.hprof. I'm not very experienced with Terminal.
Thanks in advance for an answer, or perhaps another suggestion on how to hunt down a memory leak.
If you are on mac add a ./ before the command :
./hprof-conv infile.hprof outfile.hprof
Hello and sorry for a late response. I just went through exactly this problem and wrote some instructions here: http://spragucm.wordpress.com/2013/11/21/debugging-android-project-ddms-heap-dump-in-eclipse/
Method 1: Use the Standalone MAT
go into c:...\sdk-tools\tools and copy hprof-conv.exe
go to whatever folder you saved your dump1.hprof file and paste the .exe file
open a terminal and change directory to the folder with your dump and .exe file (e.g. if folder is c:\Users\YourName\DumpFolder then type cd c:\Users\YourName\DumpFolder)
When you're in the folder type the following in the command prompt and hit enter: hprof-conf infile.hprof outfile.hprof
NOTE: If you get an error about directory not found, you're not in the correct directory in the command prompt
The outfile.hprof file should be in the same folder as the other files.
Method 2: Using MAT in Eclipse
Install the plug-in for MAT in Eclipse
Select to get heap dump as before
Go to Window->Open Perspective->other->Memory Analysis
Look through your tabs for a window with a blue disk icon in top left and expand the tab (this will have some crazy name on it with a very long string of numbers)
Done...you are looking at the heap dump in Eclipse

Can not open draw9patch.bat normally

i installed the newest version of Android SDK,and use SDK Tool Revision 20.0.3, and then i double click the 'draw9patch.bat',i hope it can show me an UI,unfortunately, the bat file just run flashing past, does not show the UI. And then i try to double click 'hierarchyviewer.bat', the program doesn't show an UI either. I don't know why and i can get the ways to solve this problem from the Internet, so i turn to your guys for help.
Make sure you set environment path for java . Open command prompt and navigate to android-sdk\tools\lib folder and type java -jar draw9patch.jar press enter . now you could get see UI screen if no problem with this .jar file .
Probably, "find_java.bat" and it's associated crap exe are failing miserably at doing the one thing it's supposed to do. I don't know how it's supposed to work or why it's failing, and I don't really care. Java is installed and this exe is a failure - so purge the damn dependency and be done with it. Who knows, maybe find_java.exe is some damn NSA virus - never worked for me before (maybe it can't find 64-bit Java... worthless rubbish).
Ahem, yeah, anyway...
Go to draw9patch.bat and change these three lines:
set java_exe=
call lib\find_java.bat
if not defined java_exe goto :EOF
to this (use your Java path):
set java_exe=C:\Program Files\Java\jdk1.7.0_21\bin\java.exe
Then you should even be able to run draw9patch.bat with another bat file wherever you want to place it for convenience, by doing something like this inside the new bat:
call "C:\Program Files (x86)\Android\android-sdk\tools\draw9patch.bat"
No idea why this 'answer' wasn't here a year ago. Open a command prompt... please. :P

Categories

Resources