beyondx: Switch to py extract utils

Change-Id: Ib3173d74b6bb1df32e3c3cc5c37490a950067f00
This commit is contained in:
Tim Zimmermann
2025-03-18 15:18:13 +01:00
committed by 0xsharkboy
parent 09d0983eef
commit 302a78e214
7 changed files with 107 additions and 119 deletions

View File

@@ -29,7 +29,3 @@ PRODUCT_COPY_FILES += \
# Overlays # Overlays
DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay DEVICE_PACKAGE_OVERLAYS += $(LOCAL_PATH)/overlay
# Shims
PRODUCT_PACKAGES += \
libshim_sfpex

57
extract-files.py Executable file
View File

@@ -0,0 +1,57 @@
#!/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 = [
'device/samsung/exynos9820-common',
'hardware/samsung_slsi-linaro/exynos',
'hardware/samsung_slsi-linaro/graphics',
'vendor/samsung/exynos9820-common',
]
blob_fixups: blob_fixups_user_type = {
(
'vendor/bin/vaultkeeperd',
'vendor/lib64/libvkservice.so'
): blob_fixup()
.binary_regex_replace(b'ro.factory.factory_binary', b'ro.vendor.factory_binary\x00'),
'vendor/lib64/libexynoscamera3.so': blob_fixup()
.sig_replace('8B 02 20 36', '1F 20 03 D5'),
(
'vendor/lib/sensors.bio.so',
'vendor/lib/sensors.sensorhub.so',
'vendor/lib64/sensors.bio.so',
'vendor/lib64/sensors.sensorhub.so',
): blob_fixup()
.remove_needed('libhidltransport.so')
.add_needed('libutils-v32.so')
.binary_regex_replace(b'_ZN7android6Thread3runEPKcim', b'_ZN7utils326Thread3runEPKcim'),
'vendor/lib64/libiu456_datapath_processor.so': blob_fixup()
.add_needed('libshim_sfpex.so')
.replace_needed('libOpenCL.so', 'libGLES_mali.so'),
} # fmt: skip
module = ExtractUtilsModule(
'beyondx',
'samsung',
namespace_imports=namespace_imports,
add_firmware_proprietary_file=True,
blob_fixups=blob_fixups,
)
if __name__ == '__main__':
utils = ExtractUtils.device_with_common(
module, 'exynos9820-common', module.vendor
)
utils.run()

View File

@@ -1,41 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
function blob_fixup() {
case "${1}" in
vendor/bin/vaultkeeperd|vendor/lib64/libvkservice.so)
sed -i 's/ro\.factory\.factory_binary/ro.vendor.factory_binary\x00/g' "${2}"
;;
vendor/lib64/libexynoscamera3.so)
xxd -p "${2}" | sed "s/8b022036/1f2003d5/g" | xxd -r -p > "${2}".patched
mv "${2}".patched "${2}"
;;
vendor/lib*/sensors.*.so)
"${PATCHELF}" --remove-needed libhidltransport.so "${2}"
"${PATCHELF}" --replace-needed libutils.so libutils-v32.so "${2}"
sed -i 's/_ZN7android6Thread3runEPKcim/_ZN7utils326Thread3runEPKcim/g' "${2}"
;;
vendor/lib64/libiu456_datapath_processor.so)
"${PATCHELF}" --add-needed libshim_sfpex.so "${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=beyondx
export DEVICE_COMMON=exynos9820-common
export VENDOR=samsung
"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"

View File

@@ -2,7 +2,7 @@
## Audio - Dolby Atmos ## Audio - Dolby Atmos
vendor/etc/dolby/dax-default.xml vendor/etc/dolby/dax-default.xml
-vendor/lib/soundfx/libswdap.so vendor/lib/soundfx/libswdap.so
## Audio Firmware ## Audio Firmware
vendor/firmware/APBargeIn_AUDIO_SLSI.bin vendor/firmware/APBargeIn_AUDIO_SLSI.bin
@@ -25,14 +25,12 @@ vendor/firmware/bcm4375B1_semco.hcd
vendor/firmware/bcm4375B1_semco_sem.hcd vendor/firmware/bcm4375B1_semco_sem.hcd
## Camera - from beyondx - G977BXXSBGVA9 ## Camera - from beyondx - G977BXXSBGVA9
-vendor/lib64/hw/camera.exynos9820.so|70b3b988b1150ce19c2c85b17c5975135b26fae5 vendor/lib64/hw/camera.exynos9820.so|70b3b988b1150ce19c2c85b17c5975135b26fae5
-vendor/lib64/libexynoscamera3.so|607a78931c82a84ff73987150368b76a491248dc vendor/lib64/libexynoscamera3.so|607a78931c82a84ff73987150368b76a491248dc|607a78931c82a84ff73987150368b76a491248dc
## Camera dependencies ## Camera dependencies
-vendor/lib/libTOFProc_interface.so vendor/lib64/libTOFProc_interface.so
-vendor/lib/libiu456_datapath_processor.so vendor/lib64/libiu456_datapath_processor.so
-vendor/lib64/libTOFProc_interface.so
-vendor/lib64/libiu456_datapath_processor.so
## Camera Firmware ## Camera Firmware
vendor/firmware/fimc_is_fw_mcu.bin vendor/firmware/fimc_is_fw_mcu.bin
@@ -43,10 +41,8 @@ vendor/firmware/fimc_is_rta.bin
vendor/etc/media_codecs_performance.xml vendor/etc/media_codecs_performance.xml
## Fingerprint ## Fingerprint
-vendor/lib/libbauthserver.so vendor/lib64/libbauthserver.so
-vendor/lib/libbauthtzcommon.so vendor/lib64/libbauthtzcommon.so
-vendor/lib64/libbauthserver.so
-vendor/lib64/libbauthtzcommon.so
## Firmware ## Firmware
vendor/firmware/bidirmic.bin vendor/firmware/bidirmic.bin
@@ -72,19 +68,19 @@ vendor/firmware/txse3.bin
vendor/firmware/vts.bin vendor/firmware/vts.bin
## Gatekeeper ## Gatekeeper
-vendor/lib/hw/gatekeeper.exynos9820.so vendor/lib/hw/gatekeeper.exynos9820.so
-vendor/lib64/hw/gatekeeper.exynos9820.so vendor/lib64/hw/gatekeeper.exynos9820.so
## GPS ## GPS
-vendor/bin/hw/gpsd vendor/bin/hw/gpsd
-vendor/bin/hw/vendor.samsung.hardware.gnss@2.0-service vendor/bin/hw/vendor.samsung.hardware.gnss@2.0-service
vendor/etc/gnss/gps.xml vendor/etc/gnss/gps.xml
vendor/etc/init/init.gps.rc vendor/etc/init/init.gps.rc
vendor/etc/init/vendor.samsung.hardware.gnss@2.0-service.rc vendor/etc/init/vendor.samsung.hardware.gnss@2.0-service.rc
-vendor/lib64/libwrappergps.so vendor/lib64/libwrappergps.so
-vendor/lib64/hw/android.hardware.gnss@2.0-impl.so vendor/lib64/hw/android.hardware.gnss@2.0-impl.so;FIX_SONAME
-vendor/lib64/hw/gps.default.so vendor/lib64/hw/gps.default.so;FIX_SONAME
-vendor/lib64/hw/vendor.samsung.hardware.gnss@2.0-impl.so vendor/lib64/hw/vendor.samsung.hardware.gnss@2.0-impl.so
## NFC ## NFC
vendor/firmware/nfc/sec_s3nrn82_firmware.bin vendor/firmware/nfc/sec_s3nrn82_firmware.bin
@@ -95,12 +91,12 @@ vendor/etc/plmn_se13.bin
vendor/etc/init/init.baseband.rc vendor/etc/init/init.baseband.rc
## Sensors ## Sensors
-vendor/bin/hw/lhd vendor/bin/hw/lhd
vendor/etc/sensor/lhd.conf vendor/etc/sensor/lhd.conf
-vendor/lib/sensors.bio.so vendor/lib/sensors.bio.so
-vendor/lib/sensors.sensorhub.so vendor/lib/sensors.sensorhub.so
-vendor/lib64/sensors.bio.so vendor/lib64/sensors.bio.so
-vendor/lib64/sensors.sensorhub.so vendor/lib64/sensors.sensorhub.so
## TEEGRIS Firmware ## TEEGRIS Firmware
vendor/tee/00000000-0000-0000-0000-000000534b4d vendor/tee/00000000-0000-0000-0000-000000534b4d
@@ -113,11 +109,11 @@ vendor/tee/00000000-0000-0000-0000-657365447276
vendor/tee/driver/00000000-0000-0000-0000-53626f786476 vendor/tee/driver/00000000-0000-0000-0000-53626f786476
## VaultKeeper ## VaultKeeper
-vendor/bin/vaultkeeperd vendor/bin/vaultkeeperd
vendor/etc/init/vaultkeeper_common.rc vendor/etc/init/vaultkeeper_common.rc
-vendor/lib64/libstork_shared.so vendor/lib64/libstork_shared.so
-vendor/lib64/libvkmanager_vendor.so vendor/lib64/libvkmanager_vendor.so
-vendor/lib64/libvkservice.so vendor/lib64/libvkservice.so
## Wi-Fi ## Wi-Fi
vendor/firmware/bcmdhd_clm.blob vendor/firmware/bcmdhd_clm.blob

View File

@@ -1,33 +1,33 @@
# Firmware for model SM-G977B - from Samsung package version G977BXXSEHWC2 # Firmware for model SM-G977B - from Samsung package version G977BXXSEHWC2
cm.bin_SM-G977B cm.bin_SM-G977B|6a1e54f519a871338ce66f57591168ad12c28419
dqmdbg.img_SM-G977B dqmdbg.img_SM-G977B|ea5c376a72a2218286b57195284251be6886747c
keystorage.bin_SM-G977B keystorage.bin_SM-G977B|ec3acf045ddbd67a8f9b727f3aafdeb93aef68fa
modem.bin_SM-G977B modem.bin_SM-G977B|9b0e67143485e285235b542af4861cfdfb2fa6c8
modem_5g.bin_SM-G977B modem_5g.bin_SM-G977B|d182f8dddd4946cce3885632b504523775a5ef54
modem_debug.bin_SM-G977B modem_debug.bin_SM-G977B|b301b5e558f292174144a74f8a94a25ba6e6f953
modem_debug_5g.bin_SM-G977B modem_debug_5g.bin_SM-G977B|12f3a7df619f34d923c0b7bf8e95e7e91d19a672
param.bin_SM-G977B param.bin_SM-G977B|9bde590fe60cab5e1d7594c5632ec0a1f3ec31cc
sboot.bin_SM-G977B sboot.bin_SM-G977B|678f038c374a1deb463764ccaed357502b5844a8
uh.bin_SM-G977B uh.bin_SM-G977B|eabdd7a5ce613a93521ceeca7a3663b554ef3128
up_param.bin_SM-G977B up_param.bin_SM-G977B|3192626a699bbb10cbc9dda1903def21309a8dd6
# Firmware for model SM-G977N - from Samsung package version G977NKSU6HWD3 # Firmware for model SM-G977N - from Samsung package version G977NKSU6HWD3
cm.bin_SM-G977N cm.bin_SM-G977N|c9decc8bcf27583c049c06272a2415aef0fbfd80
dqmdbg.img_SM-G977N dqmdbg.img_SM-G977N|c94f62e7d29e1e8febf6ed212ffdc9f295fde406
keystorage.bin_SM-G977N keystorage.bin_SM-G977N|82ea8462af9811dc8dfdd395876d11281b7d5236
modem.bin_SM-G977N modem.bin_SM-G977N|5694589c34489df095c116473e98941e69e0a305
modem_5g.bin_SM-G977N modem_5g.bin_SM-G977N|415fe0bd303c44af85c1279c3032aca004ac0580
modem_debug.bin_SM-G977N modem_debug.bin_SM-G977N|ec0bd533c6bf8366ac139923bf0d597695d4f076
modem_debug_5g.bin_SM-G977N modem_debug_5g.bin_SM-G977N|19be25a2f62c52a3158a773ef44cb5a2d0963ef9
param.bin_SM-G977N param.bin_SM-G977N|2e9b18ec8c0ffcf6a47d939f7ff2263d318cd678
sboot.bin_SM-G977N sboot.bin_SM-G977N|6a29c09387555b6b82d8e410d4bdf7c94c175c1e
uh.bin_SM-G977N uh.bin_SM-G977N|0c6b4ca515d93e236c09b02f30afcdda8972fa90
up_param.bin_SM-G977N up_param.bin_SM-G977N|c942b701f5e5fc6331d241380a60780a9df77e8b
# File containing the supported models, one per line # File containing the supported models, one per line
models models|6e52b708d06b9525eef96a6522b48584e837ef75
# Files containing Samsung package version for supported models # Files containing Samsung package version for supported models
version_SM-G977B version_SM-G977B|1faa4b909b21b39b7d2393c4bf422adb6c853493
version_SM-G977N version_SM-G977N|9c060c51755838028fdb865a819041b206c88a46

1
setup-makefiles.py Executable file
View File

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

View File

@@ -1,21 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 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=beyondx
export DEVICE_COMMON=exynos9820-common
export VENDOR=samsung
"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@"