=================================================================== RCS file: /cvs/openbsd/fw_update/fw_install.sh,v retrieving revision 1.148 retrieving revision 1.149 diff -u -r1.148 -r1.149 --- openbsd/fw_update/fw_install.sh 2022/01/11 02:48:11 1.148 +++ openbsd/fw_update/fw_install.sh 2022/01/14 04:25:46 1.149 @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: fw_install.sh,v 1.148 2022/01/11 02:48:11 afresh1 Exp $ +# $OpenBSD: fw_install.sh,v 1.149 2022/01/14 04:25:46 afresh1 Exp $ # # Copyright (c) 2021 Andrew Hewus Fresh # @@ -55,8 +55,7 @@ tmpdir() { local _i=1 _dir - # If we're not in the installer, - # we have mktemp and a more hostile environment. + # The installer lacks mktemp(1), do it by hand if [ -x /usr/bin/mktemp ]; then _dir=$( mktemp -d "${1}-XXXXXXXXX" ) else @@ -71,8 +70,7 @@ fetch() { local _src="${FWURL}/${1##*/}" _dst=$1 _user=_file _exit _error='' - # If we're not in the installer, - # we have su(1) and doas(1) is unlikely to be configured. + # The installer uses a limited doas(1) as a tiny su(1) set -o monitor # make sure ftp gets its own process group ( _flags=-vm @@ -141,7 +139,7 @@ verify() { [ -e "$CFILE" ] || fetch_cfile || return 1 - # On the installer we don't get sha256 -C, so fake it. + # The installer sha256 lacks -C, do it by hand if ! fgrep -qx "SHA256 (${1##*/}) = $( /bin/sha256 -qb "$1" )" "$CFILE"; then echo "Checksum test for ${1##*/} failed." >&2 return 1 @@ -153,8 +151,7 @@ firmware_in_dmesg() { local _d _m _line _dmesgtail _last='' _nl=$( echo ) - # When we're not in the installer, the dmesg.boot can - # contain multiple boots, so only look in the last one + # The dmesg can contain multiple boots, only look in the last one _dmesgtail="$( echo ; sed -n 'H;/^OpenBSD/h;${g;p;}' /var/run/dmesg.boot )" grep -v '^[[:space:]]*#' "$FWPATTERNS" | @@ -241,7 +238,6 @@ return 1 fi - # TODO: Should we mark these so real fw_update can -Drepair? ed -s "${FWPKGTMP}/+CONTENTS" <&2 exit 2 else - # If someone specified a filename on the command-line - # we don't want to verify it. + # Don't verify files specified on the command-line verify_existing=false fi