[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.23 and 1.29

version 1.23, 2021/11/11 02:33:32 version 1.29, 2021/11/18 01:44:30
Line 6 
Line 6 
         sed -n "$1" /var/run/dmesg.boot          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() {  prefetcharea_fs_list() {
     echo "/mnt/tmp"          echo "${DESTDIR}/tmp"
 }  }
 reset_watchdog() {  reset_watchdog() {
 }  }
Line 79 
Line 80 
 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 100 
Line 102 
   
 # TODO: support srclocal installation of firmware somehow  # TODO: support srclocal installation of firmware somehow
 fw_update() {  fw_update() {
         local _src=$FWURL _tmpfs_list _tmpfs _tmpsrc          local _src=$1 _tmpfs_list _tmpfs _tmpsrc \
     local _t=Get _cfile="/tmp/SHA256" _srclocal=false                  _t=Get _cfile="/tmp/SHA256" _pkgdir=${DESTDIR}/var/db/pkg \
         local _f _r _remove _i _installed                  _f _r _remove _i _installed
         local _pkgdir=/mnt/var/db/pkg          local _srclocal=false _unpriv=unpriv
   
           echo "Let's $MODE firmware!"
         local _d _drivers=$(          local _d _drivers=$(
                 last=''                  last=''
                 ftp -D "Detecting" -Vmo- $FWPATTERNS |                  $_unpriv ftp -D "Detecting" -Vmo- $FWPATTERNS |
                 while read _d _m; do                  while read _d _m; do
                         grep=grep                          grep=grep
                         [ "$last" = "$_d" ] && continue                          [ "$last" = "$_d" ] && continue
Line 158 
Line 162 
             echo "Cannot fetch SHA256.sig" >&2 && return 1              echo "Cannot fetch SHA256.sig" >&2 && return 1
   
         # Verify signature file with public keys.          # Verify signature file with public keys.
         ! unpriv -f "$_cfile" \          ! $_unpriv -f "$_cfile" \
             signify -Vep $FWPUB_KEY -x "$_cfile.sig" -m "$_cfile" &&              signify -Vep $FWPUB_KEY -x "$_cfile.sig" -m "$_cfile" &&
             echo "Signature check of SHA256.sig failed" >&2 && return 1              echo "Signature check of SHA256.sig failed" >&2 && return 1
   
Line 174 
Line 178 
   
                 for _i in $_installed; do                  for _i in $_installed; do
                         if [ "$_f" = "$_i.tgz" ]; then                          if [ "$_f" = "$_i.tgz" ]; then
                                 echo "Firmware for $_d already installed ($_installed)"                                  echo "$_i already installed"
                                 continue 2                                  continue 2
                         fi                          fi
                 done                  done
Line 211 
Line 215 
   
                         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 234 
Line 238 
                 fi                  fi
   
                 # TODO: Should we mark these so real fw_update can -Drepair?                  # TODO: Should we mark these so real fw_update can -Drepair?
                 $_unpriv 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 - \                          -C / -zxphf - "+*" "firmware/*"
                 "+*" "firmware/*"  
   
                 ed -s "${_pkgdir}/${_f%.tgz}/+CONTENTS" <<EOL                  ed -s "${_pkgdir}/${_f%.tgz}/+CONTENTS" <<EOL
 /^@comment pkgpath/ -1a  /^@comment pkgpath/ -1a
Line 251 
Line 254 
         done          done
 }  }
   
 fw_update  fw_update "$FWURL"

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.29

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