How to integrate pre-compiled binaries into AOSP Android build?

3.3k Views Asked by At

I have to modify my AOSP build so that it includes the following pre-compiled (arm64) binaries and library.

/system/bin/chat
/system/etc/ppp/ip-up
/system/etc/ppp/ip-down
/vendor/lib/libreference-ril.so

Where can I put these files in AOSP so that they end up in their proper locations?

1

There are 1 best solutions below

0
Mykola Khyliuk On

You need to use the following SOONG commands: cc_prebuilt_binary, prebuilt_etc and cc_prebuilt_library_shared.

Examples of theirs usage can be easily found in AOSP tree, e.g. for cc_prebuilt_binary:

grep -irn cc_prebuilt_binary --include=Android.bp
...
system/core/logcat/Android.bp:54:cc_prebuilt_binary {
...

From system/core/logcat/Android.bp:

cc_prebuilt_binary {
    name: "logpersist.start",
    srcs: ["logpersist"],
    init_rc: ["logcatd.rc"],
    required: ["logcatd"],
    symlinks: [
        "logpersist.stop",
        "logpersist.cat",
    ],
    strip: {
        none: true,
    },
}

So, add your Android.bp with mentioned implemented commands and put it for example in /vendor/my/Android.bp (along with all prebuilt stuff) and then build AOSP.

Link to SOONG commands: https://ci.android.com/builds/submitted/7079722/linux/latest/view/soong_build.html