From 30e229f07298a324f1c8c93399d77d83f5fdc1db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rard=20Parat?= Date: Tue, 7 Jan 2025 22:56:58 +0100 Subject: [PATCH] perseus: Switch to python extract-utils Change-Id: I2e08e4c3dde64fcf9f7f9692d7f85dfe32c17249 --- extract-files.py | 25 +++++++++++++++++++++++++ extract-files.sh | 30 ------------------------------ setup-makefiles.py | 1 + setup-makefiles.sh | 21 --------------------- 4 files changed, 26 insertions(+), 51 deletions(-) create mode 100755 extract-files.py delete mode 100755 extract-files.sh create mode 100755 setup-makefiles.py delete mode 100755 setup-makefiles.sh diff --git a/extract-files.py b/extract-files.py new file mode 100755 index 0000000..0808271 --- /dev/null +++ b/extract-files.py @@ -0,0 +1,25 @@ +#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3 +# +# SPDX-FileCopyrightText: 2025 The LineageOS Project +# SPDX-License-Identifier: Apache-2.0 +# + +from extract_utils.main import ( + ExtractUtils, + ExtractUtilsModule, +) + +namespace_imports = [ + 'vendor/xiaomi/sdm845-common' +] + +module = ExtractUtilsModule( + 'perseus', + 'xiaomi', + namespace_imports=namespace_imports, + check_elf=False, +) + +if __name__ == '__main__': + utils = ExtractUtils.device_with_common(module, 'sdm845-common', module.vendor) + utils.run() diff --git a/extract-files.sh b/extract-files.sh deleted file mode 100755 index 30dac92..0000000 --- a/extract-files.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -# -# SPDX-FileCopyrightText: 2016 The CyanogenMod Project -# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project -# SPDX-License-Identifier: Apache-2.0 -# - -function blob_fixup() { - case "${1}" in - vendor/lib/hw/com.qti.chi.override.so) - [ "$2" = "" ] && return 0 - sed -i -e 's/camera.xiaomi.remapid/vendor.camera.remapid/' "${2}" - ;; - 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=perseus -export DEVICE_COMMON=sdm845-common -export VENDOR=xiaomi -export VENDOR_COMMON=${VENDOR} - -"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/extract-files.sh" "$@" diff --git a/setup-makefiles.py b/setup-makefiles.py new file mode 100755 index 0000000..32947cf --- /dev/null +++ b/setup-makefiles.py @@ -0,0 +1 @@ +#!./extract-files.py --regenerate_makefiles diff --git a/setup-makefiles.sh b/setup-makefiles.sh deleted file mode 100755 index d55a1a8..0000000 --- a/setup-makefiles.sh +++ /dev/null @@ -1,21 +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=perseus -export DEVICE_COMMON=sdm845-common -export VENDOR=xiaomi -export VENDOR_COMMON=${VENDOR} - -"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"