[BACK]Return to fw_install.sh CVS log [TXT][DIR] Up to [local] / openbsd / fw_update

Diff for /openbsd/fw_update/fw_install.sh between version 1.26 and 1.30

version 1.26, 2021/11/12 02:38:05 version 1.30, 2021/11/18 02:15:34
Line 1 
Line 1 
 #!/bin/ksh  #!/bin/ksh
 set -e  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  # Fake up some things from install.sub that we don't need to actually do
 prefetcharea_fs_list() {  prefetcharea_fs_list() {
         echo "/mnt/tmp"          echo "${DESTDIR}/tmp"
 }  }
 reset_watchdog() {  reset_watchdog() {
 }  }
Line 80 
Line 75 
 VNAME=$(sysctl -n kern.osrelease)  VNAME=$(sysctl -n kern.osrelease)
 VERSION="${VNAME%.*}${VNAME#*.}"  VERSION="${VNAME%.*}${VNAME#*.}"
 FWDIR="$VNAME"  FWDIR="$VNAME"
   MODE=${MODE:-install}
   
 # TODO: We need the firmware for the system we just installed  # TODO: We need the firmware for the system we just installed
 #       not the one we booted from.  For example:  #       not the one we booted from.  For example:
Line 92 
Line 88 
 #       Otherwise, the fw_update after first boot will fix it up for us.  #       Otherwise, the fw_update after first boot will fix it up for us.
   
 HTTP_FWDIR=$FWDIR  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  [[ $1 == -!(stable) ]] && HTTP_FWDIR=snapshots
   
 FWURL=http://firmware.openbsd.org/firmware/${HTTP_FWDIR}  FWURL=http://firmware.openbsd.org/firmware/${HTTP_FWDIR}
Line 102 
Line 98 
 # TODO: support srclocal installation of firmware somehow  # TODO: support srclocal installation of firmware somehow
 fw_update() {  fw_update() {
         local _src=$1 _tmpfs_list _tmpfs _tmpsrc \          local _src=$1 _tmpfs_list _tmpfs _tmpsrc \
                 _t=Get _cfile="/tmp/SHA256" _pkgdir=/mnt/var/db/pkg \                  _t=Get _cfile="/tmp/SHA256" _pkgdir=${DESTDIR}/var/db/pkg \
                 _f _r _remove _i _installed                  _f _r _remove _i _installed
         local _srclocal=false _unpriv=unpriv          local _srclocal=false _unpriv=unpriv
   
Line 214 
Line 210 
   
                         while read c g; do                          while read c g; do
                                 case $c in                                  case $c in
                                 @cwd) cwd="/mnt/$g"                                  @cwd) cwd="${DESTDIR}/$g"
                                   ;;                                    ;;
                                 @*) continue                                  @*) continue
                                   ;;                                    ;;
Line 239 
Line 235 
                 # TODO: Should we mark these so real fw_update can -Drepair?                  # TODO: Should we mark these so real fw_update can -Drepair?
                 ftp -D "Install" -Vmo- "file:$_tmpsrc/$_f" |                  ftp -D "Install" -Vmo- "file:$_tmpsrc/$_f" |
                         tar -s ",^\+,${_pkgdir}/${_f%.tgz}/+," \                          tar -s ",^\+,${_pkgdir}/${_f%.tgz}/+," \
                         -s ",^firmware,mnt/etc/firmware," \                          -s ",^firmware,${DESTDIR}/etc/firmware," \
                         -C / -zxphf - "+*" "firmware/*"                          -C / -zxphf - "+*" "firmware/*"
   
                 ed -s "${_pkgdir}/${_f%.tgz}/+CONTENTS" <<EOL                  ed -s "${_pkgdir}/${_f%.tgz}/+CONTENTS" <<EOL

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.30

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>