aboutsummaryrefslogtreecommitdiffstats
path: root/package/firmware/intel-microcode/Makefile
diff options
context:
space:
mode:
authorZoltan HERPAI <wigyori@uid0.hu>2018-02-10 21:19:41 +0100
committerZoltan HERPAI <wigyori@uid0.hu>2018-02-11 14:39:21 +0100
commit01020bc74d91a9e02adb6c0cc7bf71d7c446b60f (patch)
tree73bab13cbefed44e4f78ef41dc2cccf38459a532 /package/firmware/intel-microcode/Makefile
parent8fb34763453d305365947bfca9766bf8a7150d2c (diff)
downloadupstream-01020bc74d91a9e02adb6c0cc7bf71d7c446b60f.tar.gz
upstream-01020bc74d91a9e02adb6c0cc7bf71d7c446b60f.tar.bz2
upstream-01020bc74d91a9e02adb6c0cc7bf71d7c446b60f.zip
firmware: add microcode package for Intel
Compiling the Intel microcode package results in a microcode.bin and a microcode-64.bin. As we can decide based on the subtarget which should be used, we'll only split the required .bin file with iucode-tool. x64 will get the intel-microcode-64.bin All other variants will get intel-microcode.bin The microcodes will be updated from preinit via a common script - that's the earliest place where we can do it. Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Diffstat (limited to 'package/firmware/intel-microcode/Makefile')
-rw-r--r--package/firmware/intel-microcode/Makefile49
1 files changed, 49 insertions, 0 deletions
diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile
new file mode 100644
index 0000000000..b5ebddd7b9
--- /dev/null
+++ b/package/firmware/intel-microcode/Makefile
@@ -0,0 +1,49 @@
+#
+# Copyright (C) 2018 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=intel-microcode
+PKG_VERSION:=20170707
+PKG_RELEASE:=1~deb9u1
+
+PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
+PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/
+PKG_HASH:=6e288b687077cbb678c90a1c2ab0cfba43ee46e8645dc3791884278f6453e927
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
+
+PKG_BUILD_DEPENDS:=iucode-tool/host
+
+ifdef CONFIG_TARGET_x86_64
+ MICROCODE:="intel-microcode-64"
+else
+ MICROCODE:="intel-microcode"
+endif
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/intel-microcode
+ SECTION:=firmware
+ CATEGORY:=Firmware
+ URL:=$(PKG_SOURCE_URL)
+ DEPENDS:=@TARGET_x86 +iucode-tool
+ TITLE:=Intel x86 CPU microcode
+endef
+
+define Build/Compile
+ IUCODE_TOOL=$(STAGING_DIR)/../host/bin/iucode_tool $(MAKE) -C $(PKG_BUILD_DIR)
+ mkdir $(PKG_BUILD_DIR)/intel-ucode
+ $(STAGING_DIR)/../host/bin/iucode_tool -q \
+ --write-firmware=$(PKG_BUILD_DIR)/intel-ucode $(PKG_BUILD_DIR)/$(MICROCODE).bin
+endef
+
+define Package/intel-microcode/install
+ $(INSTALL_DIR) $(1)/lib/firmware/intel-ucode
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode/* $(1)/lib/firmware/intel-ucode
+endef
+
+$(eval $(call BuildPackage,intel-microcode))