Post Reply

Blob utility for AOSP-based ROMs

OP JackpotClavin

25th June 2014, 02:22 PM   |  #1  
JackpotClavin's Avatar
OP Recognized Developer
New York
Thanks Meter: 2,762
 
888 posts
Join Date:Joined: Feb 2011
Donate to Me
https://github.com/JackpotClavin/Android-Blob-Utility

The purpose of this program is to help AOSP-based ROM developers quickly and easily find out which proprietary blobs need to be copied into the ROMs build, or built using source. How the program works is you do a /system dump into a folder on a Linux computer. Then you make the program using the 'make' command; then you can run it.

First off, the program will ask you what the sdk version of the /system dump you pulled happens to be. For example, if your /system dump is Android 4.3, and intend port a 4.3-based ROM, then enter 18 and press enter.

When it prompts you for location of the /system dump you pulled. if the location of the build.prop of the /system dump is under:
Code:
/home/user/backup/dump/system/build.prop
then just use:
Code:
/home/user/backup/dump/system
The utility then will ask you how many files you wish to run through the program. In the case of my LG G2, the KitKat build requires two main proprietary camera-related libraries to run (/system/bin/mm-qcamera-daemon and
/system/lib/hw/camera.msm8974.so).

So I typed in 2 and pressed enter (because I'm running two proprietary files through the program)
Then simply typed in:
Code:
/home/user/backup/dump/system/bin/mm-qcamera-daemon
and pressed enter and it printed out *every* proprietary file needed to get /system/bin/mm-qcamera-daemon running.

Then it asked for the final proprietary file, so I simply typed in:
Code:
/home/user/backup/dump/system/lib/hw/camera.msm8974.so
and pressed enter and it printed out every* proprietary file needed to get /system/lib/hw/camera.msm8974.so running.

An example usage of this program can be found here: https://raw.githubusercontent.com/Ja...mple_Usage.txt
That's 92 proprietary blobs done in a flash!

The beauty of this program is that it's recursive, so if proprietary file 'A' needs proprietary file 'B' to run, but proprietary file 'B' needs proprietary file 'C' to run, which in turn needs 'D' to run, then simply entering proprietary file A to run will print out all A, B, C, and D nicely formatted so that you can simply 'find and replace' the name of your device's manufacturer and device's codename and put that in the vendor/manufacturer/codename/codename-vendor-blobs.mk file in your AOSP build source tree's root.

Another great thing about this program is that it doesn't just catch the libraries needed to satisfy the linker, but rather, it will also print out those libraries that are called within the actual code of the library itself, like:
Code:
dlopen("libfoo.so", RTLD_NOW);
libfoo.so is not marked as a shared library, so the linker won't complain that libfoo.so is missing, and there might be no sign that libfoo.so missing and needed, but when it's time for the daemon or library to run, it won't show any sign that something is wrong, until you see that it doesn't work. This program will catch and display that libfoo.so is needed.

So basically:
1. Extract /system dump image
2. Tell program the sdk version of your /system dump
3. Tell program location of /system dump
4. Tell program how many files you wish to run through the utility
5. Tell program the location of the file(s) you wish to run through the program.
6. Copy the output of the utility to a text file, and 'find and replace' "manufacturer/device" with the manufacturer and name of the device you wish to build an AOSP-based ROM to. (i.e. I would 'find and replace' "manufacturer/device" with "lge/vs980" for my Verizon LG G2)
Last edited by JackpotClavin; 12th August 2014 at 02:16 AM.
The Following 8 Users Say Thank You to JackpotClavin For This Useful Post: [ View ]
25th June 2014, 02:23 PM   |  #2  
JackpotClavin's Avatar
OP Recognized Developer
New York
Thanks Meter: 2,762
 
888 posts
Join Date:Joined: Feb 2011
Donate to Me
reserve
The Following 2 Users Say Thank You to JackpotClavin For This Useful Post: [ View ]
30th August 2014, 10:24 AM   |  #3  
mitchum67's Avatar
Member
Thanks Meter: 21
 
63 posts
Join Date:Joined: Jun 2009
More
Hi,

I'm a noob and don't worry about my silly question.
I'm trying to build my first cm-rom and tested your tool. Thanks a lot for your work, it worked for me.
I'm a little bit curios about your point 5. Where can I find all the files I need for my own source-tree/device?

It would be nice if you can give me a hint.

Thanks a lot and greetings from germany
Last edited by mitchum67; 30th August 2014 at 10:33 AM. Reason: correction
The Following User Says Thank You to mitchum67 For This Useful Post: [ View ]
1st September 2014, 05:10 PM   |  #4  
JackpotClavin's Avatar
OP Recognized Developer
New York
Thanks Meter: 2,762
 
888 posts
Join Date:Joined: Feb 2011
Donate to Me
Greetings from the US

Do you mean the device folder the ROM? You can look at similar devices to your device and see what they did and make the changes to build Android.

This is the device folder for the Nexus 5 -> https://android.googlesource.com/device/lge/hammerhead
16th October 2014, 11:12 PM   |  #5  
Senior Member
Thanks Meter: 982
 
859 posts
Join Date:Joined: Jun 2012
More
This tool is under-recognized. I think it's a really great way to find which blobs are dependencies!
The Following User Says Thank You to Codename13 For This Useful Post: [ View ]
17th October 2014, 01:54 AM   |  #6  
JackpotClavin's Avatar
OP Recognized Developer
New York
Thanks Meter: 2,762
 
888 posts
Join Date:Joined: Feb 2011
Donate to Me
Quote:
Originally Posted by Codename13

This tool is under-recognized. I think it's a really great way to find which blobs are dependencies!

Thanks! Are you developing a ROM? Let me know if it helps!

Sent from my LG-VS980 using XDA Free mobile app
Last edited by JackpotClavin; 17th October 2014 at 12:30 PM.
Post Reply Subscribe to Thread

Tags
aosp, blob, build, proprietary, rom
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Top Threads in Android Software and Hacking General [Developers Only] by ThreadRank