Help, AOSP 12 add binary file

378 views
Skip to first unread message

willing tong

unread,
Jul 22, 2024, 8:05:29 PM7/22/24
to Android Building
I want add binary file into AOSP with build. But now there are some problems,
ubuntu@ubuntu-System-Product-Name:~/Android_12_AOSP$ pwd
/home/ubuntu/Android_12_AOSP
1. add this two line in the device/google/coral/device.mk  file with end 
ubuntu@ubuntu-System-Product-Name:~/Android_12_AOSP$ cat device/google/coral/device.mk | tail -2
PRODUCT_COPY_FILES += \
   prebuilts/planx/planx-encrypt:system/xbin/planx-encrypt


2. use "m" build response 
[ 90% 194/214] including system/sepolicy/Android.mk ...
system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS instead.
system/sepolicy/Android.mk:62: warning: BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.
[ 99% 213/214] finishing build rules ...
FAILED:
build/make/core/artifact_path_requirements.mk:26: warning:  device/google/coral/aosp_flame.mk produces files inside build/make/target/product/generic_system.mks artifact path requirement.
Offending entries:
system/xbin/planx-encrypt
In file included from build/make/core/main.mk:1342:
build/make/core/artifact_path_requirements.mk:26: error: Build failed.
19:37:07 ckati failed with: exit status 1

#### failed to build some targets (20 seconds) ####

Can someone help me ?

Mattijs Korpershoek

unread,
Jul 23, 2024, 6:38:18 PM7/23/24
to willing tong, Android Building
Hi,

On lun., juil. 22, 2024 at 04:38, willing tong <[email protected]> wrote:

> I want add binary file into AOSP with build. But now there are some
> problems,
>
> *ubuntu@ubuntu-System-Product-Name:~/Android_12_AOSP$
> pwd/home/ubuntu/Android_12_AOSP*
> *1. add this two line in the device/google/coral/device.mk file with end *
>
>
> *ubuntu@ubuntu-System-Product-Name:~/Android_12_AOSP$ cat
> device/google/coral/device.mk | tail -2PRODUCT_COPY_FILES += \
> prebuilts/planx/planx-encrypt:system/xbin/planx-encrypt*
>
> *2. use "m" build response *
>
>
>
>
>
>
>
>
>
>
>
>
>
> *[ 90% 194/214] including system/sepolicy/Android.mk
> ...system/sepolicy/Android.mk:57: warning: BOARD_PLAT_PUBLIC_SEPOLICY_DIR
> has been deprecated. Use SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS
> instead.system/sepolicy/Android.mk:62: warning:
> BOARD_PLAT_PRIVATE_SEPOLICY_DIR has been deprecated. Use
> SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS instead.[ 99% 213/214] finishing build
> rules ...FAILED: build/make/core/artifact_path_requirements.mk:26: warning:
> device/google/coral/aosp_flame.mk produces files inside
> build/make/target/product/generic_system.mks artifact path requirement.
> Offending entries:system/xbin/planx-encryptIn file included from
> build/make/core/main.mk:1342:build/make/core/artifact_path_requirements.mk:26:
> error: Build failed.19:37:07 ckati failed with: exit status 1#### failed to
> build some targets (20 seconds) ####*
>
> *Can someone help me ?*

Have you considered using cc_prebuilt_binary instead?

For an example, see:
https://cs.android.com/android/platform/superproject/main/+/main:device/linaro/poplar/proprietary/hisilicon/Android.bp;l=76?q=cc_prebuilt_binary&start=11

>
> --
> --
> 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
> https://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/7c5300d6-2849-41cc-9a27-b2a66b4ed733n%40googlegroups.com.

Dan Willemsen

unread,
Jul 23, 2024, 7:27:38 PM7/23/24
to [email protected], willing tong
While using cc_prebuilt_binary is a good idea, and may fix other errors (since ELF binaries aren't supposed to be in PRODUCT_COPY_FILES), it won't solve this particular issue.

The issue here is that aosp_flame inherits from generic_system, and generic_system claims to be generic -- it doesn't allow device custom modules to be installed in /system. The easy solution is to install it into /system-ext/bin/... or /product/bin/... instead (xbin isn't really used anymore as far as I know). To do this with the cc_prebuilt_binary, just set `system_ext_specific: true` or `product_specific: true`

- Dan

Reply all
Reply to author
Forward
0 new messages