summaryrefslogtreecommitdiffstats
path: root/recipes-core/microcode/intel-microcode_20220207.bb
blob: 48b21b269ac1a9c41911edcfd7bcbb75a675842b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
SUMMARY = "Intel Processor Microcode Datafile for Linux"
HOMEPAGE = "http://www.intel.com/"
DESCRIPTION = "The microcode data file contains the latest microcode\
 definitions for all Intel processors. Intel releases microcode updates\
 to correct processor behavior as documented in the respective processor\
 specification updates. While the regular approach to getting this microcode\
 update is via a BIOS upgrade, Intel realizes that this can be an\
 administrative hassle. The Linux operating system and VMware ESX\
 products have a mechanism to update the microcode after booting.\
 For example, this file will be used by the operating system mechanism\
 if the file is placed in the /etc/firmware directory of the Linux system."

LICENSE = "Intel-Microcode-License"
LIC_FILES_CHKSUM = "file://license;md5=d8405101ec6e90c1d84b082b0c40c721"

SRC_URI = "git://github.com/intel/Intel-Linux-Processor-Microcode-Data-Files.git;protocol=https;branch=main \
           "

SRCREV = "115c3e4cdad6a9d84bf06e066162c5c546a9d2c3"

DEPENDS = "iucode-tool-native"
S = "${WORKDIR}/git"

COMPATIBLE_HOST = "(i.86|x86_64).*-linux"
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() {
	${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool \
		${UCODE_FILTER_PARAMETERS} \
		--overwrite \
		--write-earlyfw=${WORKDIR}/microcode_${PV}.cpio \
		${S}/intel-ucode/* ${S}/intel-ucode-with-caveats/*
}

do_install() {
	install -d ${D}${nonarch_base_libdir}/firmware/intel-ucode/
	${STAGING_DIR_NATIVE}${sbindir_native}/iucode_tool \
	${UCODE_FILTER_PARAMETERS} \
	--write-firmware=${D}${nonarch_base_libdir}/firmware/intel-ucode \
	${S}/intel-ucode/* ${S}/intel-ucode-with-caveats/*
}

do_deploy() {
	install -d ${DEPLOYDIR}
	install ${WORKDIR}/microcode_${PV}.cpio ${DEPLOYDIR}/
	cd ${DEPLOYDIR}
	rm -f microcode.cpio
	ln -sf microcode_${PV}.cpio microcode.cpio
}

addtask deploy before do_build after do_compile

PACKAGES = "${PN}"

FILES:${PN} = "${nonarch_base_libdir}"

UPSTREAM_CHECK_GITTAGREGEX = "^microcode-(?P<pver>(\d+)[a-z]*)$"