mirror of
https://github.com/LineageOS/android_device_xiaomi_vermeer.git
synced 2026-06-20 18:19:35 +00:00
vermeer: Switch to python extract-utils
Change-Id: Ia6ea2ea79cb3bcbcbf06f0e6660ac31ea576b524
This commit is contained in:
66
extract-files.py
Executable file
66
extract-files.py
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/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
|
||||
|
||||
|
||||
from extract_utils.fixups_blob import (
|
||||
blob_fixup,
|
||||
blob_fixups_user_type,
|
||||
)
|
||||
from extract_utils.fixups_lib import (
|
||||
lib_fixup_vendorcompat,
|
||||
lib_fixups_user_type,
|
||||
libs_proto_3_9_1,
|
||||
)
|
||||
from extract_utils.main import (
|
||||
ExtractUtils,
|
||||
ExtractUtilsModule,
|
||||
)
|
||||
|
||||
namespace_imports = [
|
||||
'device/xiaomi/sm8550-common',
|
||||
'hardware/qcom-caf/sm8550',
|
||||
'hardware/xiaomi',
|
||||
'vendor/qcom/opensource/commonsys-intf/display',
|
||||
'vendor/xiaomi/sm8550-common',
|
||||
]
|
||||
|
||||
lib_fixups: lib_fixups_user_type = {
|
||||
libs_proto_3_9_1: lib_fixup_vendorcompat,
|
||||
}
|
||||
|
||||
blob_fixups: blob_fixups_user_type = {
|
||||
(
|
||||
'odm/etc/camera/enhance_motiontuning.xml',
|
||||
'odm/etc/camera/night_motiontuning.xml',
|
||||
'odm/etc/camera/motiontuning.xml'
|
||||
): blob_fixup()
|
||||
.regex_replace('xml=version', 'xml version'),
|
||||
(
|
||||
'odm/lib64/libxmi_high_dynamic_range_cdsp.so',
|
||||
'odm/lib64/libailab_rawhdr.so'
|
||||
): blob_fixup()
|
||||
.strip_debug_sections(),
|
||||
'odm/lib64/libwrapper_dlengine.so' : blob_fixup()
|
||||
.add_needed('liblog.so'),
|
||||
}
|
||||
|
||||
module = ExtractUtilsModule(
|
||||
'vermeer',
|
||||
'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, 'sm8550-common', module.vendor
|
||||
)
|
||||
utils.run()
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017-2020 The LineageOS Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function blob_fixup() {
|
||||
case "${1}" in
|
||||
esac
|
||||
}
|
||||
|
||||
# If we're being sourced by the common script that we called,
|
||||
# stop right here. No need to go down the rabbit hole.
|
||||
if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
export DEVICE=vermeer
|
||||
export DEVICE_COMMON=sm8550-common
|
||||
export VENDOR=xiaomi
|
||||
|
||||
"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"
|
||||
1
setup-makefiles.py
Executable file
1
setup-makefiles.py
Executable file
@@ -0,0 +1 @@
|
||||
#!./extract-files.py --regenerate_makefiles
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2016 The CyanogenMod Project
|
||||
# Copyright (C) 2017-2020 The LineageOS Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
function vendor_imports() {
|
||||
cat << EOF >> "$1"
|
||||
"device/xiaomi/sm8550-common",
|
||||
"hardware/qcom-caf/sm8550",
|
||||
"hardware/xiaomi",
|
||||
"vendor/qcom/opensource/commonsys-intf/display",
|
||||
EOF
|
||||
}
|
||||
|
||||
# If we're being sourced by the common script that we called,
|
||||
# stop right here. No need to go down the rabbit hole.
|
||||
if [ "${BASH_SOURCE[0]}" != "${0}" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
export DEVICE=vermeer
|
||||
export DEVICE_COMMON=sm8550-common
|
||||
export VENDOR=xiaomi
|
||||
|
||||
"./../../${VENDOR}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"
|
||||
Reference in New Issue
Block a user