Crates.io | aosp-missing-blobs |
lib.rs | aosp-missing-blobs |
version | 0.5.0 |
source | src |
created_at | 2021-06-06 15:31:50.226952 |
updated_at | 2021-06-08 00:46:11.268159 |
description | A tool to identify required blobs (.so) that are missing from AOSP ROM builds, and to show which existing blobs depend on them. |
homepage | https://github.com/joshuous/aosp-missing-blobs |
repository | https://github.com/joshuous/aosp-missing-blobs |
max_upload_size | |
id | 406911 |
size | 20,372 |
aosp-missing-blobs is a nifty tool to identify required blobs (.so) that are missing from AOSP ROM builds, and to show which existing blobs rely on them. This will be particularly useful for ROM developers who want to ensure that they have not missed out any required proprietary OEM blobs.
Blobs (.so) and compiled binaries in Android need other blobs to work. It is possible to identify the dependencies for each blob by inspecting their ELF information:
$ readelf -d <name_of_blob.so> | grep "\(NEEDED\)" | sed -r "s/.*\[(.*)\]/\1/"
Example (finding the dependencies of libqti_performance.so
):
$ readelf -d libqti_performance.so | grep "\(NEEDED\)" | sed -r "s/.*\[(.*)\]/\1/"
libnativehelper.so
liblog.so
libcutils.so
libutils.so
libbase.so
vendor.qti.hardware.iop@2.0.so
libhidlbase.so
libhidltransport.so
libqti-perfd-client_system.so
libhwui.so
libc++.so
libc.so
libm.so
libdl.so
From the example, we can see that libqti_performance.so
depends on libqti-perfd-client_system.so
and vendor.qti.hardware.iop@2.0.so
.
aosp-missing-blobs uses this idea to identify all the dependencies of a given list of blobs, and to check whether any of these dependencies are not present.
You can install with cargo
after setting up Rust:
cargo install aosp-missing-blobs
aosp-missing-blobs is written in Rust, hence you'll need Rust to be installed to build the project.
In the root directory of the repo, execute:
$ git clone https://github.com/joshuous/aosp-missing-blobs
$ cd aosp-missing-blobs
$ cargo build --release
$ ./target/release/aosp-missing-blobs
A runnable aosp-missing-blobs
binary will be produced.
This program takes as arguments a list of directories that contain compiled binaries and blobs (.so).
$ aosp-missing-blobs <blob directory1> <blob directory2> <blob directory3> <blob directoryN>
Search blob directories recursively:
$ aosp-missing-blobs -r <blob root directory>
Assuming you have extracted the ROM's system.img and vendor.img to ~/system
and ~/vendor
, respectively, run the following:
$ aosp-missing-blobs ~/system/lib ~/vendor/lib
The program does the following:
~/system/lib
and ~/vendor/lib
directories for blobs.~/system/lib
and ~/vendor/lib
.Depending on how wide your search scope is, the program may flag out missing dependencies 'incorrectly'. Some dependencies may exist in other directories besides what the examples have shown. Other directories with blobs include the following:
Take note that the more directories you specify as arguments, the longer the program will run for!