exynos9610: Add a check before adding dependencies
authorMarc Bourgoin <themard85@gmail.com>
Thu, 11 Feb 2021 05:38:58 +0000 (22:38 -0700)
committerNolen Johnson <johnsonnolen@gmail.com>
Mon, 10 May 2021 18:03:48 +0000 (20:03 +0200)
Without a check, when performing a vendor blob regen it'll add another
dependency on top of any existing one

Change-Id: I9c7f17082fd850235c794d44cec3cda0c4b883ef

extract-files.sh

index d353e85f1b9d080e2363cb1f9de09e3a4099a5df..acd84aa11bd64063dbbff5045787f56dec353fdb 100755 (executable)
@@ -61,11 +61,21 @@ extract "${MY_DIR}/proprietary-files-vendor.txt" "${SRC}" "${KANG}" --section "$
 
 # Fix proprietary blobs
 BLOB_ROOT="$ANDROID_ROOT"/vendor/"$VENDOR"/"$DEVICE_COMMON"/proprietary
+
 "${PATCHELF}" --replace-needed libmedia.so libmedia_ims.so $BLOB_ROOT/lib64/libmediaadaptor.so
-"${PATCHELF}" --add-needed libaudioproxy_shim.so $BLOB_ROOT/vendor/lib/libaudioproxy.so
-"${PATCHELF}" --add-needed libmemset.so $BLOB_ROOT/vendor/bin/charge_only_mode
-"${PATCHELF}" --add-needed libdemangle.so $BLOB_ROOT/vendor/lib/libhifills.so
-"${PATCHELF}" --add-needed libdemangle.so $BLOB_ROOT/vendor/lib64/libhifills.so
+
+for LIBAUDIOPROXY_SHIM in $(grep -L "libaudioproxy_shim.so" "$BLOB_ROOT/vendor/lib/libaudioproxy.so"); do
+    "${PATCHELF}" --add-needed libaudioproxy_shim.so $BLOB_ROOT/vendor/lib/libaudioproxy.so
+done
+for LIBMEMSET in $(grep -L "libmemset.so" "$BLOB_ROOT/vendor/bin/charge_only_mode"); do
+    "${PATCHELF}" --add-needed libmemset.so $BLOB_ROOT/vendor/bin/charge_only_mode
+done
+for LIBDEMANGLE in $(grep -L "libdemangle.so" "$BLOB_ROOT/vendor/lib/libhifills.so"); do
+    "${PATCHELF}" --add-needed libdemangle.so $BLOB_ROOT/vendor/lib/libhifills.so
+done
+for LIBDEMANGLE64 in $(grep -L "libdemangle.so" "$BLOB_ROOT/vendor/lib64/libhifills.so"); do
+    "${PATCHELF}" --add-needed libdemangle.so $BLOB_ROOT/vendor/lib64/libhifills.so
+done
 
 # Remove libhidltransport dependency
 "${PATCHELF}" --remove-needed libhidltransport.so $BLOB_ROOT/vendor/bin/hw/android.hardware.biometrics.fingerprint@2.1-service-rbs