-
Notifications
You must be signed in to change notification settings - Fork 12
/
extract-files.py
executable file
·69 lines (62 loc) · 1.76 KB
/
extract-files.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
import extract_utils.tools
extract_utils.tools.DEFAULT_PATCHELF_VERSION = '0_18'
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/xiaomi/sm8450-common',
'hardware/qcom-caf/sm8450',
'hardware/xiaomi',
'vendor/qcom/opensource/commonsys-intf/display',
'vendor/xiaomi/sm8450-common',
]
lib_fixups: lib_fixups_user_type = {
**lib_fixups,
(
'libagmclient',
'libagmmixer',
): lib_fixup_remove,
}
blob_fixups: blob_fixups_user_type = {
(
'vendor/etc/camera/mondrian_enhance_motiontuning.xml',
'vendor/etc/camera/mondrian_motiontuning.xml',
): blob_fixup().regex_replace('xml=version', 'xml version'),
'vendor/etc/camera/pureView_parameter.xml': blob_fixup().regex_replace(
r'=([0-9]+)>', r'="\1">'
),
'vendor/lib64/libcamximageformatutils.so': blob_fixup().replace_needed(
'vendor.qti.hardware.display.config-V2-ndk_platform.so',
'vendor.qti.hardware.display.config-V2-ndk.so',
),
}
module = ExtractUtilsModule(
'mondrian',
'xiaomi',
blob_fixups=blob_fixups,
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
check_elf=True,
add_firmware_proprietary_file=True,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(
module, 'sm8450-common', module.vendor
)
utils.run()