xpeng: Switch to python extract-utils

Change-Id: Ida4b83459d9739ac880b26a91df974e1db8423e9
This commit is contained in:
Michael Bestas
2024-11-03 07:33:51 +02:00
committed by Marc Bourgoin
parent 5faef5f578
commit 2322b118c9
4 changed files with 50 additions and 44 deletions

49
extract-files.py Executable file
View File

@@ -0,0 +1,49 @@
#!/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_star import extract_star_firmware
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 = [
'vendor/motorola/sm7325-common',
'hardware/qcom-caf/sm8350',
'hardware/qcom-caf/wlan',
'vendor/qcom/opensource/commonsys-intf/display',
'vendor/qcom/opensource/commonsys/display',
'vendor/qcom/opensource/dataservices',
'vendor/qcom/opensource/display',
]
lib_fixups: lib_fixups_user_type = {
libs_proto_3_9_1: lib_fixup_vendorcompat,
}
extract_fns: extract_fns_user_type = {
r'(bootloader|radio)\.img': extract_star_firmware,
}
module = ExtractUtilsModule(
'xpeng',
'motorola',
lib_fixups=lib_fixups,
namespace_imports=namespace_imports,
extract_fns=extract_fns,
add_firmware_proprietary_file=True,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(module, 'sm7325-common', module.vendor)
utils.run()

View File

@@ -1,22 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
# 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=xpeng
export DEVICE_COMMON=sm7325-common
export VENDOR=motorola
export VENDOR_COMMON=${VENDOR}
"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@"

1
setup-makefiles.py Executable file
View File

@@ -0,0 +1 @@
#!./extract-files.py --regenerate_makefiles

View File

@@ -1,22 +0,0 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
# 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=xpeng
export DEVICE_COMMON=sm7325-common
export VENDOR=motorola
export VENDOR_COMMON=${VENDOR}
"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"