Skip to content

Commit

Permalink
[uCode] Filter microcode for CPU signature and flags (fixes #112).
Browse files Browse the repository at this point in the history
  • Loading branch information
liske committed May 13, 2018
1 parent 1653543 commit 38167e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ needrestart (3.2) unstable; urgency=medium
* Fixes:
- [UI] Do not call GetTerminalSize if STDOUT is not a tty.
(github pull request #110 by Michael Scherer @mscherer)
- [uCode] Filter microcode for CPU signature and flags.
(github issue #112 by @mgondium)
- [uCode] Assigning ucodehints a false value disables ucode
checks.
(github issue #115 by Johannes Kampmeyer @xschlef)
Expand Down
12 changes: 9 additions & 3 deletions lib/iucode-scan-versions
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ if [ "$1" = "1" ]; then
set -x
fi

# filter for processor signature (and flags if available)
filter=`iucode_tool --scan-system 2>&1|grep -oE '[^[:space:]]+$'` #'
if [ -r /sys/devices/system/cpu/cpu0/microcode/processor_flags ]; then
filter="$filter,"`cat /sys/devices/system/cpu/cpu0/microcode/processor_flags`
fi

# early boot initrd (required at least on Arch Linux)
if type bsdtar > /dev/null 2>&1 ; then
imgfiles=""
Expand All @@ -38,7 +44,7 @@ if type bsdtar > /dev/null 2>&1 ; then
done

if [ -n "$imgfiles" ]; then
cat $imgfiles | bsdtar -Oxf /dev/stdin | iucode_tool -Sl -tb - 2>&1
cat $imgfiles | bsdtar -Oxf /dev/stdin | iucode_tool -Sl -s $filter -tb - 2>&1
exit $?
fi
fi
Expand All @@ -53,8 +59,8 @@ test "$IUCODE_TOOL_INITRAMFS" = "no" && exit 0

# run iucode_tool to scan for microcodes
if [ -r /usr/share/misc/intel-microcode* ]; then
exec iucode_tool -Sl -tb /lib/firmware/intel-ucode -ta /usr/share/misc/intel-microcode* 2>&1
exec iucode_tool -Sl -s $filter -tb /lib/firmware/intel-ucode -ta /usr/share/misc/intel-microcode* 2>&1
exit 1
fi

exec iucode_tool -Sl $IUCODE_TOOL_EXTRA_OPTIONS -tb /lib/firmware/intel-ucode 2>&1
exec iucode_tool -Sl -s $filter $IUCODE_TOOL_EXTRA_OPTIONS -tb /lib/firmware/intel-ucode 2>&1

0 comments on commit 38167e8

Please sign in to comment.