=================================================================== RCS file: /cvs/openbsd/fw_update/fw_install.sh,v retrieving revision 1.27 retrieving revision 1.31 diff -u -r1.27 -r1.31 --- openbsd/fw_update/fw_install.sh 2021/11/16 02:40:45 1.27 +++ openbsd/fw_update/fw_install.sh 2021/11/18 02:18:32 1.31 @@ -1,17 +1,10 @@ #!/bin/ksh set -e -scan_dmesg() { - # no bsort for now - sed -n "$1" /var/run/dmesg.boot -} - # 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 @@ -80,6 +73,7 @@ VNAME=$(sysctl -n kern.osrelease) VERSION="${VNAME%.*}${VNAME#*.}" FWDIR="$VNAME" +MODE=${MODE:-install} # TODO: We need the firmware for the system we just installed # not the one we booted from. For example: @@ -92,7 +86,7 @@ # Otherwise, the fw_update after first boot will fix it up for us. HTTP_FWDIR=$FWDIR -set -- $(scan_dmesg "/^OpenBSD $VNAME\([^ ]*\).*$/s//\1/p") +set -- sed -n "/^OpenBSD $VNAME\([^ ]*\).*$/s//\1/p" /var/run/dmesg.boot [[ $1 == -!(stable) ]] && HTTP_FWDIR=snapshots FWURL=http://firmware.openbsd.org/firmware/${HTTP_FWDIR} @@ -166,7 +160,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 @@ -239,7 +232,7 @@ # TODO: Should we mark these so real fw_update can -Drepair? ftp -D "Install" -Vmo- "file:$_tmpsrc/$_f" | tar -s ",^\+,${_pkgdir}/${_f%.tgz}/+," \ - -s ",^firmware,mnt/etc/firmware," \ + -s ",^firmware,${DESTDIR}/etc/firmware," \ -C / -zxphf - "+*" "firmware/*" ed -s "${_pkgdir}/${_f%.tgz}/+CONTENTS" <