blob: 0cb015556ea092f6f60b0da6687d24d7edde8171 [file] [log] [blame]
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
from extract_utils.fixups_blob import (
blob_fixup,
blob_fixups_user_type,
)
from extract_utils.fixups_lib import (
lib_fixup_remove,
lib_fixups,
lib_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
'device/shift/axolotl',
'hardware/qcom-caf/sdm845',
'hardware/qcom-caf/wlan',
'vendor/qcom/opensource/dataservices',
'vendor/qcom/opensource/display',
]
def lib_fixup_vendor_suffix(lib: str, partition: str, *args, **kwargs):
return f'{lib}_{partition}' if partition == 'vendor' else None
lib_fixups: lib_fixups_user_type = {
**lib_fixups,
(
'com.qualcomm.qti.ant@1.0',
'com.qualcomm.qti.dpm.api@1.0',
'vendor.qti.hardware.fm@1.0',
): lib_fixup_vendor_suffix,
(
'libOmxCore',
'libril',
'libwpa_client',
): lib_fixup_remove,
}
blob_fixups: blob_fixups_user_type = {
'odm/lib64/hw/fingerprint.sdm845.so': blob_fixup()
.fix_soname(),
'system_ext/lib64/lib-imsvideocodec.so': blob_fixup()
.add_needed('libgui_shim.so')
.add_needed('libui_shim.so'),
('vendor/lib/libwvhidl@1.3.so', 'vendor/lib64/libwvhidl@1.3.so'): blob_fixup()
.add_needed('libcrypto_shim.so'),
'vendor/lib64/hw/camera.qcom.so': blob_fixup()
.add_needed('libcomparetf2_shim.so'),
'vendor/lib64/libvendor.goodix.hardware.biometrics.fingerprint@2.1.so': blob_fixup()
.replace_needed('libhidlbase.so', 'ibhidlbase-v32.so'),
} # fmt: skip
module = ExtractUtilsModule(
'axolotl',
'shift',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
add_firmware_proprietary_file=True,
)
module.add_proprietary_file('proprietary-files-widevine.txt')
if __name__ == '__main__':
utils = ExtractUtils.device(module)
utils.run()