Ah, now I understand why I'm confused -- Android 12 (and main for the last
year+) doesn't allow you to use PRODUCT_COPY_FILES to install binaries and
libraries: docs
<https://android.googlesource.com/platform/build/+/master/Changes.md#build_broken_elf_prebuilt_product_copy_files>.
This lets us verify that all of the needed libraries will be installed,
among other checks. Instead, you should define a prebuilt in an Android.bp
and add the name to PRODUCT_PACKAGES. Example:
in your Android.bp:
cc_prebuilt_binary {
name: "my_binary",
vendor: true,
arch: {
arm64: {
srcs: ["arm64/my_binary"]
},
},
shared_libs: ["libmylibrary"],
}
cc_prebuilt_library {
name: "libmylibrary",
vendor: true,
arch: {
arm64: {
srcs: ["arm64/libmylibrary.so"],
},
},
}
If they were built with the NDK, or use other libraries, you may need to
set `sdk_version: "30"` or `shared_libs: [...]` as appropriate.
Then to install symlinks like your original question, there is a `symlinks:
["foo"]` property, which if added to my_binary above, would install a
"/vendor/bin/foo -> /vendor/bin/my_binary" symlink whenever my_binary is
installed.
Then in your product makefile (no need to add libmylibrary, as it will get
installed as a dependency):
PRODUCT_PACKAGES += my_binary
- Dan
On Thu, Aug 26, 2021 at 10:49 AM Curt Schwaderer <[email protected]>
wrote:
> Hello - I'm building an Android 11 product and placed the application
> binaries and libraries in /vendor/bin and /vendor/lib. I also need to
> create a symbolic link in /vendor/lib to one of the library files also in
> /vendor/lib. If I try to do this in an init.<product>.rc file, it will not
> create the symbolic link because the /vendor partition is read only.
>
> I move the modules into /vendor/bin and /vendor/lib at build time using
> the COPY_FILES += macro in an aosp_<product>.mk file, but I have not found
> a way to create a symbolic link in the makefile.
>
> How and when do I create symbolic links in the /vendor partition? Please
> provide an example if possible.
>
> Thanks!
> Curt
>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/android-building/4a4400a8-2653-48c3-ad52-ba9470879304n%40googlegroups.com
> <https://groups.google.com/d/msgid/android-building/4a4400a8-2653-48c3-ad52-ba9470879304n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
--
You received this message because you are subscribed to the "Android Building"
mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/android-building/CALQgHd%3DuN4UGA1DtSw2FfJqJW7a2TBOBpYZ6ZyxQyCnpBumaAQ%40mail.gmail.com.