Print this page
12817 ucode/update.intel should be able to use git repos
12815 ucode/update.intel needs pkgfmt fix
        
*** 8,47 ****
  # A full copy of the text of the CDDL should have accompanied this
  # source. A copy of the CDDL is also available via the Internet at
  # http://www.illumos.org/license/CDDL.
  
  # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
! # Copyright 2019 Joyent, Inc.
  
  # A simple update script that extracts an Intel microcode download file
  # into the intel/ directory, and updates the hardlinks in the
  # system/kernel/platform manifest.
  
  set -e
  set -o pipefail
  
! [[ -z "$1" ]] || [[ ! -f "$1" ]] && {
!         echo "Syntax: $0 <path to microcode tar>" >&2
!         exit 1
! }
  
! ucodetar="$1"
  
  mf=../../pkg/manifests/system-microcode-intel.mf
  [[ -f $mf ]] || {
          echo "Run from usr/src/data/ucode" 2>&1
          exit 1
  }
  
  fw=platform/i86pc/ucode/GenuineIntel
  
! tmp=$(mktemp -d)
! mkdir $tmp/out
  
! gtar -C $tmp -xvf "$ucodetar"
! 
! find $tmp/Intel-Linux-Processor-Microcode-Data*/intel-ucode*/ -type f \
      | while read f; do
          echo "Converting $(basename $f)"
          cp $f $tmp/intel-fw
          ucodeadm -i -R $tmp/out $tmp/intel-fw
          rm -f $tmp/intel-fw
--- 8,64 ----
  # A full copy of the text of the CDDL should have accompanied this
  # source. A copy of the CDDL is also available via the Internet at
  # http://www.illumos.org/license/CDDL.
  
  # Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
! # Copyright 2020 Joyent, Inc.
  
  # A simple update script that extracts an Intel microcode download file
  # into the intel/ directory, and updates the hardlinks in the
  # system/kernel/platform manifest.
  
  set -e
  set -o pipefail
  
! # Remove this once we start using pkgfmt without it in the rest of -gate.
! export PKGFMT_OUTPUT=v1
  
! # Change me if the world evolves, but for now, this is the source of
! # truth for Intel microcode.
! REPOSOURCE="https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files"
  
+ tmp=$(mktemp -d)
+ mkdir $tmp/out
  mf=../../pkg/manifests/system-microcode-intel.mf
  [[ -f $mf ]] || {
          echo "Run from usr/src/data/ucode" 2>&1
          exit 1
  }
  
  fw=platform/i86pc/ucode/GenuineIntel
  
! if [[ -z "$1" ]]; then
!         goback=`pwd`
!         cd $tmp
!         # Hope git is available if we need it...
!         git clone $REPOSOURCE || {
!                 echo "Git clone of $REPOSOURCE failed." 2>&1
!                 exit 1
!         }
!         cd $goback
!         # Change with REPOSOURCE name
!         dir=$tmp/Intel-Linux-Processor-Microcode-Data-Files
! elif [[ -d "$1" ]]; then
!         dir=$1
! else
!         gtar -C $tmp -xvf "$1"
!         # This will expand properly if the tarball appends a release
!         # to the name.
!         dir=$tmp/Intel-Linux-Processor-Microcode-Data-Files*
! fi
  
! find $dir/intel-ucode*/ -type f \
      | while read f; do
          echo "Converting $(basename $f)"
          cp $f $tmp/intel-fw
          ucodeadm -i -R $tmp/out $tmp/intel-fw
          rm -f $tmp/intel-fw
*** 52,62 ****
  egrep -v "(file|hardlink) path=$fw" $mf.tmp > $mf
  rm -f $mf.tmp
  
  rm -f intel/*
  
! cp $tmp/Intel-Linux-Processor-Microcode-Data*/license intel/THIRDPARTYLICENSE
  echo Intel Processor Microcode Data Files > intel/THIRDPARTYLICENSE.descrip
  
  rm -f Makefile.links
  
  typeset -A seen
--- 69,79 ----
  egrep -v "(file|hardlink) path=$fw" $mf.tmp > $mf
  rm -f $mf.tmp
  
  rm -f intel/*
  
! cp $dir/license intel/THIRDPARTYLICENSE
  echo Intel Processor Microcode Data Files > intel/THIRDPARTYLICENSE.descrip
  
  rm -f Makefile.links
  
  typeset -A seen