From: "Theo de Raadt" Subject: Re: Increase initial timeout for fw_update(8) To: Andrew Hewus Fresh Cc: tech@openbsd.org Date: Sat, 11 Apr 2026 12:24:15 -0600 In the worst case, that is going to add up to 3 x 60 second delay to an install. I think not getting firmwares UPDATES in some circumstances is more acceptable than having every user wait up to 60 seconds (on the front-end of sysugrade), 60 seconds (on the ramdisk), and 60 seconds (in rc.firsttime). Whatever network problem is causing a delay is probably going to persist for all 3 attempts. That is brutal. I do sysupgrades in some darknet scenarios where firmware update's fail, and THAT'S OK. The tradeoff between different OpenBSD use cases seems poor. Know what might work? If there have been NO DOWNLOADED FIRMWARES AT ALL SO FAR, do the 60. This requires differentiating between included firmwares and downloaded firmware, but I think fw_update knows the difference. Andrew Hewus Fresh wrote: > sthen@ suggested that in some cases a 12 second timeout might not be > enough to make a connection and start the transfer. > > This adjusts the initial timeout to 60 seconds, switching back to a 12s > timeout after. > > While here, use arithmetic expressions instead of ksh tests. > > Comments, OK? > > Index: fw_update.sh > =================================================================== > RCS file: /cvs/src/usr.sbin/fw_update/fw_update.sh,v > diff -u -p -r1.66 fw_update.sh > --- fw_update.sh 26 Dec 2025 18:19:46 -0000 1.66 > +++ fw_update.sh 11 Apr 2026 18:06:18 -0000 > @@ -103,6 +103,7 @@ spin() { > > fetch() { > local _src="${FWURL}/${1##*/}" _dst=$1 _user=_file _exit _error='' > + local _timeout=60 > local _ftp_errors="$FD_DIR/ftp_errors" > rm -f "$_ftp_errors" > > @@ -127,12 +128,15 @@ fetch() { > ) & FTPPID=$! > set +o monitor > > + # Tmeout after 60 seconds for initial bytes > + # and after 12 seconds for additional bytes > SECONDS=0 > _last=0 > while kill -0 -"$FTPPID" 2>/dev/null; do > - if [[ $SECONDS -gt 12 ]]; then > + if (( SECONDS > _timeout )); then > + _timeout=12 > set -- $( ls -ln "$_dst" 2>/dev/null ) > - if [[ $_last -ne $5 ]]; then > + if (( _last != $5 )); then > _last=$5 > SECONDS=0 > spin >