Opened 4 years ago

Closed 4 years ago

#12987 closed task (fixed)

Add CPU microcode to the intramfs

Reported by: Pierre Labastie Owned by: Pierre Labastie
Priority: normal Milestone: 9.1
Component: BOOK Version: SVN
Severity: minor Keywords:
Cc:

Description

Almost all x86 CPU need some microcode to run without (too many) security flaws. When using an initramfs (for LVM, raid or another reason), it'd be nice to have it included into the initramfs, instead of having two initramfs.

Change History (3)

comment:1 by Pierre Labastie, 4 years ago

Owner: changed from blfs-book to Pierre Labastie
Status: newassigned

comment:2 by Pierre Labastie, 4 years ago

Actually, the kernel documentation recommends the following:

#!/bin/bash

if [ -z "$1" ]; then
    echo "You need to supply an initrd file"
    exit 1
fi

INITRD="$1"

DSTDIR=kernel/x86/microcode
TMPDIR=/tmp/initrd

rm -rf $TMPDIR

mkdir $TMPDIR
cd $TMPDIR
mkdir -p $DSTDIR

if [ -d /lib/firmware/amd-ucode ]; then
        cat /lib/firmware/amd-ucode/microcode_amd*.bin > $DSTDIR/AuthenticAMD.bin
fi

if [ -d /lib/firmware/intel-ucode ]; then
        cat /lib/firmware/intel-ucode/* > $DSTDIR/GenuineIntel.bin
fi

find . | cpio -o -H newc >../ucode.cpio
cd ..
mv $INITRD $INITRD.orig
cat ucode.cpio $INITRD.orig > $INITRD

rm -rf $TMPDIR

That is make the initrd first, then the microcode.img, then concat them.

comment:3 by Pierre Labastie, 4 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r22557

Note: See TracTickets for help on using tickets.