On my Dell INTEL laptop, I have upgrade with this Slackbuild microcode from git
Code:
#!/bin/sh
# Slackware build script for intel-ucode
# Requires: iucode-tool
PRGNAM=intel-ucode
VERSION=`date +%m%Ygit`
BUILD=${BUILD:-2}
TAG=${TAG:-_mg}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
# Exit at first error
set -e
# Prepare package
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
# Git clone
git clone https://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files.git $PRGNAM-$VERSION
cd $PRGNAM-$VERSION
# Install for boot
rm -f intel-ucode{,-with-caveats}/list
mkdir -p kernel/x86/microcode
iucode_tool -w kernel/x86/microcode/GenuineIntel.bin intel-ucode{,-with-caveats}
echo kernel/x86/microcode/GenuineIntel.bin | bsdcpio -o -H newc -R 0:0 > /boot/intel-ucode.cpio
mkdir -p $PKG/boot
cp -a /boot/intel-ucode.cpio $PKG/boot/intel-ucode.cpio
# Install for system
mkdir -p $PKG/lib/firmware/intel-ucode
cp intel-ucode/* $PKG/lib/firmware/intel-ucode
cd intel-ucode-with-caveats
for microcode in *;do
cp $microcode $PKG/lib/firmware/intel-ucode/$microcode
done
# Docs
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
cp -a license releasenote $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
# Install slack-desc and doinst.sh
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
# Create Slackware Package
cd $PKG
/sbin/makepkg -l y -c n $CWD/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz}
The doinst.gz create the necessary initrd
Code:
#!/bin/sh
# First mkinitrd
if [ -e /etc/mkinitrd.conf ]; then
mkinitrd -F
else
echo "Configure /etc/mkinitrd.conf or do mkinitrd manual"
echo "to update intel microcode"
fi
# If first op was ok update grub
if [ "$?" == "0" ]
then
grub-mkconfig -o /boot/grub/grub.cfg
else
echo "error!"
exit 1
fi
Now the results, on Dell laptop is perfect
Code:
dmesg |grep -i code|grep -i micro
microcode: microcode updated early to revision 0x26, date = 2019-11-12
[mar giu 23 01:58:08 2020] SRBDS: Mitigation: Microcode
[mar giu 23 01:58:12 2020] microcode: sig=0x40651, pf=0x40, revision=0x26
[mar giu 23 01:58:12 2020] microcode: Microcode Update Driver: v2.2.
On my HP Gen-8 with the same package still load an old(form where?) microcode.
My suspect is we have to wait HPE firmware update..
Code:
dmesg |grep -i microcode
SRBDS: Vulnerable: No microcode
microcode: sig=0x306a9, pf=0x2, revision=0x21
microcode: Microcode Update Driver: v2.2.
Any idea? Of course I have rebooted, and in mkinitrd.conf I specify to use microcode
MICROCODE_ARCH="/boot/intel-ucode.cpio"