device_xiaomi_sweet/extract-files.py

53 lines
1.3 KiB
Python
Raw Normal View History

#!/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 = [
'hardware/qcom-caf/sm8150',
'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'),
} # 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()