fogos: Switch to py extract utils
Change-Id: I5618bf10c107df579a540e2393b222128961e670
This commit is contained in:
parent
422e4c9bcd
commit
f70113dce1
4 changed files with 55 additions and 60 deletions
54
extract-files.py
Executable file
54
extract-files.py
Executable file
|
@ -0,0 +1,54 @@
|
||||||
|
#!/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.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/sm6375-common',
|
||||||
|
'device/motorola/sm6375-common',
|
||||||
|
'hardware/qcom-caf/common/libqti-perfd-client',
|
||||||
|
'hardware/qcom-caf/sm8350',
|
||||||
|
'hardware/qcom-caf/wlan',
|
||||||
|
'hardware/motorola',
|
||||||
|
'vendor/qcom/opensource/commonsys/display',
|
||||||
|
'vendor/qcom/opensource/commonsys-intf/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 = {
|
||||||
|
('vendor/lib/libmot_chi_desktop_helper.so', 'vendor/lib64/libmot_chi_desktop_helper.so'): blob_fixup()
|
||||||
|
.add_needed('libgui_shim_vendor.so'),
|
||||||
|
} # fmt: skip
|
||||||
|
|
||||||
|
module = ExtractUtilsModule(
|
||||||
|
'fogos',
|
||||||
|
'motorola',
|
||||||
|
namespace_imports=namespace_imports,
|
||||||
|
blob_fixups=blob_fixups,
|
||||||
|
lib_fixups=lib_fixups,
|
||||||
|
add_firmware_proprietary_file=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
utils = ExtractUtils.device_with_common(module, 'sm6375-common', module.vendor)
|
||||||
|
utils.run()
|
|
@ -1,38 +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/libmot_chi_desktop_helper.so | vendor/lib64/libmot_chi_desktop_helper.so)
|
|
||||||
[ "$2" = "" ] && return 0
|
|
||||||
grep -q "libgui_shim_vendor.so" "${2}" || "${PATCHELF}" --add-needed "libgui_shim_vendor.so" "${2}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
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=fogos
|
|
||||||
export DEVICE_COMMON=sm6375-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=fogos
|
|
||||||
export DEVICE_COMMON=sm6375-common
|
|
||||||
export VENDOR=motorola
|
|
||||||
export VENDOR_COMMON=${VENDOR}
|
|
||||||
|
|
||||||
"./../../${VENDOR_COMMON}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"
|
|
Loading…
Reference in a new issue