blob: 5a5143f4d9623dcfc415d50c5c3c47d25c884ad4 [file] [log] [blame]
Michael Bestasc3a1fe52024-11-03 07:33:51 +02001#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
2#
3# SPDX-FileCopyrightText: 2024 The LineageOS Project
4# SPDX-License-Identifier: Apache-2.0
5#
6
7from extract_utils.fixups_blob import (
8 blob_fixup,
9 blob_fixups_user_type,
10)
11from extract_utils.fixups_lib import (
12 lib_fixup_remove,
LuK133763177662024-11-06 11:56:59 +010013 lib_fixups,
Michael Bestasc3a1fe52024-11-03 07:33:51 +020014 lib_fixups_user_type,
Michael Bestasc3a1fe52024-11-03 07:33:51 +020015)
16from extract_utils.main import (
17 ExtractUtils,
18 ExtractUtilsModule,
19)
20
21namespace_imports = [
22 'device/shift/otter',
23 'hardware/qcom-caf/sm8350',
24 'hardware/qcom-caf/wlan',
25 'vendor/qcom/opensource/commonsys/display',
26 'vendor/qcom/opensource/commonsys-intf/display',
27 'vendor/qcom/opensource/dataservices',
28 'vendor/qcom/opensource/display',
29]
30
31
32def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
33 return f'{lib}_{partition}' if partition == 'vendor' else None
34
35
36lib_fixups: lib_fixups_user_type = {
LuK133763177662024-11-06 11:56:59 +010037 **lib_fixups,
Michael Bestasc3a1fe52024-11-03 07:33:51 +020038 (
39 'com.qualcomm.qti.dpm.api@1.0',
40 'libmmosal',
41 'vendor.qti.hardware.wifidisplaysession@1.0',
42 'vendor.qti.imsrtpservice@3.0',
43 ): lib_fixup_vendor_suffix,
44 (
45 'libOmxCore',
46 'libwpa_client',
47 ): lib_fixup_remove,
48}
49
50blob_fixups: blob_fixups_user_type = {
51 'system_ext/lib/libwfdmmsrc_system.so': blob_fixup()
52 .add_needed('libgui_shim.so'),
53 'system_ext/lib/libwfdservice.so': blob_fixup()
54 .replace_needed('android.media.audio.common.types-V2-cpp.so', 'android.media.audio.common.types-V3-cpp.so'),
55 'system_ext/lib64/libwfdnative.so': blob_fixup()
56 .replace_needed('android.hidl.base@1.0.so', 'libhidlbase.so')
57 .add_needed('libinput_shim.so'),
58 'vendor/lib64/hw/fingerprint.lahaina.so': blob_fixup()
59 .fix_soname(),
60 'vendor/lib64/libwvhidl.so': blob_fixup()
61 .add_needed('libcrypto_shim.so'),
62} # fmt: skip
63
64module = ExtractUtilsModule(
65 'otter',
66 'shift',
67 blob_fixups=blob_fixups,
68 lib_fixups=lib_fixups,
69 namespace_imports=namespace_imports,
70 add_firmware_proprietary_file=True,
71)
72
73if __name__ == '__main__':
74 utils = ExtractUtils.device(module)
75 utils.run()