PKG_HASH:=7a1a8bbbc6520be14e99fab40581c471861e8d731593447dfc9e9bd6b630712d
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)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/intel-microcode
define Package/intel-microcode/install
$(INSTALL_DIR) $(1)/lib/firmware/intel-ucode
$(INSTALL_DATA) $(PKG_BUILD_DIR)/intel-ucode/* $(1)/lib/firmware/intel-ucode
+ $(INSTALL_DIR) $(1)/etc/init.d
+ $(INSTALL_BIN) ./files/intel-microcode.init $(1)/etc/init.d/intel-microcode
+endef
+
+HOST_MAKE_FLAGS+= \
+ CFLAGS="$(HOST_CFLAGS)" \
+ all
+
+define Host/Install
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool $(STAGING_DIR_HOST)/bin/iucode_tool
endef
+$(eval $(call HostBuild))
$(eval $(call BuildPackage,intel-microcode))
--- /dev/null
+#
+# Copyright (C) 2016 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:=iucode-tool
+PKG_VERSION:=2.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=iucode-tool_$(PKG_VERSION).tar.xz
+PKG_SOURCE_URL:=https://gitlab.com/iucode-tool/releases/raw/latest
+PKG_HASH:=9810daf925b8a9ca244adc4e1916bcab65601c9ebe87e91c2281f78055982971
+
+PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
+
+PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
+PKG_LICENSE:=GPL-2.0
+
+PKG_INSTALL:=1
+
+include $(INCLUDE_DIR)/package.mk
+include $(INCLUDE_DIR)/host-build.mk
+
+define Package/iucode-tool
+ SECTION:=utils
+ CATEGORY:=Base system
+ URL:=$(PKG_SOURCE_URL)
+ DEPENDS:=@TARGET_x86
+ TITLE:=Intel microcode loader
+endef
+
+define Package/iucode-tool/install
+ $(INSTALL_DIR) $(1)/lib/firmware
+ $(INSTALL_DIR) $(1)/usr/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/iucode_tool $(1)/usr/bin/
+endef
+
+define Host/Install
+ $(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool $(STAGING_DIR_HOST)/bin/iucode_tool
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call BuildPackage,iucode-tool))
tools-y += mm-macros missing-macros cmake scons bc findutils gengetopt patchelf
tools-y += mtools dosfstools libressl
tools-$(CONFIG_TARGET_orion_generic) += wrt350nv2-builder upslug2
-tools-$(CONFIG_TARGET_x86) += qemu iucode-tool
+tools-$(CONFIG_TARGET_x86) += qemu
tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
tools-$(CONFIG_TARGET_ar71xx) += lzma-old squashfs
tools-$(CONFIG_USES_MINOR) += kernel2minor
+++ /dev/null
-#
-# 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:=iucode-tool
-PKG_VERSION:=2.2
-PKG_RELEASE:=1
-
-PKG_SOURCE:=iucode-tool_$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://gitlab.com/iucode-tool/releases/raw/latest
-PKG_HASH:=9810daf925b8a9ca244adc4e1916bcab65601c9ebe87e91c2281f78055982971
-
-PKG_BUILD_DEPENDS:=USE_UCLIBC:argp-standalone USE_MUSL:argp-standalone
-
-PKG_MAINTAINER:=Zoltan HERPAI <wigyori@uid0.hu>
-PKG_LICENSE:=GPL-2.0
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/host-build.mk
-
-define Host/Install
- $(INSTALL_BIN) $(HOST_BUILD_DIR)/iucode_tool $(STAGING_DIR_HOST)/bin/iucode_tool
-endef
-
-$(eval $(call HostBuild))