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

extract-files.sh
proprietary-files.txt

index 938c10cfaf772a9ffadcd473f9f57ae9fdd52417..91d37b96d11aa965e9a0b43cec27eecec5c109d0 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 26b90614b364f5aa726e2f37f667b7a944d90f72..b0814abca4d223b9b4c6ba4aa2333143744c4e43 100644 (file)
@@ -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