From ce1234f87c51cdbf2cf6cde102981e1509f5c76f Mon Sep 17 00:00:00 2001 From: Jan Altensen Date: Sun, 1 Sep 2019 17:31:30 +0200 Subject: [PATCH] hexedit firmware blobs on extraction Change-Id: Ided61348c92ed78072d3f77eb01a44c1fb3c5658 --- extract-files.sh | 17 +++++++++++++++++ proprietary-files.txt | 12 +++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 7a72ada..a65fbf9 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 f6af23e..459a97c 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -102,6 +102,11 @@ 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 vendor/firmware/iva10_rt-kangchen.bin vendor/firmware/mfc_fw.bin vendor/firmware/nfc/sec_s3nrn82_firmware.bin @@ -117,10 +122,3 @@ vendor/firmware/setfile_3m3.bin vendor/firmware/setfile_imx320.bin vendor/firmware/setfile_imx333.bin vendor/firmware/vts.bin - -# Firmware - from N950FXXS7DSH1 -vendor/firmware/fimc_is_lib.bin|49ac95e2bd9952e6261e3f58a8b6e0a90e7df480 -vendor/firmware/fimc_is_rta_2l2_3h1.bin|04e9614062231b07244a27223219266b11a42365 -vendor/firmware/fimc_is_rta_2l2_imx320.bin|670011935fa4601b5641cd6436ef07742612d5c0 -vendor/firmware/fimc_is_rta_imx333_3h1.bin|d5505ee5880aea729c2019b064ae7957c9e4c28b -vendor/firmware/fimc_is_rta_imx333_imx320.bin|aefbdbe7e1a72917f945a89b905812139e0704c9 -- 2.20.1