[meta-intel] [Patch v4 03/12] intel-microcode: add ability to filter microcode

nitin.a.kamble at intel.com nitin.a.kamble at intel.com
Thu Oct 16 19:03:13 PDT 2014


From: Nitin A Kamble <nitin.a.kamble at intel.com>

The microcode data file released by Intel has microcode for many Intel
processors.  And all these get installed on the target image. In some
situations it may desired to pick microcode for only selected processor
or processors.
This change provides an easier way to filter and pick only the microcode
of interest for BSPs from the recipe space.

 A new variable, UCODE_FILTER_PARAMETERS is introduced, which can be
redefined containing parameters of the iucode_tool to filter the microcodes
of interest for the BSP under consideration. The information on the
iucode-tool parameters are available here: http://manned.org/iucode-tool .

The filtering makes the generated microcode files very machine specific,
hence making the recipe machine specific. The BSPs using the common Intel
kernel will not be using the filtered microcode, and these 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 at intel.com>
---
 .../recipes-core/microcode/intel-microcode_20140624.bb | 18 +++++++++++++++---
 conf/machine/include/intel-common-pkgarch.inc          |  1 +
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/common/recipes-core/microcode/intel-microcode_20140624.bb b/common/recipes-core/microcode/intel-microcode_20140624.bb
index 72aca7d..ca03328 100644
--- a/common/recipes-core/microcode/intel-microcode_20140624.bb
+++ b/common/recipes-core/microcode/intel-microcode_20140624.bb
@@ -21,14 +21,26 @@ RDEPENDS_${PN} = "iucode-tool"
 DEPENDS = "iucode-tool-native"
 S = "${WORKDIR}"
 
-inherit allarch
+PACKAGE_ARCH = "${MACHINE_ARCH}"
 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() {
 	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() {
diff --git a/conf/machine/include/intel-common-pkgarch.inc b/conf/machine/include/intel-common-pkgarch.inc
index cdddcc0..66aac12 100644
--- a/conf/machine/include/intel-common-pkgarch.inc
+++ b/conf/machine/include/intel-common-pkgarch.inc
@@ -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-rt = "${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}"
 MACHINEOVERRIDES =. "${INTEL_COMMON_PACKAGE_ARCH}:"
-- 
1.8.1.4



More information about the meta-intel mailing list