From 9b1b6eb627ac5ba8ab8b66c40eb48ce6db8f7426 Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Sun, 1 Sep 2019 17:30:54 +0200 Subject: [PATCH] hexedit firmware blobs on extraction Change-Id: Ided61348c92ed78072d3f77eb01a44c1fb3c5658 --- extract-files.sh | 17 +++++++++++++++++ proprietary-files.txt | 6 ++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 938c10c..91d37b9 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -65,4 +65,21 @@ setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" true "${CLEAN_VENDOR}" extract "${MY_DIR}/proprietary-files.txt" "${SRC}" \ "${KANG}" --section "${SECTION}" +# Fix proprietary blobs +BLOB_ROOT="$LINEAGE_ROOT"/vendor/"$VENDOR"/"$DEVICE"/proprietary +function patch_firmware() { + hexdump -ve '1/1 "%.2X"' $1 | \ + sed "s/40000054DEC0AD/02000014000000/g" | \ + xxd -r -p > $1.patched + + mv $1.patched $1 +} + +# remove RKP crap +patch_firmware $BLOB_ROOT/vendor/firmware/fimc_is_lib.bin +patch_firmware $BLOB_ROOT/vendor/firmware/fimc_is_rta_2l2_3h1.bin +patch_firmware $BLOB_ROOT/vendor/firmware/fimc_is_rta_2l2_imx320.bin +patch_firmware $BLOB_ROOT/vendor/firmware/fimc_is_rta_imx333_3h1.bin +patch_firmware $BLOB_ROOT/vendor/firmware/fimc_is_rta_imx333_imx320.bin + "${MY_DIR}/setup-makefiles.sh" diff --git a/proprietary-files.txt b/proprietary-files.txt index 26b9061..b0814ab 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -102,6 +102,8 @@ vendor/firmware/companion_imx333_master_setfile.bin vendor/firmware/companion_imx333_mode_setfile.bin vendor/firmware/dsm.bin vendor/firmware/dsm_tune.bin +vendor/firmware/fimc_is_lib.bin +vendor/firmware/fimc_is_rta_2l2_3h1.bin vendor/firmware/fimc_is_rta_2l2_imx320.bin vendor/firmware/fimc_is_rta_imx333_3h1.bin vendor/firmware/fimc_is_rta_imx333_imx320.bin @@ -119,7 +121,3 @@ vendor/firmware/setfile_3h1.bin vendor/firmware/setfile_imx320.bin vendor/firmware/setfile_imx333.bin vendor/firmware/vts.bin - -# Firmware - from G950FXXS5DSH5 -vendor/firmware/fimc_is_lib.bin|4cfd3ad2c85f1e32fe17bde3a3fc8b17bf2aa82c -vendor/firmware/fimc_is_rta_2l2_3h1.bin|a81e04f0fe86643c4b3f223a4840fd79a9d8e46b -- 2.20.1