2 # Copyright (C) 2018 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
10 PKG_NAME:=intel-microcode
14 PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
15 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/
16 PKG_HASH:=bcc3b81c452fe4649a948c022475d76c1cdfbb730f36749a082f412f1406a3b9
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
19 PKG_BUILD_DEPENDS:=iucode-tool/host
21 ifdef CONFIG_TARGET_x86_64
22 MICROCODE:="intel-microcode-64"
24 MICROCODE:="intel-microcode"
27 include $(INCLUDE_DIR)/package.mk
29 define Package/intel-microcode
32 URL:=$(PKG_SOURCE_URL)
34 TITLE:=Intel x86 CPU microcode
38 IUCODE_TOOL=$(STAGING_DIR)/../host/bin/iucode_tool $(MAKE) -C $(PKG_BUILD_DIR)
39 mkdir $(PKG_BUILD_DIR)/intel-ucode-ipkg
40 $(STAGING_DIR)/../host/bin/iucode_tool -q \
41 --write-firmware=$(PKG_BUILD_DIR)/intel-ucode-ipkg $(PKG_BUILD_DIR)/$(MICROCODE).bin
44 define Package/intel-microcode/install
45 $(INSTALL_DIR) $(1)/lib/firmware/intel-ucode
46 $(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode-ipkg/* $(1)/lib/firmware/intel-ucode
49 $(eval $(call BuildPackage,intel-microcode))