Makefile 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=intel-microcode
  9. PKG_VERSION:=20180703
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=intel-microcode_3.$(PKG_VERSION).$(PKG_RELEASE).tar.xz
  12. PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/
  13. PKG_HASH:=26dfaa47100ce3d06f968edefa7539da10de7b96d5d8e26ee8174a040ee5cdae
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-3.$(PKG_VERSION).$(PKG_RELEASE)
  15. PKG_BUILD_DEPENDS:=iucode-tool/host
  16. ifdef CONFIG_TARGET_x86_64
  17. MICROCODE:="intel-microcode-64"
  18. else
  19. MICROCODE:="intel-microcode"
  20. endif
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/intel-microcode
  23. SECTION:=firmware
  24. CATEGORY:=Firmware
  25. URL:=$(PKG_SOURCE_URL)
  26. DEPENDS:=@TARGET_x86 +iucode-tool
  27. TITLE:=Intel x86 CPU microcode
  28. endef
  29. define Build/Compile
  30. IUCODE_TOOL=$(STAGING_DIR)/../host/bin/iucode_tool $(MAKE) -C $(PKG_BUILD_DIR)
  31. mkdir $(PKG_BUILD_DIR)/intel-ucode-ipkg
  32. $(STAGING_DIR)/../host/bin/iucode_tool -q \
  33. --write-firmware=$(PKG_BUILD_DIR)/intel-ucode-ipkg $(PKG_BUILD_DIR)/$(MICROCODE).bin
  34. endef
  35. define Package/intel-microcode/install
  36. $(INSTALL_DIR) $(1)/lib/firmware/intel-ucode
  37. $(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode-ipkg/* $(1)/lib/firmware/intel-ucode
  38. endef
  39. $(eval $(call BuildPackage,intel-microcode))