From 78694d4ff9b36a9da57a371385162bcce0c133c6 Mon Sep 17 00:00:00 2001 From: Eric MacDonald Date: Wed, 28 May 2025 18:31:29 +0000 Subject: [PATCH] Reduce sw-patch init script controller ping timeout for simplex systems The DELAY_SEC variable in the sw-patch init script controls how long the service waits for an active controller to respond before proceeding. The default is 120 seconds. On simplex (AIO-SX) systems, this wait always times out since there is no active 'controller', resulting in an unnecessary 2-minute delay during reboot or unlock operations. This update significantly reduces the timeout delay on simplex systems, improving boot and unlock responsiveness without affecting duplex systems. Test Plan: PASS: Verify build and install on AIO-SX PASS: Verify build and install on AIO-DX PASS: Verify unlock of AIO-SX is not delayed by sw-patch timeout PASS: Verify sw-patch times out after ~10s with no controller ping (SX) PASS: Verify sw-patch still uses 120s timeout on AIO-DX Closes-Bug: 2111941 Change-Id: I46d33e87897e2ae67011241f9f83ae0d153f19ce Signed-off-by: Eric MacDonald --- sw-patch/bin/sw-patch-init.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sw-patch/bin/sw-patch-init.sh b/sw-patch/bin/sw-patch-init.sh index 2201ab57..53bff4d5 100644 --- a/sw-patch/bin/sw-patch-init.sh +++ b/sw-patch/bin/sw-patch-init.sh @@ -102,7 +102,15 @@ fi # If the management interface is bonded, it may take some time # before communications can be properly setup. # Allow up to $DELAY_SEC seconds to reach controller. -DELAY_SEC=120 + +if [ "${system_mode}" = "simplex" ]; then + # Make the delay for simplex systems smaller. + # There is no active controller during reboot. + DELAY_SEC=10 +else + DELAY_SEC=120 +fi + START=`date +%s` FOUND=0 while [ $(date +%s) -lt $(( ${START} + ${DELAY_SEC} )) ]; do