b.liu | e958203 | 2025-04-17 19:18:16 +0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2018 OpenWrt.org |
| 3 | # |
| 4 | # This is free software, licensed under the GNU General Public License v2. |
| 5 | # See /LICENSE for more information. |
| 6 | # |
| 7 | |
| 8 | include $(TOPDIR)/rules.mk |
| 9 | |
| 10 | PKG_NAME:=intel-microcode |
| 11 | PKG_VERSION:=20240531 |
| 12 | PKG_RELEASE:=1 |
| 13 | |
| 14 | PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).1.tar.xz |
| 15 | PKG_SOURCE_URL:=@DEBIAN/pool/non-free-firmware/i/intel-microcode/ |
| 16 | PKG_HASH:=808cbb57a790dab7060b59b31e70e54ac47d3798d75e9784ed57a65b9f951fc4 |
| 17 | PKG_BUILD_DIR:=$(BUILD_DIR)/intel-microcode-3.$(PKG_VERSION).1 |
| 18 | PKG_CPE_ID:=cpe:/a:intel:microcode |
| 19 | |
| 20 | PKG_BUILD_DEPENDS:=iucode-tool/host |
| 21 | |
| 22 | ifdef CONFIG_TARGET_x86_64 |
| 23 | MICROCODE:="intel-microcode-64" |
| 24 | else |
| 25 | MICROCODE:="intel-microcode" |
| 26 | endif |
| 27 | |
| 28 | PKG_FLAGS:=nonshared |
| 29 | |
| 30 | include $(INCLUDE_DIR)/package.mk |
| 31 | |
| 32 | define Package/intel-microcode |
| 33 | SECTION:=firmware |
| 34 | CATEGORY:=Firmware |
| 35 | URL:=$(PKG_SOURCE_URL) |
| 36 | DEPENDS:=@TARGET_x86 |
| 37 | TITLE:=Intel x86 CPU microcode |
| 38 | endef |
| 39 | |
| 40 | define Build/Compile |
| 41 | IUCODE_TOOL=$(STAGING_DIR)/../host/bin/iucode_tool $(MAKE) -C $(PKG_BUILD_DIR) |
| 42 | mkdir $(PKG_BUILD_DIR)/intel-ucode-ipkg |
| 43 | $(STAGING_DIR)/../host/bin/iucode_tool -q \ |
| 44 | --write-firmware=$(PKG_BUILD_DIR)/intel-ucode-ipkg $(PKG_BUILD_DIR)/$(MICROCODE).bin |
| 45 | endef |
| 46 | |
| 47 | define Package/intel-microcode/install |
| 48 | $(INSTALL_DIR) $(1)/lib/firmware/intel-ucode |
| 49 | $(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode-ipkg/* $(1)/lib/firmware/intel-ucode |
| 50 | endef |
| 51 | |
| 52 | $(eval $(call BuildPackage,intel-microcode)) |