AOSP Source properties in the Database - android-source

Where can I find the databases from the AOSP Source? I mean the databases, in which are the properties, such as build informations, are stored. I Need this databases with a view to Change the properties before I compile the AOSP.

A lot of them are done by setprop command line app during the init scripts processing.
Checkout the /init*.rc in the device.
adb shell grep setprop /init*rc
adb shell cat /default.prop
They can also be easily added in C/C++ and Java code.

Related

How to export dependency licenses information to csv?

Having an application with about 30 dependencies, we report about the licenses in the app via the default showLicensePage.
How can we export this list to a CSV format (including transitive dependencies)? I am looking for something like this:
package name,transitive (direct/transitive),license,link
some_package,direct,MIT,https://github.com/someone/some_package
...
The LicenseFinder has support for flutter since version 7.0.0 and supports many output formats including csv. The good thing over e.g. flutter_oss_licenses is that it also provides the license name (not only the license text) and also has many other features (e.g. allowing a set of licenses, CI-support, other languages/package-managers support etc.), it is actively maintained by pivotal and is itself MIT licensed.
For example, one can use the docker version to run it (see README - for more information how to run the tool).
Then you can get a csv report for your flutter project with a command like this:
cd some_flutter_project
docker run -v $PWD:/scan -it licensefinder/license_finder:7.0.1 /bin/bash -lc "cd /scan && PUB_CACHE=~/.pub license_finder report --format=csv -p"
This command will mount the current working directory to the docker container and analyze it. The -p option runs flutter pub get in the docker container to setup the dependency cache that is then analyzed.
Note that the command will print the result to standard out, but you can, for example, pipe it to a file (command from above) > out.csv.

-sh /usr/local/sbin/wpa_supplicant no such file or directory

I have built the TI wilink utilities which then I have integrated in my rootfs. This done using petalinux 2016.4 and have created a install template app in yocto build to copy all the tools and libraries in the rootfs.
When I bring up the BOOT.bin and image.ub, I see the files and libraries but when I try to run for example wpa_supplicant it does not work
even wpa_supplicant -h wont work.
It shows me error:
-sh: /usr/local/sbin/wpa_supplicant: no such file or directory.
The file is present and also has executable permissions.
Do you have any idea why it is not able to run ?
Thanks
Typically, this means that executable file is built for the wrong architecture, i.e. there is a mismatch between the environment where are you running and environment for which you are building. This is how you can make sure they do match or not (execute on target):
# file /usr/local/sbin/wpa_supplicant
...
# uname -m
...
If you see mismatch, then it all boils down to how are you building TI wilink.

How do I get the commands executed by Bazel

I was wondering if there is a way to get Bazel to list, output, display, etc., all of the commands that can be executed from a command line that are run during a build after a clean. I do not care if the output is to the screen, in a file, etc. I will massage it into a usable form if necessary.
I have captured the screen output during a run of Bazel which gives me an idea of what is being done, however it does not give me a command I can execute on the command line. The command would have to include all of the command options and not display variables.
If this is not possible, since Bazel is open source, where in the code is/are the lines that represent the commands to be run so that I can modify Bazel to output the executable commands.
I am aware of the query command within Bazel, and used it generate the dependency diagram. If this could be done as a query command it would be even better.
TLDR;
My goal is to build TensorFlow using Bazel on Windows. Yes I know of all of the problems and reasons NOT to do it and have successfully installed TensorFlow on Windows via a Virtual Machine or Docker. I did take a shot at building Bazel on Windows starting with Cygwin, but that started to get out of hand as I am use to installing with packages and Cygwin doesn't play nice with packages, so then I started trying to build Bazel by hand and that was turning into a quagmire. So I am now trying to just build TensorFlow by hand on Windows by duplicating what Bazel would do to build TensorFlow on Linux.
You are correct, you can use the -s (--subcommands) option:
bazel build -s //foo
See https://docs.bazel.build/versions/master/user-manual.html#flag--subcommands.
For your use case, you'd probably want to redirect the output to a file and then global replace any library/binary paths to the Windows equivalents.
You might want to track https://github.com/bazelbuild/bazel/issues/276 (Windows support), although it'll probably be a while.
(Disclaimer: This solution does not print the commands that currently get executed but the commands that would get or got executed.)
I'd use aquery (action graph query) (forget about "graph"):
bazel aquery //foo
Advantages:
It's very fast, because it prints the actions without executing the build.
It's a query. It does not have side effects.
You don't have to do a bazel clean before in order to find out the build steps for a library that has already been built.
It prints information about the specific build step that you request. It does not print all the build commands required for the dependencies.

Code coverage with qemu

I recently started using qemu and it's a great tool when you don't have the required hardware to run your firmware (currently using it for cortex-m3).
Now what I want to do is to do some test coverage with it. I tried using GNUC ARM Eclipse, and I've been successfull compiling and executing the code in qemu, but whenever I add the -fprofile-arcs -ftest-coverage flags (for the project and then for the desired file to run coverage) I am able to create the .gcno file, which means that after executing my code it will generate a .gcda file and then I should be able to see the coverage.
Thtat's where everything goes wrong. I was able to generate a .gcda file but whenever I try to open any of them, eclipse tells me that it wasn't able to open the file because it was null. I've tried replicating the procedure in another computer, but I haven't been successful creating the gcda file (probably different binaries).
At this point I don't really know how to proceed. Should I abandon ARM Eclipse and stick to makefiles (is it possibll to run gcov this way?) or am I missing something really small that is fixable?
PS: I using windows 7 64 bits, the latest versions available on the GNU ARM Eclipse website. Also the idea of doing it via makefiles just occurred to me (it was a stresfull day, it's really late) so I haven't tried it yet, I've only tried executing the code, but without coverage.
As far as I know, qemu is not able to generate DWARF information. But there is a project with the proposal of code coverage with qemu: Couverture Project
When you use qemu as a user space emulator (see also the qemu documentation) you actually can measure the code coverage as usual. In this mode qemu has the full access to the host file system.
For a CMake project you can simply use the CROSSCOMPILING_EMULATOR property of your test executable, e.g.:
if(CMAKE_CROSSCOMPILING)
set_target_properties(mytest
PROPERTIES
CROSSCOMPILING_EMULATOR "qemu-${CMAKE_SYSTEM_PROCESSOR};-L;$ENV{SDKTARGETSYSROOT}"
)
endif()
With this setting ctest will use qemu for running the test and will write the .gcda files to the usual location in your build directory.

Three20 JSON problem: Can deploy to simulator but not device (extThree20JSON)

Everything builds and runs in the simulator fine ... but when I attempt to run on device I get:
"arm-apple-darwin10-gcc-4.2.1:
..../three20/Build/Products/Debug-iphoneos/libextThree20JSON+YAJL.a:
No such file or directory"
I check that directory and indeed the file doesn't exist. It does exist in the "Debug-iphoneosimulator" though (which I guess explains why it works in the simulator).
So what gives and what can I do to correct this?
Thanks
This is fixed by adding the library via the python script from Three20. Do this in the command line:
python src/scripts/ttmodule.py -p ~/MyApp/MyApp.xcodeproj -c Debug -c Release extThree20JSON:extThree20JSON+SBJSON
OR
python src/scripts/ttmodule.py -p ~/MyApp/MyApp.xcodeproj -c Debug -c Release extThree20JSON:extThree20JSON+YAJL
depending on which library you need.
Are you building libextThree20JSON+YAJL.a from source, or did you just copy that .a file into your project? If the latter, the problem is probably that it is built for your computer's architecture (probably i386 or x86_64) and not ARM, what the iPhone/iPad use. To work on the device you need to either add the ARM-built version to your project, or add the library's source to your project so that it will automatically be built for the correct architecture with the rest of your code.
I switched from SBJSON to YAJL and for me a Clean Build Folder helped.