salami: Adopt Python extract utils

Change-Id: Ie9d629ab91bae60a1b9a60e62477de60ea2973f6
This commit is contained in:
Bruno Martins
2024-10-18 18:36:48 +01:00
parent 87cc5def5f
commit 3d2593ecee
4 changed files with 39 additions and 42 deletions

38
extract-files.py Executable file
View File

@@ -0,0 +1,38 @@
#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
#
# SPDX-FileCopyrightText: 2024 The LineageOS Project
# SPDX-License-Identifier: Apache-2.0
#
from extract_utils.fixups_blob import (
blob_fixup,
blob_fixups_user_type,
)
from extract_utils.main import (
ExtractUtils,
ExtractUtilsModule,
)
namespace_imports = [
'vendor/oneplus/sm8550-common',
]
blob_fixups: blob_fixups_user_type = {
'odm/etc/camera/CameraHWConfiguration.config': blob_fixup()
.regex_replace('SystemCamera = 0; 0; 0; 1; 0; 1;', 'SystemCamera = 0; 0; 0; 0; 0; 0;')
} # fmt: skip
module = ExtractUtilsModule(
'salami',
'oneplus',
namespace_imports=namespace_imports,
blob_fixups=blob_fixups,
check_elf=True,
add_firmware_proprietary_file=True,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(
module, 'sm8550-common', module.vendor
)
utils.run()

View File

@@ -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=salami
export DEVICE_COMMON=sm8550-common
export VENDOR=oneplus
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,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=salami
export DEVICE_COMMON=sm8550-common
export VENDOR=oneplus
export VENDOR_COMMON=${VENDOR}
"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"