All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 00/10] Adding mender-artifact
@ 2019-02-05 16:00 Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 01/10] package/pkg-golang: add support for building host packages Angelo Compagnucci
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch tries to resurrect an effort of Mizra from August to porting
the mender-artifact tool to buildroot
(https://patchwork.ozlabs.org/cover/962487/).
 
Mender artifact is a tool to generate artifacts for the mender software,
it is therefore an host tool and it's the last piece to have mender
available on buildroot.
To have it compiled as an host tool, we need to enable support for host
packages in go.
So the intent of this patch is:
* Enabling host golang packages
* Refactoring dependencies to distinguish between host packages and
  target packages
* Adding mender-artifact

The initial patch for mender-artifact was from Mizra but I completely
rewrote it, so I removed the signoff.

Angelo Compagnucci (9):
  package/go: refactor host/target dependencies
  package/docker-cli: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  package/docker-containerd: using
    BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  package/docker-engine: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  package/docker-proxy: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  package/flannel: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  package/mender: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  package/runc: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  package/mender-artifact: new package

Mirza Krak (1):
  package/pkg-golang: add support for building host packages

 DEVELOPERS                                   |  1 +
 docs/manual/adding-packages-golang.txt       |  5 ++--
 package/Config.in.host                       |  1 +
 package/docker-cli/Config.in                 |  6 ++---
 package/docker-containerd/Config.in          |  6 ++---
 package/docker-engine/Config.in              |  6 ++---
 package/docker-proxy/Config.in               |  6 ++---
 package/flannel/Config.in                    |  6 ++---
 package/go/Config.in.host                    | 12 ++++++---
 package/mender-artifact/Config.in.host       | 18 ++++++++++++++
 package/mender-artifact/mender-artifact.hash | 28 +++++++++++++++++++++
 package/mender-artifact/mender-artifact.mk   | 32 ++++++++++++++++++++++++
 package/mender/Config.in                     |  6 ++---
 package/pkg-golang.mk                        | 37 +++++++++++++++++++++++++---
 package/runc/Config.in                       |  6 ++---
 15 files changed, 140 insertions(+), 36 deletions(-)
 create mode 100644 package/mender-artifact/Config.in.host
 create mode 100644 package/mender-artifact/mender-artifact.hash
 create mode 100644 package/mender-artifact/mender-artifact.mk

-- 
2.7.4

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 01/10] package/pkg-golang: add support for building host packages
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 02/10] package/go: refactor host/target dependencies Angelo Compagnucci
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

From: Mirza Krak <mirza.krak@northern.tech>

With this you can add:

    $(eval $(host-golang-package))

to a package .mk file to build for host.

Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
Acked-by: Angelo Compagnucci <angelo@amarulasolutions.com>
Tested-by: Angelo Compagnucci <angelo@amarulasolutions.com>
Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 docs/manual/adding-packages-golang.txt |  5 +++--
 package/pkg-golang.mk                  | 37 +++++++++++++++++++++++++++++++---
 2 files changed, 37 insertions(+), 5 deletions(-)

diff --git a/docs/manual/adding-packages-golang.txt b/docs/manual/adding-packages-golang.txt
index efcf696..9452048 100644
--- a/docs/manual/adding-packages-golang.txt
+++ b/docs/manual/adding-packages-golang.txt
@@ -50,8 +50,9 @@ and +BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS+ because Buildroot will
 automatically add a dependency on +host-go+ to such packages.
 
 The main macro of the Go package infrastructure is
-+golang-package+. It is similar to the +generic-package+ macro. Only
-target packages are supported with +golang-package+.
++golang-package+. It is similar to the +generic-package+ macro. The
+ability to build host packages is also available, with the
++host-golang-package+ macro.
 
 Just like the generic infrastructure, the Go infrastructure works
 by defining a number of variables before calling the +golang-package+.
diff --git a/package/pkg-golang.mk b/package/pkg-golang.mk
index 4f2c7e7..b4e8a53 100644
--- a/package/pkg-golang.mk
+++ b/package/pkg-golang.mk
@@ -25,12 +25,18 @@ GO_BIN = $(HOST_DIR)/bin/go
 
 # We pass an empty GOBIN, otherwise "go install: cannot install
 # cross-compiled binaries when GOBIN is set"
-GO_TARGET_ENV = \
-	$(HOST_GO_TARGET_ENV) \
+GO_COMMON_ENV = \
 	PATH=$(BR_PATH) \
 	GOBIN= \
 	CGO_ENABLED=$(HOST_GO_CGO_ENABLED)
 
+GO_TARGET_ENV = \
+	$(HOST_GO_TARGET_ENV) \
+	$(GO_COMMON_ENV)
+
+GO_HOST_ENV = \
+	$(GO_COMMON_ENV)
+
 ################################################################################
 # inner-golang-package -- defines how the configuration, compilation and
 # installation of a Go package should be done, implements a few hooks to tune
@@ -44,7 +50,6 @@ GO_TARGET_ENV = \
 #             packages
 #  argument 4 is the type (target or host)
 #
-# NOTE Only type target is supported at the moment
 ################################################################################
 
 define inner-golang-package
@@ -98,6 +103,8 @@ endif
 # Build step. Only define it if not already defined by the package .mk
 # file.
 ifndef $(2)_BUILD_CMDS
+ifeq ($(4),target)
+# Build package for target
 define $(2)_BUILD_CMDS
 	$$(foreach d,$$($(2)_BUILD_TARGETS),\
 		cd $$($(2)_SRC_PATH); \
@@ -109,6 +116,20 @@ define $(2)_BUILD_CMDS
 			./$$(d)
 	)
 endef
+else
+# Build package for host
+define $(2)_BUILD_CMDS
+	$$(foreach d,$$($(2)_BUILD_TARGETS),\
+		cd $$($(2)_SRC_PATH); \
+		$$(GO_HOST_ENV) \
+			GOPATH="$$(@D)/$$($(2)_WORKSPACE)" \
+			$$($(2)_GO_ENV) \
+			$$(GO_BIN) build -v $$($(2)_BUILD_OPTS) \
+			-o $$(@D)/bin/$$(or $$($(2)_BIN_NAME),$$(notdir $$(d))) \
+			./$$(d)
+	)
+endef
+endif
 endif
 
 # Target installation step. Only define it if not already defined by the
@@ -121,6 +142,15 @@ define $(2)_INSTALL_TARGET_CMDS
 endef
 endif
 
+# Host installation step
+ifndef $(2)_INSTALL_CMDS
+define $(2)_INSTALL_CMDS
+	$$(foreach d,$$($(2)_INSTALL_BINS),\
+		$(INSTALL) -D -m 0755 $$(@D)/bin/$$(d) $(HOST_DIR)/bin/$$(d)
+	)
+endef
+endif
+
 # Call the generic package infrastructure to generate the necessary make
 # targets
 $(call inner-generic-package,$(1),$(2),$(3),$(4))
@@ -132,3 +162,4 @@ endef # inner-golang-package
 ################################################################################
 
 golang-package = $(call inner-golang-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
+host-golang-package = $(call inner-golang-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 02/10] package/go: refactor host/target dependencies
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 01/10] package/pkg-golang: add support for building host packages Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 03/10] package/docker-cli: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS Angelo Compagnucci
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

In order to better handling the host/target dependencies of packages, we
need to add the new configuration option BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS.
All golang target packages should depends on this options.
Host packages needs to depend instead on the already available
BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/go/Config.in.host | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/go/Config.in.host b/package/go/Config.in.host
index f619ca0..508f664 100644
--- a/package/go/Config.in.host
+++ b/package/go/Config.in.host
@@ -1,4 +1,4 @@
-config BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+config BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
 	bool
 	default y
 	depends on !BR2_TOOLCHAIN_HAS_BINUTILS_BUG_20006
@@ -10,10 +10,16 @@ config BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
 	# MIPS R6 support in Go has not yet been developed.
 	depends on !BR2_MIPS_CPU_MIPS64R6
 
-config BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+config BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
 	bool
 	default y
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
 	# Go doesn't support CGO linking on MIPS64x platforms
 	# See: https://github.com/karalabe/xgo/issues/46
 	depends on !BR2_mips64 && !BR2_mips64el
+
+config BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
+	bool
+	default y
+	depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 03/10] package/docker-cli: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 01/10] package/pkg-golang: add support for building host packages Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 02/10] package/go: refactor host/target dependencies Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 04/10] package/docker-containerd: " Angelo Compagnucci
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch moves the package to use the newly added
BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS in order to state clearly that
this package depends on the go compiler for target.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/docker-cli/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/docker-cli/Config.in b/package/docker-cli/Config.in
index 82c35c4..2547fdc 100644
--- a/package/docker-cli/Config.in
+++ b/package/docker-cli/Config.in
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_DOCKER_CLI
 	bool "docker-cli"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  Docker is a platform to build, ship,
@@ -20,6 +19,5 @@ config BR2_PACKAGE_DOCKER_CLI_STATIC
 endif
 
 comment "docker-cli needs a toolchain w/ threads"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 04/10] package/docker-containerd: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (2 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 03/10] package/docker-cli: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 05/10] package/docker-engine: " Angelo Compagnucci
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch moves the package to use the newly added
BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS in order to state clearly that
this package depends on the go compiler for target.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/docker-containerd/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/docker-containerd/Config.in b/package/docker-containerd/Config.in
index 851345f..ed799fa 100644
--- a/package/docker-containerd/Config.in
+++ b/package/docker-containerd/Config.in
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_DOCKER_CONTAINERD
 	bool "docker-containerd"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_USE_MMU # util-linux
 	select BR2_PACKAGE_RUNC # runtime dependency
@@ -28,7 +27,6 @@ config BR2_PACKAGE_DOCKER_CONTAINERD_DRIVER_BTRFS
 endif
 
 comment "docker-containerd needs a toolchain w/ threads"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_USE_MMU
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 05/10] package/docker-engine: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (3 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 04/10] package/docker-containerd: " Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 06/10] package/docker-proxy: " Angelo Compagnucci
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch moves the package to use the newly added
BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS in order to state clearly that
this package depends on the go compiler for target.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/docker-engine/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/docker-engine/Config.in b/package/docker-engine/Config.in
index 2a0c130..0366e9d 100644
--- a/package/docker-engine/Config.in
+++ b/package/docker-engine/Config.in
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_DOCKER_ENGINE
 	bool "docker-engine"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_USE_MMU # docker-containerd
 	select BR2_PACKAGE_DOCKER_CONTAINERD # runtime dependency
@@ -50,7 +49,6 @@ config BR2_PACKAGE_DOCKER_ENGINE_DRIVER_VFS
 endif
 
 comment "docker-engine needs a toolchain w/ threads"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_USE_MMU
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 06/10] package/docker-proxy: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (4 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 05/10] package/docker-engine: " Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 07/10] package/flannel: " Angelo Compagnucci
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch moves the package to use the newly added
BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS in order to state clearly that
this package depends on the go compiler for target.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/docker-proxy/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/docker-proxy/Config.in b/package/docker-proxy/Config.in
index 596e18a..4a256f7 100644
--- a/package/docker-proxy/Config.in
+++ b/package/docker-proxy/Config.in
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_DOCKER_PROXY
 	bool "docker-proxy"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  Libnetwork is a Container Network Model that provides a
@@ -14,6 +13,5 @@ config BR2_PACKAGE_DOCKER_PROXY
 	  https://github.com/docker/libnetwork
 
 comment "docker-proxy needs a toolchain w/ threads"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 07/10] package/flannel: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (5 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 06/10] package/docker-proxy: " Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 08/10] package/mender: " Angelo Compagnucci
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch moves the package to use the newly added
BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS in order to state clearly that
this package depends on the go compiler for target.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/flannel/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/flannel/Config.in b/package/flannel/Config.in
index 134111b..024b94c 100644
--- a/package/flannel/Config.in
+++ b/package/flannel/Config.in
@@ -1,12 +1,10 @@
 comment "flannel needs a toolchain w/ threads"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS && \
-		BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
 
 config BR2_PACKAGE_FLANNEL
 	bool "flannel"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  Flannel is a virtual network that gives a subnet to each
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 08/10] package/mender: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (6 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 07/10] package/flannel: " Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 09/10] package/runc: " Angelo Compagnucci
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch moves the package to use the newly added
BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS in order to state clearly that
this package depends on the go compiler for target.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/mender/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/mender/Config.in b/package/mender/Config.in
index aeb0b26..2f038eb 100644
--- a/package/mender/Config.in
+++ b/package/mender/Config.in
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_MENDER
 	bool "mender"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	select BR2_PACKAGE_UBOOT_TOOLS # runtime
 	select BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV # runtime
@@ -14,6 +13,5 @@ config BR2_PACKAGE_MENDER
 	  https://github.com/mendersoftware/mender
 
 comment "mender needs a toolchain w/ threads"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 09/10] package/runc: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (7 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 08/10] package/mender: " Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 10/10] package/mender-artifact: new package Angelo Compagnucci
  2019-02-06  9:35 ` [Buildroot] [PATCH v2 00/10] Adding mender-artifact Thomas Petazzoni
  10 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

This patch moves the package to use the newly added
BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS in order to state clearly that
this package depends on the go compiler for target.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/runc/Config.in | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/runc/Config.in b/package/runc/Config.in
index fd5dee7..01ae5ad 100644
--- a/package/runc/Config.in
+++ b/package/runc/Config.in
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_RUNC
 	bool "runc"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
-	depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	help
 	  runC is a CLI tool for spawning and running containers
@@ -10,6 +9,5 @@ config BR2_PACKAGE_RUNC
 	  https://github.com/opencontainers/runc
 
 comment "runc needs a toolchain w/ threads"
-	depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS && \
-		BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
+	depends on BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS
 	depends on !BR2_TOOLCHAIN_HAS_THREADS
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 10/10] package/mender-artifact: new package
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (8 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 09/10] package/runc: " Angelo Compagnucci
@ 2019-02-05 16:00 ` Angelo Compagnucci
  2019-02-06  9:35   ` Thomas Petazzoni
  2019-02-06  9:35 ` [Buildroot] [PATCH v2 00/10] Adding mender-artifact Thomas Petazzoni
  10 siblings, 1 reply; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-05 16:00 UTC (permalink / raw)
  To: buildroot

mender-artifact is a host tool to generate update images
in the Mender artifact file format.
This package uses the binary archive from github because it bundles the
external dependencies.

Example usage:

    $ mender-artifact write rootfs-image \
         --update rootfs.ext4 \
         --output-path rootfs.mender \
         --artifact-name "release-v1.0.0" \
         --device-type "beaglebone"

Above will generate a Mender artifact called "rootfs.mender"
containing the "rootfs.ext4" image along with meta-data.

One can read-out the meta-data with the following command:

    $ mender-artifact read rootfs.mender
      Mender artifact:
      Name: release-v1.0.0
      Format: mender
      Version: 2
      Signature: no signature
      Compatible devices: '[beaglebone]'

    Updates:
      0000:
        Type:   rootfs-image
        Files:
          name:     rootfs.ext4
          size:     52428800
          modified: 2018-08-27 09:10:55 +0200 CEST
          checksum: e70b113fb0964a810a3043586eb4fc1c48e684ba78b02ba65fead4aa3e540d87

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
[v1 -> v2]
* Adding LDFLAGS to set the software version
* Rewording the commit message

 DEVELOPERS                                   |  1 +
 package/Config.in.host                       |  1 +
 package/mender-artifact/Config.in.host       | 18 ++++++++++++++++
 package/mender-artifact/mender-artifact.hash | 28 ++++++++++++++++++++++++
 package/mender-artifact/mender-artifact.mk   | 32 ++++++++++++++++++++++++++++
 5 files changed, 80 insertions(+)
 create mode 100644 package/mender-artifact/Config.in.host
 create mode 100644 package/mender-artifact/mender-artifact.hash
 create mode 100644 package/mender-artifact/mender-artifact.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 59e1f32..be223b2 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1560,6 +1560,7 @@ F:	package/shadowsocks-libev/
 
 N:	Mirza Krak <mirza.krak@northern.tech>
 F:	package/mender/
+F:	package/mender-artifact/
 
 N:	Morgan Delestre <m.delestre@sinters.fr>
 F:	package/monkey/
diff --git a/package/Config.in.host b/package/Config.in.host
index 3b75f23..9916114 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -33,6 +33,7 @@ menu "Host utilities"
 	source "package/jsmin/Config.in.host"
 	source "package/lpc3250loader/Config.in.host"
 	source "package/lttng-babeltrace/Config.in.host"
+	source "package/mender-artifact/Config.in.host"
 	source "package/mfgtools/Config.in.host"
 	source "package/mkpasswd/Config.in.host"
 	source "package/mtd/Config.in.host"
diff --git a/package/mender-artifact/Config.in.host b/package/mender-artifact/Config.in.host
new file mode 100644
index 0000000..181d57d
--- /dev/null
+++ b/package/mender-artifact/Config.in.host
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_HOST_MENDER_ARTIFACT
+	bool "host mender-artifact"
+	depends on BR2_PACKAGE_HOST_GO_BOOTSTRAP_ARCH_SUPPORTS
+	help
+	  The mender-artifact tool is a CLI implementation of the
+	  Mender artifacts library.
+
+	  A Mender artifact can be recognized by its .mender suffix.
+	  Mender artifacts can contain binaries, metadata, checksums,
+	  signatures and scripts that are used during a deployment.
+	  The artifact format acts as a wrapper, and uses the tar
+	  format to bundle several files into one.
+
+	  In its simplest form, an artifact contains just a rootfs
+	  image, along with its checksum, id and device type
+	  compatibility.
+
+	  https://github.com/mendersoftware/mender-artifact
diff --git a/package/mender-artifact/mender-artifact.hash b/package/mender-artifact/mender-artifact.hash
new file mode 100644
index 0000000..d44244d
--- /dev/null
+++ b/package/mender-artifact/mender-artifact.hash
@@ -0,0 +1,28 @@
+# Locally computed:
+sha256 fde448af4811600a130b243d59e21b1f9cdd60fd991bd418246c913ebf945206 2.4.0.tar.gz
+
+# License hash extracted from LIC_FILES_CHKSUM.sha256 using the
+# following command:
+#
+#     sed '/^[A-Za-z0-9_]/s/^/sha256  /' LIC_FILES_CHKSUM.sha256
+
+# Apache 2.0 licenses.
+sha256 98ed35b5a138f58164b5c0dbccd9d7f01ef4d84b9dba01e896f0a3241c50c0f7 LICENSE
+sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 vendor/github.com/mendersoftware/mendertesting/LICENSE
+#
+# BSD 2 Clause licenses.
+sha256 8d427fd87bc9579ea368fde3d49f9ca22eac857f91a9dec7e3004bdfab7dee86 vendor/github.com/pkg/errors/LICENSE
+#
+# BSD 3 Clause licenses.
+sha256 2eb550be6801c1ea434feba53bf6d12e7c71c90253e0a9de4a4f46cf88b56477 vendor/github.com/pmezard/go-difflib/LICENSE
+sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 vendor/golang.org/x/sys/LICENSE
+sha256 2d36597f7117c38b006835ae7f537487207d8ec407aa9d9980794b2030cbc067 vendor/golang.org/x/crypto/LICENSE
+#
+# ISC licenses.
+sha256 3525392c6db3b804af76980b2c560ee9ec1abdadd907d76a26091df7c78f3a25 vendor/github.com/davecgh/go-spew/LICENSE
+#
+# MIT licenses.
+sha256 402f39eed8a1851385d0703999aa9f23d067c2ea3e15c63c074e389cbf8f8f8f vendor/github.com/stretchr/testify/LICENSE
+sha256 402f39eed8a1851385d0703999aa9f23d067c2ea3e15c63c074e389cbf8f8f8f vendor/github.com/stretchr/testify/LICENSE
+sha256 da277af11b85227490377fbcac6afccc68be560c4fff36ac05ca62de55345fd7 vendor/github.com/urfave/cli/LICENSE
+sha256 51a0c9ec7f8b7634181b8d4c03e5b5d204ac21d6e72f46c313973424664b2e6b vendor/github.com/sirupsen/logrus/LICENSE
diff --git a/package/mender-artifact/mender-artifact.mk b/package/mender-artifact/mender-artifact.mk
new file mode 100644
index 0000000..90d0071
--- /dev/null
+++ b/package/mender-artifact/mender-artifact.mk
@@ -0,0 +1,32 @@
+################################################################################
+#
+# host-mender-artifact
+#
+################################################################################
+
+HOST_MENDER_ARTIFACT_VERSION = 2.4.0
+HOST_MENDER_ARTIFACT_SITE = https://github.com/mendersoftware/mender-artifact/archive
+HOST_MENDER_ARTIFACT_SOURCE = $(HOST_MENDER_ARTIFACT_VERSION).tar.gz
+HOST_MENDER_ARTIFACT_LICENSE = Apache2.0, BSD-2-Clause, BSD-3-Clause, ISC, MIT
+HOST_MENDER_ARTIFACT_LICENSE_FILES = \
+	LICENSE \
+	LIC_FILES_CHKSUM.sha256 \
+	vendor/github.com/mendersoftware/mendertesting/LICENSE \
+	vendor/github.com/pkg/errors/LICENSE \
+	vendor/github.com/pmezard/go-difflib/LICENSE \
+	vendor/golang.org/x/sys/LICENSE \
+	vendor/golang.org/x/crypto/LICENSE \
+	vendor/github.com/davecgh/go-spew/LICENSE \
+	vendor/github.com/stretchr/testify/LICENSE \
+	vendor/github.com/stretchr/testify/LICENSE \
+	vendor/github.com/urfave/cli/LICENSE \
+	vendor/github.com/sirupsen/logrus/LICENSE
+
+HOST_MENDER_ARTIFACT_LDFLAGS = -X main.Version=$(HOST_MENDER_ARTIFACT_VERSION)
+
+HOST_MENDER_ARTIFACT_BUILD_TARGETS = cli/mender-artifact
+
+HOST_MENDER_ARTIFACT_BIN_NAME = mender-artifact
+HOST_MENDER_ARTIFACT_INSTALL_BINS = $(HOST_MENDER_ARTIFACT_BIN_NAME)
+
+$(eval $(host-golang-package))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 00/10] Adding mender-artifact
  2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
                   ` (9 preceding siblings ...)
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 10/10] package/mender-artifact: new package Angelo Compagnucci
@ 2019-02-06  9:35 ` Thomas Petazzoni
  10 siblings, 0 replies; 14+ messages in thread
From: Thomas Petazzoni @ 2019-02-06  9:35 UTC (permalink / raw)
  To: buildroot

Hello Angelo,

On Tue,  5 Feb 2019 17:00:26 +0100
Angelo Compagnucci <angelo@amarulasolutions.com> wrote:

> This patch tries to resurrect an effort of Mizra from August to porting
> the mender-artifact tool to buildroot
> (https://patchwork.ozlabs.org/cover/962487/).
>  
> Mender artifact is a tool to generate artifacts for the mender software,
> it is therefore an host tool and it's the last piece to have mender
> available on buildroot.
> To have it compiled as an host tool, we need to enable support for host
> packages in go.
> So the intent of this patch is:
> * Enabling host golang packages
> * Refactoring dependencies to distinguish between host packages and
>   target packages
> * Adding mender-artifact
> 
> The initial patch for mender-artifact was from Mizra but I completely
> rewrote it, so I removed the signoff.
> 
> Angelo Compagnucci (9):
>   package/go: refactor host/target dependencies
>   package/docker-cli: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
>   package/docker-containerd: using
>     BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
>   package/docker-engine: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
>   package/docker-proxy: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
>   package/flannel: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
>   package/mender: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
>   package/runc: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS
>   package/mender-artifact: new package
> 
> Mirza Krak (1):
>   package/pkg-golang: add support for building host packages


As we discussed live during the meeting, I'd like to see the following
changes in this series:

 - The patch renaming BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS to
   BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS should go first in the
   series, and should contain all the changes to the packages as well
   (to not break bisectability). Of course, it should also contain the
   BR2_PACKAGE_HOST_GO_TARGET_CGO_LINKING_SUPPORTS change.

 - The patch adding support for host go packages should add a
   BR2_PACKAGE_HOST_GO_HOST_ARCH_SUPPORTS option, and the manual should
   be updated to explain how this option should be used.

 - There should be a comment above both options in the Config.in.host
   file to explain which option should be used for what.

 - BR2_PACKAGE_HOST_GO_TARGET_SUPPORTS should be removed.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 10/10] package/mender-artifact: new package
  2019-02-05 16:00 ` [Buildroot] [PATCH v2 10/10] package/mender-artifact: new package Angelo Compagnucci
@ 2019-02-06  9:35   ` Thomas Petazzoni
  2019-02-06 13:27     ` Angelo Compagnucci
  0 siblings, 1 reply; 14+ messages in thread
From: Thomas Petazzoni @ 2019-02-06  9:35 UTC (permalink / raw)
  To: buildroot

Hello,

On Tue,  5 Feb 2019 17:00:36 +0100
Angelo Compagnucci <angelo@amarulasolutions.com> wrote:

> diff --git a/DEVELOPERS b/DEVELOPERS
> index 59e1f32..be223b2 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1560,6 +1560,7 @@ F:	package/shadowsocks-libev/
>  
>  N:	Mirza Krak <mirza.krak@northern.tech>
>  F:	package/mender/
> +F:	package/mender-artifact/

It is a bit strange that you are submitting this package, but Mirza is
assigned for it in the DEVELOPERS file.


Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [Buildroot] [PATCH v2 10/10] package/mender-artifact: new package
  2019-02-06  9:35   ` Thomas Petazzoni
@ 2019-02-06 13:27     ` Angelo Compagnucci
  0 siblings, 0 replies; 14+ messages in thread
From: Angelo Compagnucci @ 2019-02-06 13:27 UTC (permalink / raw)
  To: buildroot

Il giorno mer 6 feb 2019 alle ore 10:36 Thomas Petazzoni
<thomas.petazzoni@bootlin.com> ha scritto:
>
> Hello,
>
> On Tue,  5 Feb 2019 17:00:36 +0100
> Angelo Compagnucci <angelo@amarulasolutions.com> wrote:
>
> > diff --git a/DEVELOPERS b/DEVELOPERS
> > index 59e1f32..be223b2 100644
> > --- a/DEVELOPERS
> > +++ b/DEVELOPERS
> > @@ -1560,6 +1560,7 @@ F:      package/shadowsocks-libev/
> >
> >  N:   Mirza Krak <mirza.krak@northern.tech>
> >  F:   package/mender/
> > +F:   package/mender-artifact/
>
> It is a bit strange that you are submitting this package, but Mirza is
> assigned for it in the DEVELOPERS file.

Fixed in V3!

Thanks!
>
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-02-06 13:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 16:00 [Buildroot] [PATCH v2 00/10] Adding mender-artifact Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 01/10] package/pkg-golang: add support for building host packages Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 02/10] package/go: refactor host/target dependencies Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 03/10] package/docker-cli: using BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 04/10] package/docker-containerd: " Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 05/10] package/docker-engine: " Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 06/10] package/docker-proxy: " Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 07/10] package/flannel: " Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 08/10] package/mender: " Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 09/10] package/runc: " Angelo Compagnucci
2019-02-05 16:00 ` [Buildroot] [PATCH v2 10/10] package/mender-artifact: new package Angelo Compagnucci
2019-02-06  9:35   ` Thomas Petazzoni
2019-02-06 13:27     ` Angelo Compagnucci
2019-02-06  9:35 ` [Buildroot] [PATCH v2 00/10] Adding mender-artifact Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.