From 753cbcd24acb241341acf6d0859fbe1d3af804fb Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Thu, 11 Jan 2018 20:37:28 +0100 Subject: [PATCH] packages: iucode-tool: collapse host/target packages into one Collapse the package under tools/ and packages/ into one common makefile, using the host/ build stanzas, and make the intel microcode package depend on the hostbuild. Signed-off-by: Zoltan HERPAI --- package/firmware/intel-microcode/Makefile | 14 ++++++++++++++ {tools => package/system}/iucode-tool/Makefile | 18 +++++++++++++++++- tools/Makefile | 2 +- 3 files changed, 32 insertions(+), 2 deletions(-) rename {tools => package/system}/iucode-tool/Makefile (62%) diff --git a/package/firmware/intel-microcode/Makefile b/package/firmware/intel-microcode/Makefile index 59d83ac3de..996eb3e26f 100644 --- a/package/firmware/intel-microcode/Makefile +++ b/package/firmware/intel-microcode/Makefile @@ -16,12 +16,15 @@ PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/non-free/i/intel-microcode/ 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 @@ -42,6 +45,17 @@ endef 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)) diff --git a/tools/iucode-tool/Makefile b/package/system/iucode-tool/Makefile similarity index 62% rename from tools/iucode-tool/Makefile rename to package/system/iucode-tool/Makefile index c576b61c05..7a72e3a558 100644 --- a/tools/iucode-tool/Makefile +++ b/package/system/iucode-tool/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2018 OpenWrt.org +# Copyright (C) 2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -22,10 +22,26 @@ 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)) diff --git a/tools/Makefile b/tools/Makefile index b1ec9a41eb..50bd552d75 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -28,7 +28,7 @@ tools-y += firmware-utils patch-image quilt padjffs2 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 -- 2.30.2