mirror of
https://github.com/Evolution-X-Devices/device_motorola_rtwo
synced 2026-01-27 07:50:05 +00:00
rtwo: Switch to python extract-utils
Change-Id: Ida4b83459d9739ac880b26a91df974e1db8423e9
This commit is contained in:
committed by
Marc Bourgoin
parent
3712107e7b
commit
9bb7c96183
60
extract-files.py
Executable file
60
extract-files.py
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/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_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 = [
|
||||
'vendor/motorola/sm8550-common',
|
||||
'hardware/qcom-caf/sm8550',
|
||||
'hardware/qcom-caf/wlan',
|
||||
'hardware/motorola',
|
||||
'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,
|
||||
}
|
||||
|
||||
blob_fixups: blob_fixups_user_type = {
|
||||
'product/priv-app/MotCamera4/MotCamera4.apk': blob_fixup()
|
||||
.apktool_patch('MotCamera4-patches'),
|
||||
} # fmt: skip
|
||||
|
||||
extract_fns: extract_fns_user_type = {
|
||||
r'(bootloader|radio)\.img': extract_star_firmware,
|
||||
}
|
||||
|
||||
module = ExtractUtilsModule(
|
||||
'rtwo',
|
||||
'motorola',
|
||||
blob_fixups=blob_fixups,
|
||||
lib_fixups=lib_fixups,
|
||||
namespace_imports=namespace_imports,
|
||||
extract_fns=extract_fns,
|
||||
add_firmware_proprietary_file=True,
|
||||
add_generated_carriersettings=True,
|
||||
)
|
||||
|
||||
if __name__ == '__main__':
|
||||
utils = ExtractUtils.device_with_common(module, 'sm8550-common', module.vendor)
|
||||
utils.run()
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2016 The CyanogenMod Project
|
||||
# SPDX-FileCopyrightText: 2017-2024 The LineageOS Project
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
# Load extract_utils and do some sanity checks
|
||||
MY_DIR="${BASH_SOURCE%/*}"
|
||||
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
|
||||
|
||||
function blob_fixup() {
|
||||
case "${1}" in
|
||||
product/priv-app/MotCamera4/MotCamera4.apk)
|
||||
apktool_patch "${2}" "$MY_DIR/MotCamera4-patches"
|
||||
;;
|
||||
*)
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
function blob_fixup_dry() {
|
||||
blob_fixup "$1" ""
|
||||
}
|
||||
|
||||
# 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=rtwo
|
||||
export DEVICE_COMMON=sm8550-common
|
||||
export VENDOR=motorola
|
||||
export VENDOR_COMMON=${VENDOR}
|
||||
|
||||
"./../../${VENDOR_COMMON}/${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,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=rtwo
|
||||
export DEVICE_COMMON=sm8550-common
|
||||
export VENDOR=motorola
|
||||
export VENDOR_COMMON=${VENDOR}
|
||||
|
||||
"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"
|
||||
Reference in New Issue
Block a user