diff options
author | Dan McDonald <danmcd@joyent.com> | 2020-06-08 15:34:32 -0400 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2020-06-08 19:59:09 -0400 |
commit | d9660a7c6537b3e744aca576d92fcef0d6efcea2 (patch) | |
tree | cd82ff52d2dc215ccdd4217bfb4bbb1c1962d1a9 /usr | |
parent | 16b19c8cd6c6339e907197a5a8c30bdb85ec0ef8 (diff) | |
download | illumos-gate-d9660a7c6537b3e744aca576d92fcef0d6efcea2.tar.gz |
12817 ucode/update.intel should be able to use git repos
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/src/data/ucode/update.intel | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/usr/src/data/ucode/update.intel b/usr/src/data/ucode/update.intel index eaa71539a6..038f80b217 100755 --- a/usr/src/data/ucode/update.intel +++ b/usr/src/data/ucode/update.intel @@ -10,7 +10,7 @@ # http://www.illumos.org/license/CDDL. # Copyright 2019 OmniOS Community Edition (OmniOSce) Association. -# Copyright 2019 Joyent, Inc. +# 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 @@ -22,13 +22,12 @@ set -o pipefail # Remove this once we start using pkgfmt without it in the rest of -gate. export PKGFMT_OUTPUT=v1 -[[ -z "$1" ]] || [[ ! -f "$1" ]] && { - echo "Syntax: $0 <path to microcode tar>" >&2 - exit 1 -} - -ucodetar="$1" +# 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 @@ -37,12 +36,27 @@ mf=../../pkg/manifests/system-microcode-intel.mf 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 \ +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 @@ -57,7 +71,7 @@ rm -f $mf.tmp rm -f intel/* -cp $tmp/Intel-Linux-Processor-Microcode-Data*/license intel/THIRDPARTYLICENSE +cp $dir/license intel/THIRDPARTYLICENSE echo Intel Processor Microcode Data Files > intel/THIRDPARTYLICENSE.descrip rm -f Makefile.links |