tegu: Set up proprietary files extraction
* The proprietary files lists are generated by comparing stock partition contents with AOSP generated partitions. Co-authored-by: Aaron Kling <webgeek1234@gmail.com> Co-authored-by: Cosmin Tanislav <demonsingur@gmail.com> Co-authored-by: Michael Bestas <mkbestas@lineageos.org> Change-Id: I17b78ccf212d8364070c40fe3c7d06d4048e3fe4
This commit is contained in:
parent
c6c08338ef
commit
b544636716
16 changed files with 3869 additions and 0 deletions
96
tegu/extract-files.py
Executable file
96
tegu/extract-files.py
Executable file
|
@ -0,0 +1,96 @@
|
|||
#!/usr/bin/env -S PYTHONPATH=../../../../tools/extract-utils python3
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2024 The LineageOS Project
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
from extract_utils.extract import extract_fns_user_type
|
||||
from extract_utils.extract_pixel import (
|
||||
extract_pixel_factory_image,
|
||||
extract_pixel_firmware,
|
||||
pixel_factory_image_regex,
|
||||
pixel_firmware_regex,
|
||||
)
|
||||
from extract_utils.file import FileArgs, FileList
|
||||
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 = [
|
||||
'device/google/tegu',
|
||||
'hardware/google/av',
|
||||
'hardware/google/interfaces',
|
||||
'hardware/google/pixel',
|
||||
]
|
||||
|
||||
|
||||
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.google.edgetpu_app_service-V4-ndk',
|
||||
'com.google.edgetpu_vendor_service-V2-ndk',
|
||||
'vendor.google.whitechapel.audio.audioext@4.0',
|
||||
'vendor.google.whitechapel.audio.extension-V5-ndk',
|
||||
): lib_fixup_vendor_suffix,
|
||||
}
|
||||
|
||||
blob_fixups: blob_fixups_user_type = {
|
||||
'product/etc/felica/common.cfg': blob_fixup()
|
||||
.patch_file('osaifu-keitai.patch'),
|
||||
'vendor/etc/init/init.modem_logging_control.rc': blob_fixup()
|
||||
.regex_replace(' && property:ro.debuggable=0', ''),
|
||||
} # fmt: skip
|
||||
|
||||
extract_fns: extract_fns_user_type = {
|
||||
pixel_factory_image_regex: extract_pixel_factory_image,
|
||||
pixel_firmware_regex: extract_pixel_firmware,
|
||||
}
|
||||
|
||||
module = ExtractUtilsModule(
|
||||
'tegu',
|
||||
'google',
|
||||
device_rel_path='device/google/tegu/tegu',
|
||||
blob_fixups=blob_fixups,
|
||||
lib_fixups=lib_fixups,
|
||||
namespace_imports=namespace_imports,
|
||||
add_generated_carriersettings_file=True,
|
||||
add_firmware_proprietary_file=True,
|
||||
extract_fns=extract_fns,
|
||||
)
|
||||
|
||||
|
||||
def fix_vendor_file_list(file_list: FileList):
|
||||
module_suffix_file_paths = [
|
||||
'vendor/lib64/com.google.edgetpu_app_service-V4-ndk.so',
|
||||
'vendor/lib64/com.google.edgetpu_vendor_service-V2-ndk.so',
|
||||
'vendor/lib64/vendor.google.whitechapel.audio.audioext@4.0.so',
|
||||
'vendor/lib64/vendor.google.whitechapel.audio.extension-V5-ndk.so',
|
||||
]
|
||||
|
||||
for file_path in module_suffix_file_paths:
|
||||
file_list.get_file(file_path).set_arg(FileArgs.MODULE_SUFFIX, '_vendor')
|
||||
|
||||
|
||||
module.add_generated_proprietary_file(
|
||||
'proprietary-files-vendor.txt',
|
||||
partition='vendor',
|
||||
skip_file_list_name='skip-files-vendor.txt',
|
||||
fix_file_list=fix_vendor_file_list,
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
utils = ExtractUtils.device(module)
|
||||
utils.run()
|
Loading…
Add table
Add a link
Reference in a new issue