=================================================================== RCS file: /cvs/openbsd/fw_update/fw_install.sh,v retrieving revision 1.30 retrieving revision 1.36 diff -u -r1.30 -r1.36 --- openbsd/fw_update/fw_install.sh 2021/11/18 02:15:34 1.30 +++ openbsd/fw_update/fw_install.sh 2021/11/27 06:38:06 1.36 @@ -1,12 +1,11 @@ #!/bin/ksh +# $OpenBSD: fw_install.sh,v 1.36 2021/11/27 06:38:06 afresh1 Exp $ set -e # Fake up some things from install.sub that we don't need to actually do prefetcharea_fs_list() { echo "${DESTDIR}/tmp" } -reset_watchdog() { -} # tmpdir, do_as, unpriv, and unpriv2 are from install.sub @@ -65,16 +64,9 @@ do_as _file "$@" } -# "fail" needs to be replaced with the "ask_yn" loop like in the installer. -_issue= -fail() { - echo $_issue >&2 - exit 1 -} - -VNAME=$(sysctl -n kern.osrelease) -VERSION="${VNAME%.*}${VNAME#*.}" -FWDIR="$VNAME" +VNAME=${VNAME:-$(sysctl -n kern.osrelease)} +VERSION=${VERSION:-"${VNAME%.*}${VNAME#*.}"} +FWDIR=${FWDIR:-$VNAME} MODE=${MODE:-install} # TODO: We need the firmware for the system we just installed @@ -96,7 +88,7 @@ FWPATTERNS="file:${0%/*}/firmware_patterns" # TODO: support srclocal installation of firmware somehow -fw_update() { +fw_install() { local _src=$1 _tmpfs_list _tmpfs _tmpsrc \ _t=Get _cfile="/tmp/SHA256" _pkgdir=${DESTDIR}/var/db/pkg \ _f _r _remove _i _installed @@ -162,7 +154,6 @@ echo "Signature check of SHA256.sig failed" >&2 && return 1 for _d in $_drivers; do - $UU && reset_watchdog _f=$( sed -n "s/.*(\($_d-firmware-.*\.tgz\)).*/\1/p" "$_cfile" ) _installed=$( for fw in "${_pkgdir}/$_d-firmware"*; do @@ -249,4 +240,4 @@ done } -fw_update "$FWURL" +fw_install "$FWURL"