packages: iucode-tool: collapse host/target packages into one
authorZoltan HERPAI <wigyori@uid0.hu>
Thu, 11 Jan 2018 19:37:28 +0000 (20:37 +0100)
committerZoltan HERPAI <wigyori@uid0.hu>
Thu, 11 Jan 2018 20:05:09 +0000 (21:05 +0100)
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 <wigyori@uid0.hu>
package/firmware/intel-microcode/Makefile
package/system/iucode-tool/Makefile [new file with mode: 0644]
tools/Makefile
tools/iucode-tool/Makefile [deleted file]

index 59d83ac3de7f04b1b64e4bcbc8b3bf98c3129f9c..996eb3e26f4d43a0b31f9f7137e6c29b9e909e7b 100644 (file)
@@ -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/package/system/iucode-tool/Makefile b/package/system/iucode-tool/Makefile
new file mode 100644 (file)
index 0000000..7a72e3a
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# 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))
index b1ec9a41eb63477335f1a170d9da87039a28b010..50bd552d75c91e2ff6f848ef5ea45f2f57defd40 100644 (file)
@@ -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
diff --git a/tools/iucode-tool/Makefile b/tools/iucode-tool/Makefile
deleted file mode 100644 (file)
index c576b61..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# 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))