1

I'm trying to build LineageOS and I need to use an older VNDK version (v30) for the vendor image because this is how the manufacturer does it and I need to be able to run a few of the manufacturer's vendor binaries for hardware support.

This is supported in AOSP with Vendor Snapshots. I've successfully built the v30 snapshot zip file according the documentation using the Lineage-18.1 branch. I then move to my Lineage-20 branch and install the vendor snapshot using the command in the documentation: python3 development/vendor_snapshot/update.py --local /path/to/snapshot.zip --install-dir vendor/VENDORNAME/vendor_snapshot 30

I then try to build my vendorimage with:

BOARD_VNDK_VERSION=30 mka vendorimage

But I just get errors that indicate it can't find dependencies in the vendor snapshot.

error: hardware/interfaces/power/aidl/default/apex/Android.bp:46:1: dependency "android.hardware.power-service.example" of "com.android.hardware.power" missing variant:
  os:android,image:vendor.30,arch:arm64_armv8-2a_cortex-a75
available variants:
  os:android,image:vendor.33,arch:arm64_armv8-2a_cortex-a75 (alias to os:android,image:vendor.33,arch:arm64_armv8-2a_cortex-a75,sdk:)
  os:android,image:vendor.33,arch:arm64_armv8-2a_cortex-a75,sdk:

I've confirmed android.hardware.power-service.example is in the snapshot.

I've done enough digging into this to realize that it's not an issue with just one or two dependencies, but instead it seems like the build system isn't picking up anything from the snapshot. I can see in strace that the vendor/VENDORNAME/vendor_snapshot/v30/arm64/Android.bp file is being read by the build system, but otherwise seems like the build is behaving as if the vendor snapshot wasn't installed at all.

Is there a step I have missed in installing the snapshot?

Footnote:
Here is how android.hardware.power-service.example appears in vendor/VENDORNAME/vendor_snapshot/v30/arm64/Android.bp:

vendor_snapshot_binary {
    arch: {
        arm64: {
            src: "arch-arm64-armv8-2a/binary/android.hardware.power-service.example",
        },
    },
    compile_multilib: "64",
    init_rc: [
        "configs/power-default.rc",
    ],
    name: "android.hardware.power-service.example",
    relative_install_path: "hw",
    shared_libs: [
        "libbase",
        "libbinder_ndk",
        "android.hardware.power-ndk_platform",
        "libc++",
        "libc",
        "libm",
        "libdl",
    ],
    target_arch: "arm64",
    vendor: true,
    version: "30",
    vintf_fragments: [
        "configs/power-default.xml",
    ],
}
acker9
  • 363
  • 2
  • 11
  • I have exactly same issue, did you find any solution? – Khode_Erfan Mar 21 '23 at 17:45
  • @Khode_Erfan No, I never was able to get vendor snapshots to work. The workaround that I used was to use `setenv LD_LIBRARY_PATH` in the vendor init rc files that started up the vendor service. `setenv` is documented in https://web.archive.org/web/20221016060214/https://android.googlesource.com/platform/system/core/+/master/init/README.md. Not exactly what I call a clean solution, but it was the only thing I was able to get to work. – acker9 Mar 21 '23 at 17:57
  • ah thanks anyway, yeah i don’t need to edit any .rc file, just wanted to use the snapshot to make a full build – Khode_Erfan Mar 21 '23 at 18:04

0 Answers0