2024-10-13 20:00:11 -04:00
|
|
|
#!/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_fixups,
|
|
|
|
lib_fixups_user_type,
|
|
|
|
)
|
|
|
|
from extract_utils.main import (
|
|
|
|
ExtractUtils,
|
|
|
|
ExtractUtilsModule,
|
|
|
|
)
|
|
|
|
|
|
|
|
namespace_imports = [
|
2024-11-20 03:45:30 -05:00
|
|
|
'hardware/qcom-caf/sm8150',
|
2024-10-13 20:00:11 -04:00
|
|
|
'hardware/xiaomi',
|
|
|
|
'vendor/qcom/opensource/display',
|
|
|
|
'vendor/xiaomi/sm6150-common',
|
|
|
|
]
|
|
|
|
|
|
|
|
lib_fixups: lib_fixups_user_type = {
|
|
|
|
**lib_fixups,
|
|
|
|
}
|
|
|
|
|
|
|
|
blob_fixups: blob_fixups_user_type = {
|
|
|
|
'vendor/etc/init/init.batterysecret.rc': blob_fixup()
|
|
|
|
.regex_replace(' +seclabel u:r:batterysecret:s0\n', ''),
|
|
|
|
'vendor/etc/init/init.mi_thermald.rc': blob_fixup()
|
|
|
|
.regex_replace(' +seclabel u:r:mi_thermald:s0\n', ''),
|
|
|
|
'vendor/lib64/camera/components/com.qti.node.watermark.so': blob_fixup()
|
|
|
|
.add_needed('libpiex_shim.so'),
|
2024-12-10 17:07:45 -05:00
|
|
|
('vendor/lib64/libalLDC.so', 'vendor/lib64/libalhLDC.so'): blob_fixup()
|
|
|
|
.clear_symbol_version('AHardwareBuffer_allocate')
|
|
|
|
.clear_symbol_version('AHardwareBuffer_describe')
|
|
|
|
.clear_symbol_version('AHardwareBuffer_lock')
|
|
|
|
.clear_symbol_version('AHardwareBuffer_release')
|
|
|
|
.clear_symbol_version('AHardwareBuffer_unlock'),
|
|
|
|
('vendor/lib64/libarcsoft_hta.so', 'vendor/lib64/libarcsoft_super_night_raw.so', 'vendor/lib64/libhvx_interface.so', 'vendor/lib64/libmialgo_rfs.so'): blob_fixup()
|
|
|
|
.clear_symbol_version('remote_handle_close')
|
|
|
|
.clear_symbol_version('remote_handle_invoke')
|
|
|
|
.clear_symbol_version('remote_handle_open')
|
|
|
|
.clear_symbol_version('remote_handle64_close')
|
|
|
|
.clear_symbol_version('remote_handle64_invoke')
|
|
|
|
.clear_symbol_version('remote_handle64_open')
|
|
|
|
.clear_symbol_version('remote_register_buf_attr')
|
|
|
|
.clear_symbol_version('remote_register_buf')
|
|
|
|
.clear_symbol_version('rpcmem_alloc')
|
|
|
|
.clear_symbol_version('rpcmem_free')
|
|
|
|
.clear_symbol_version('rpcmem_to_fd'),
|
2024-10-13 20:00:11 -04:00
|
|
|
} # fmt: skip
|
|
|
|
|
|
|
|
module = ExtractUtilsModule(
|
|
|
|
'sweet',
|
|
|
|
'xiaomi',
|
|
|
|
blob_fixups=blob_fixups,
|
|
|
|
lib_fixups=lib_fixups,
|
|
|
|
namespace_imports=namespace_imports,
|
|
|
|
)
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
utils = ExtractUtils.device_with_common(
|
|
|
|
module, 'sm6150-common', module.vendor
|
|
|
|
)
|
|
|
|
utils.run()
|