firmware: add microcode package for Intel
authorZoltan HERPAI <wigyori@uid0.hu>
Mon, 8 Jan 2018 14:49:39 +0000 (15:49 +0100)
committerZoltan HERPAI <wigyori@uid0.hu>
Mon, 8 Jan 2018 16:41:49 +0000 (17:41 +0100)
As we can only ask the user to specify which subtarget
will be used, we have to install the full x64 or x32
microcode package.

x64 will get the intel-microcode-64.bin
All other variants will get intel-microcode.bin

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
package/firmware/intel-microcode/Makefile [new file with mode: 0644]

diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile
new file mode 100644 (file)
index 0000000..541ce01
--- /dev/null
@@ -0,0 +1,44 @@
+#
+# 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:=20171215
+PKG_RELEASE:=1
+
+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:=eca8efc0a6dc456a8723204477e229577c1079fa5c1a10b6ba95d11e261ffa4d
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
+
+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)
+endef
+
+define Package/intel-microcode/install
+       $(INSTALL_DIR) $(1)/lib/firmware/intel-ucode
+       $(INSTALL_DATA) $(PKG_BUILD_DIR)/$(MICROCODE).bin $(1)/lib/firmware/intel-ucode
+endef
+
+$(eval $(call BuildPackage,intel-microcode))