hexedit firmware blobs on extraction
authorJan Altensen <info@stricted.net>
Sun, 1 Sep 2019 15:31:30 +0000 (17:31 +0200)
committerJan Altensen <info@stricted.net>
Sun, 1 Sep 2019 15:32:26 +0000 (17:32 +0200)
Change-Id: Ided61348c92ed78072d3f77eb01a44c1fb3c5658

extract-files.sh
proprietary-files.txt

index 7a72adaac0ecee9b9e6239b353db5724f6c5c3a3..a65fbf96bc26c48f1b2dea125b6dcb6b22766bea 100755 (executable)
@@ -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"
index f6af23e4fa8bb435b7ee9e95d51f275f95fd97f9..459a97c8fee835d16697cc7b82a98117cb035092 100644 (file)
@@ -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