gsc_script: Migrate to rust implementation

We should use the files under hwsec-utils.

BUG=304934170
TEST=None

Change-Id: I23ac5170b7e91a4564293c6a60d37eb0660ba13f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/factory_installer/+/4938252
Tested-by: Chih-Yao Chuang <jasonchuang@google.com>
Reviewed-by: Stimim Chen <stimim@chromium.org>
Auto-Submit: Chih-Yao Chuang <jasonchuang@google.com>
Commit-Queue: Stimim Chen <stimim@chromium.org>
diff --git a/factory_install.sh b/factory_install.sh
index 84ec0bc..9fba0cd 100644
--- a/factory_install.sh
+++ b/factory_install.sh
@@ -1275,7 +1275,7 @@
   crossystem clear_tpm_owner_request=1 || true
 
   # The gbb flag which forces the dev switch on (0x8) is set when
-  # (1) installing the firmware-updater and (2) doing RSU using cr50-reset.sh.
+  # (1) installing the firmware-updater and (2) doing RSU using cr50_reset.
   # However, if the factory bundle does not contain firmware-updater and at the
   # same time the hwwp is disabled via removing battery + action_m, then the
   # gbb flag will not be set. Therefore, after installation, the DUT will try
diff --git a/tpm/cros.sh b/tpm/cros.sh
index 14b0f9c..c5a53f3 100644
--- a/tpm/cros.sh
+++ b/tpm/cros.sh
@@ -124,12 +124,12 @@
 }
 
 tpm_perform_rsu() {
-  /usr/share/cros/cr50-reset.sh
+  /usr/share/cros/hwsec-utils/cr50_reset
 }
 
 tpm_check_rsu_support() {
-  if ! command -v /usr/share/cros/cr50-reset.sh >/dev/null; then
-    # cr50-reset.sh is not available, we cannot perform RSU.
+  if ! command -v /usr/share/cros/hwsec-utils/cr50_reset >/dev/null; then
+    # cr50_reset is not available, we cannot perform RSU.
     echo "unsupported"
     return 0
   fi
diff --git a/tpm/infineon.sh b/tpm/infineon.sh
index 7040f68..1ac9843 100644
--- a/tpm/infineon.sh
+++ b/tpm/infineon.sh
@@ -42,5 +42,5 @@
 tpm_get_board_id_flags() {
   # Board ID format from cr50: xxxxxxxx:xxxxxxxx:xxxxxxxx
   # Retrieve the last 5 characters (4 + 1 newline) using tail command
-  /usr/share/cros/cr50-read-board-id.sh | cut -d ':' -f 3 | tail -c 5
+  /usr/share/cros/hwsec-utils/tpm2_read_board_id | cut -d ':' -f 3 | tail -c 5
 }