intel-microcode: Add ability to filter microcode

The microcode data file released by Intel has microcode for many Intel
processors, which by default all get installed onto the target image.
In some situations it may desirable to choose microcode for only a
selected processor or processors.  This change provides an easier way
to filter and select only the microcode of interest for BSPs from
recipe space.

A new variable, UCODE_FILTER_PARAMETERS, is introduced, which can be
defined to contain parameters to the iucode_tool which will filter the
microcode of interest for the BSP under consideration.  More
information on the iucode-tool parameters is available here:
http://manned.org/iucode-tool.

This filtering makes the generated microcode files very
machine-specific, hence making the recipe machine-specific. BSPs using
the common Intel kernel will not be using the filtered microcode, and
will be able to share the intel-microcode packages with the common
Intel package arch for the recipe.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Acked-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
This commit is contained in:
Nitin A Kamble 2014-09-30 18:23:35 -07:00 committed by Tom Zanussi
parent 5ef9be96e7
commit a3a380373b
2 changed files with 16 additions and 3 deletions

View File

@ -21,14 +21,26 @@ RDEPENDS_${PN} = "iucode-tool"
DEPENDS = "iucode-tool-native" DEPENDS = "iucode-tool-native"
S = "${WORKDIR}" S = "${WORKDIR}"
inherit allarch PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit deploy inherit deploy
# Use any of the iucode_tool parameters to filter specific microcodes from the data file
# For further information, check the iucode-tool's manpage : http://manned.org/iucode-tool
UCODE_FILTER_PARAMETERS ?= ""
do_compile() { do_compile() {
mkdir -p ${WORKDIR}/ucode/kernel/x86/microcode mkdir -p ${WORKDIR}/ucode/kernel/x86/microcode
${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool --overwrite --write-to=${WORKDIR}/microcode_${PV}.bin ${WORKDIR}/microcode.dat ${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool \
${UCODE_FILTER_PARAMETERS} \
--overwrite \
--write-to=${WORKDIR}/microcode_${PV}.bin \
${WORKDIR}/microcode.dat
${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool --overwrite --write-earlyfw=${WORKDIR}/microcode_${PV}.cpio ${WORKDIR}/microcode.dat ${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool \
${UCODE_FILTER_PARAMETERS} \
--overwrite \
--write-earlyfw=${WORKDIR}/microcode_${PV}.cpio \
${WORKDIR}/microcode.dat
} }
do_install() { do_install() {

View File

@ -2,5 +2,6 @@ INTEL_COMMON_PACKAGE_ARCH ?= "${TUNE_PKGARCH}-intel-common"
PACKAGE_ARCH_pn-linux-yocto = "${INTEL_COMMON_PACKAGE_ARCH}" PACKAGE_ARCH_pn-linux-yocto = "${INTEL_COMMON_PACKAGE_ARCH}"
PACKAGE_ARCH_pn-linux-yocto-rt = "${INTEL_COMMON_PACKAGE_ARCH}" PACKAGE_ARCH_pn-linux-yocto-rt = "${INTEL_COMMON_PACKAGE_ARCH}"
PACKAGE_ARCH_pn-linux-yocto-dev = "${INTEL_COMMON_PACKAGE_ARCH}" PACKAGE_ARCH_pn-linux-yocto-dev = "${INTEL_COMMON_PACKAGE_ARCH}"
PACKAGE_ARCH_pn-intel-microcode = "${INTEL_COMMON_PACKAGE_ARCH}"
PACKAGE_EXTRA_ARCHS_append += "${INTEL_COMMON_PACKAGE_ARCH}" PACKAGE_EXTRA_ARCHS_append += "${INTEL_COMMON_PACKAGE_ARCH}"
MACHINEOVERRIDES =. "${INTEL_COMMON_PACKAGE_ARCH}:" MACHINEOVERRIDES =. "${INTEL_COMMON_PACKAGE_ARCH}:"