Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2] package/mender: new package
@ 2018-05-03 21:52 Angelo Compagnucci
  2018-05-04  7:23 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Angelo Compagnucci @ 2018-05-03 21:52 UTC (permalink / raw)
  To: buildroot

From: Angelo Compagnucci <angelo.compagnucci@gmail.com>

This patch adds mender, an open source over-the-air (OTA) software
updater for embedded Linux devices.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
---
 package/Config.in                        |  1 +
 package/mender/Config.in                 | 14 +++++++++
 package/mender/mender-device-identity    | 52 ++++++++++++++++++++++++++++++++
 package/mender/mender-inventory-hostinfo | 21 +++++++++++++
 package/mender/mender-inventory-network  | 47 +++++++++++++++++++++++++++++
 package/mender/mender.conf               | 14 +++++++++
 package/mender/mender.hash               |  2 ++
 package/mender/mender.mk                 | 31 +++++++++++++++++++
 package/mender/mender.service            | 15 +++++++++
 package/mender/server.crt                | 22 ++++++++++++++
 package/mender/tenant.conf               |  0
 11 files changed, 219 insertions(+)
 create mode 100644 package/mender/Config.in
 create mode 100644 package/mender/mender-device-identity
 create mode 100644 package/mender/mender-inventory-hostinfo
 create mode 100644 package/mender/mender-inventory-network
 create mode 100644 package/mender/mender.conf
 create mode 100644 package/mender/mender.hash
 create mode 100644 package/mender/mender.mk
 create mode 100644 package/mender/mender.service
 create mode 100644 package/mender/server.crt
 create mode 100644 package/mender/tenant.conf

diff --git a/package/Config.in b/package/Config.in
index fe36d31..d87ccbd 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -2006,6 +2006,7 @@ menu "System tools"
 	source "package/kvmtool/Config.in"
 	source "package/libostree/Config.in"
 	source "package/lxc/Config.in"
+	source "package/mender/Config.in"
 	source "package/monit/Config.in"
 	source "package/ncdu/Config.in"
 	source "package/numactl/Config.in"
diff --git a/package/mender/Config.in b/package/mender/Config.in
new file mode 100644
index 0000000..b80ad4a
--- /dev/null
+++ b/package/mender/Config.in
@@ -0,0 +1,14 @@
+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_TOOLCHAIN_HAS_THREADS
+	depends on BR2_INIT_SYSTEMD
+
+	help
+	  Mender is an open source over-the-air (OTA) software updater for
+	  embedded Linux devices. Mender comprises a client running at the
+	  embedded device, as well as a server that manages deployments
+	  across many devices.
+
+	  https://github.com/mendersoftware/mender
diff --git a/package/mender/mender-device-identity b/package/mender/mender-device-identity
new file mode 100644
index 0000000..d87f843
--- /dev/null
+++ b/package/mender/mender-device-identity
@@ -0,0 +1,52 @@
+#!/bin/sh
+
+# Example script called by Mender agent to collect device identity data. The
+# script needs to be located at
+# $(datadir)/mender/identity/mender-device-identity path for the agent to find
+# it. The script shall exit with non-0 status on errors. In this case the agent
+# will discard any output the script may have produced.
+#
+# The script shall output identity data in <key>=<value> format, one
+# entry per line. Example
+#
+# $ ./mender-device-identity
+# mac=de:ad:ca:fe:00:01
+# cpuid=1112233
+#
+# The example script collects the MAC address of a network interface with the
+# type ARPHRD_ETHER and it will pick the interface with the lowest ifindex
+# number if there are multiple interfaces with that type. The identity data is
+# output in the following format:
+#
+# mac=00:01:02:03:04:05
+#
+
+set -ue
+
+SCN=/sys/class/net
+min=65535
+arphrd_ether=1
+ifdev=
+
+# find iface with lowest ifindex, skip non ARPHRD_ETHER types (lo, sit ...)
+for dev in $SCN/*; do
+    iftype=$(cat $dev/type)
+    if [ $iftype -ne $arphrd_ether ]; then
+        continue
+    fi
+
+    idx=$(cat $dev/ifindex)
+    if [ $idx -lt $min ]; then
+        min=$idx
+        ifdev=$dev
+    fi
+done
+
+if [ -z "$ifdev" ]; then
+    echo "no suitable interfaces found" >&2
+    exit 1
+else
+    echo "using interface $ifdev" >&2
+    # grab MAC address
+    echo "mac=$(cat $ifdev/address)"
+fi
diff --git a/package/mender/mender-inventory-hostinfo b/package/mender/mender-inventory-hostinfo
new file mode 100644
index 0000000..cf508fd
--- /dev/null
+++ b/package/mender/mender-inventory-hostinfo
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# The example script collects information about current host
+#
+
+set -ue
+
+LC_ALL=C
+export LC_ALL
+
+grep 'model name' /proc/cpuinfo | uniq | awk -F': ' '
+     // { printf("cpu_model=%s\n", $2);}
+'
+echo "kernel=$(cat /proc/version)"
+
+cat /proc/meminfo | awk '
+/MemTotal/ {printf("mem_total_kB=%d\n", $2)}
+'
+
+echo "hostname=$(cat /etc/hostname)"
+
diff --git a/package/mender/mender-inventory-network b/package/mender/mender-inventory-network
new file mode 100644
index 0000000..b017c4e
--- /dev/null
+++ b/package/mender/mender-inventory-network
@@ -0,0 +1,47 @@
+#!/bin/sh
+#
+# Example script called by Mender agent to collect inventory data for a
+# particular devce. The script needs to be located in $(datadir)/mender and its
+# name shall start with `mender-inventory-` prefix. The script shall exit with
+# non-0 status on errors. In this case the agent will discard any output the
+# script may have produced.
+#
+# The script shall output inventory data in <key>=<value> format, one entry per
+# line. Entries appearing multiple times will be joined in a list under the same
+# key.
+#
+# $ ./mender-inventory-network
+# mac_br-fbfdad18c33c=02:42:7e:74:96:85
+# network_interfaces=br-fbfdad18c33c
+# ipv4_br-fbfdad18c33c=172.21.0.1/16
+# mac_enp0s25=de:ad:be:ef:bb:05
+# network_interfaces=enp0s25
+# ipv4_enp0s25=123.22.0.197/16
+# ipv4_enp0s25=10.20.20.105/16
+# ipv6_enp0s25=fe80::2aad:beff:feef:bb05/64
+#
+#
+# The example script collects the list of network interfaces, as well as
+# ethernet and IP addresses of each of the interfaces.
+#
+
+set -ue
+
+SCN=/sys/class/net
+min=65535
+ifdev=
+
+# find iface with lowest ifindex, except loopback
+for devpath in $SCN/*; do
+    dev=$(basename $devpath)
+    if [ $dev = "lo" ]; then
+        continue
+    fi
+    echo "mac_$dev=$(cat $devpath/address)"
+    echo "network_interfaces=$dev"
+
+    ip addr show dev $dev | awk -v dev=$dev '
+       /inet / { printf("ipv4_%s=%s\n", dev, $2) }
+       /inet6 / {printf("ipv6_%s=%s\n", dev, $2) }
+    '
+done
diff --git a/package/mender/mender.conf b/package/mender/mender.conf
new file mode 100644
index 0000000..a5c7c54
--- /dev/null
+++ b/package/mender/mender.conf
@@ -0,0 +1,14 @@
+{
+  "ClientProtocol": "http",
+  "HttpsClient": {
+    "Certificate": "",
+    "Key": ""
+  },
+  "RootfsPartA": "@MENDER_ROOTFS_PART_A@",
+  "RootfsPartB": "@MENDER_ROOTFS_PART_B@",
+  "UpdatePollIntervalSeconds": @MENDER_UPDATE_POLL_INTERVAL_SECONDS@,
+  "InventoryPollIntervalSeconds": @MENDER_INVENTORY_POLL_INTERVAL_SECONDS@,
+  "RetryPollIntervalSeconds": @MENDER_RETRY_POLL_INTERVAL_SECONDS@,
+  "ServerURL": "@MENDER_SERVER_URL@",
+  "ServerCertificate": "@MENDER_CERT_LOCATION@"
+}
diff --git a/package/mender/mender.hash b/package/mender/mender.hash
new file mode 100644
index 0000000..30a04fa
--- /dev/null
+++ b/package/mender/mender.hash
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256 267fa73ad472b034248ee298593b5c52ea0b105fd73c91febb3587280c61bee2 mender-1.4.0.tar.gz
diff --git a/package/mender/mender.mk b/package/mender/mender.mk
new file mode 100644
index 0000000..c0c4aba
--- /dev/null
+++ b/package/mender/mender.mk
@@ -0,0 +1,31 @@
+################################################################################
+#
+# mender
+#
+################################################################################
+
+MENDER_VERSION = 1.4.0
+MENDER_SOURCE = mender-$(MENDER_VERSION).tar.gz
+MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION))
+
+define MENDER_INSTALL_TARGET_CMDS
+	$(INSTALL) -dm 0755 $(TARGET_DIR)/etc/mender/
+	$(INSTALL) -dm 0755 $(TARGET_DIR)/var/share/mender/identity/
+	$(INSTALL) -dm 0755 $(TARGET_DIR)/var/share/mender/inventory/
+	$(INSTALL) -D -m 0644 package/mender/mender.conf \
+		$(TARGET_DIR)/etc/mender/mender.conf
+	$(INSTALL) -D -m 0644 package/mender/tenant.conf \
+		$(TARGET_DIR)/etc/mender/mender.conf
+	$(INSTALL) -D -m 0644 package/mender/server.crt \
+		$(TARGET_DIR)/etc/mender/server.crt
+	$(INSTALL) -D -m 0755 package/mender/mender-device-identity \
+		$(TARGET_DIR)/var/share/mender/identity/mender-device-identity
+	$(INSTALL) -D -m 0755 package/mender/mender-inventory-network \
+		$(TARGET_DIR)/var/share/mender/inventory/mender-inventory-network
+	$(INSTALL) -D -m 0755 package/mender/mender-inventory-hostinfo \
+		$(TARGET_DIR)/var/share/mender/inventory/mender-inventory-hostinfo
+	$(INSTALL) -D -m 0644 package/mender/mender.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/mender.service
+endef
+
+$(eval $(golang-package))
diff --git a/package/mender/mender.service b/package/mender/mender.service
new file mode 100644
index 0000000..ec77fbc
--- /dev/null
+++ b/package/mender/mender.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Mender OTA update service
+After=systemd-resolved.service
+
+[Service]
+Type=idle
+User=root
+Group=root
+ExecStartPre=/bin/mkdir -p -m 0700 /data/mender
+ExecStartPre=/bin/ln -sf /etc/mender/tenant.conf /var/lib/mender/authtentoken
+ExecStart=/usr/bin/mender -daemon
+Restart=on-abort
+
+[Install]
+WantedBy=multi-user.target
diff --git a/package/mender/server.crt b/package/mender/server.crt
new file mode 100644
index 0000000..79a57e1
--- /dev/null
+++ b/package/mender/server.crt
@@ -0,0 +1,22 @@
+-----BEGIN CERTIFICATE-----
+MIIBfTCCASOgAwIBAgIJAJOS76a0qWuZMAoGCCqGSM49BAMCMBsxGTAXBgNVBAMM
+EGRvY2tlci5tZW5kZXIuaW8wHhcNMTYxMjE0MTk1MjQ2WhcNMjYxMjEyMTk1MjQ2
+WjAbMRkwFwYDVQQDDBBkb2NrZXIubWVuZGVyLmlvMFkwEwYHKoZIzj0CAQYIKoZI
+zj0DAQcDQgAE7AVYis6MWGPGQYU1/tlLEnskRifDIhvkRb8Y4nQPekRkLkiBYYT3
+iJ46wHrnejbHaLstU9GRdKWOmOuU6HGdO6NQME4wHQYDVR0OBBYEFGOIU4q++Vz8
+9HuT1jg9V+wFeJcyMB8GA1UdIwQYMBaAFGOIU4q++Vz89HuT1jg9V+wFeJcyMAwG
+A1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSAAwRQIhAPLnEeWPNeN7eDCEYRitBfyO
+X1yf2kzOm4ohBE5GY9gzAiBCq7HOSkzQDkelmQCCCpGXf/UwYNgQJjSoeGfk0j1a
+TQ==
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+MIIBhDCCASmgAwIBAgIJALQrf4QDot4IMAoGCCqGSM49BAMCMB4xHDAaBgNVBAMM
+E3MzLmRvY2tlci5tZW5kZXIuaW8wHhcNMTYxMjE0MTk1MjQ2WhcNMjYxMjEyMTk1
+MjQ2WjAeMRwwGgYDVQQDDBNzMy5kb2NrZXIubWVuZGVyLmlvMFkwEwYHKoZIzj0C
+AQYIKoZIzj0DAQcDQgAEEc/Y3T+l3DvINePkpvVZORMIdHVs29jgsl48ia7z/NRX
+HlKtKxVGJyFN5Y7sBZeLgBYH3F4Bo3KfmxI7ad0tI6NQME4wHQYDVR0OBBYEFIUm
+cip00QZYpe4ULflbGNJan+Y9MB8GA1UdIwQYMBaAFIUmcip00QZYpe4ULflbGNJa
+n+Y9MAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhANHij9VZBDHOUPaC
+pFiagnWnYL2HBR72W1xTKQbrLLTXAiEAvpwA4HzSnGmLd3010+jqQuMRHArN5WaX
+h0fy7niBbIQ=
+-----END CERTIFICATE-----
diff --git a/package/mender/tenant.conf b/package/mender/tenant.conf
new file mode 100644
index 0000000..e69de29
-- 
2.7.4

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

* [Buildroot] [PATCH v2] package/mender: new package
  2018-05-03 21:52 [Buildroot] [PATCH v2] package/mender: new package Angelo Compagnucci
@ 2018-05-04  7:23 ` Thomas Petazzoni
  2018-05-04  9:09   ` Angelo Compagnucci
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2018-05-04  7:23 UTC (permalink / raw)
  To: buildroot

Hello Angelo,

Thanks for pushing this further. We definitely want to have Mender.io
support in Buildroot, so it's great to see this make progress.

On Thu,  3 May 2018 23:52:38 +0200, Angelo Compagnucci wrote:

>  package/mender/server.crt                | 22 ++++++++++++++

Not a complete review by far, but I'm wondering if it makes sense to
include server certificates in Buildroot. I would assume that one would
want to generate his own certificate instead, no ?

> diff --git a/package/mender/Config.in b/package/mender/Config.in
> new file mode 100644
> index 0000000..b80ad4a
> --- /dev/null
> +++ b/package/mender/Config.in
> @@ -0,0 +1,14 @@
> +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_TOOLCHAIN_HAS_THREADS
> +	depends on BR2_INIT_SYSTEMD

Is there anything that makes mender tied to systemd, other than the
fact that you provide only a systemd mender.service, and no init
script ?

> +

Unneeded empty new line.


> +define MENDER_INSTALL_TARGET_CMDS
> +	$(INSTALL) -dm 0755 $(TARGET_DIR)/etc/mender/
> +	$(INSTALL) -dm 0755 $(TARGET_DIR)/var/share/mender/identity/
> +	$(INSTALL) -dm 0755 $(TARGET_DIR)/var/share/mender/inventory/

These commands are not needed: the $(INSTALL) -D below, with full
destination paths, will create the intermediate directories if they
don't already exist.

> +	$(INSTALL) -D -m 0644 package/mender/mender.conf \
> +		$(TARGET_DIR)/etc/mender/mender.conf
> +	$(INSTALL) -D -m 0644 package/mender/tenant.conf \
> +		$(TARGET_DIR)/etc/mender/mender.conf

Are you sure that installing tenant.conf as mender.conf is what you
want to do here ?

> +	$(INSTALL) -D -m 0644 package/mender/server.crt \
> +		$(TARGET_DIR)/etc/mender/server.crt
> +	$(INSTALL) -D -m 0755 package/mender/mender-device-identity \
> +		$(TARGET_DIR)/var/share/mender/identity/mender-device-identity
> +	$(INSTALL) -D -m 0755 package/mender/mender-inventory-network \
> +		$(TARGET_DIR)/var/share/mender/inventory/mender-inventory-network
> +	$(INSTALL) -D -m 0755 package/mender/mender-inventory-hostinfo \
> +		$(TARGET_DIR)/var/share/mender/inventory/mender-inventory-hostinfo
> +	$(INSTALL) -D -m 0644 package/mender/mender.service \
> +		$(TARGET_DIR)/usr/lib/systemd/system/mender.service

Is this enough to enable the systemd service ? In most packages, we do
a dance like this:

define OLSR_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 644 package/olsr/olsr.service \
                $(TARGET_DIR)/usr/lib/systemd/system/olsr.service
        mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
        ln -sf ../../../../usr/lib/systemd/system/olsr.service \
                $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/olsr.service
endef

Best regards,

Thomas Petazzoni
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v2] package/mender: new package
  2018-05-04  7:23 ` Thomas Petazzoni
@ 2018-05-04  9:09   ` Angelo Compagnucci
  2018-05-04  9:16     ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Angelo Compagnucci @ 2018-05-04  9:09 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

On Fri, May 4, 2018 at 9:23 AM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello Angelo,
>
> Thanks for pushing this further. We definitely want to have Mender.io
> support in Buildroot, so it's great to see this make progress.
>
> On Thu,  3 May 2018 23:52:38 +0200, Angelo Compagnucci wrote:
>
>>  package/mender/server.crt                | 22 ++++++++++++++
>
> Not a complete review by far, but I'm wondering if it makes sense to
> include server certificates in Buildroot. I would assume that one would
> want to generate his own certificate instead, no ?

It's a test certificate just to starting up. The same file is included
in the official yocto package so I thought it could useful to have
here.

>
>> diff --git a/package/mender/Config.in b/package/mender/Config.in
>> new file mode 100644
>> index 0000000..b80ad4a
>> --- /dev/null
>> +++ b/package/mender/Config.in
>> @@ -0,0 +1,14 @@
>> +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_TOOLCHAIN_HAS_THREADS
>> +     depends on BR2_INIT_SYSTEMD
>
> Is there anything that makes mender tied to systemd, other than the
> fact that you provide only a systemd mender.service, and no init
> script ?

Mender depends on systemd stating to the requirements here
https://docs.mender.io/1.4/devices/system-requirements

>
>> +
>
> Unneeded empty new line.
>
>
>> +define MENDER_INSTALL_TARGET_CMDS
>> +     $(INSTALL) -dm 0755 $(TARGET_DIR)/etc/mender/
>> +     $(INSTALL) -dm 0755 $(TARGET_DIR)/var/share/mender/identity/
>> +     $(INSTALL) -dm 0755 $(TARGET_DIR)/var/share/mender/inventory/
>
> These commands are not needed: the $(INSTALL) -D below, with full
> destination paths, will create the intermediate directories if they
> don't already exist.
>
>> +     $(INSTALL) -D -m 0644 package/mender/mender.conf \
>> +             $(TARGET_DIR)/etc/mender/mender.conf
>> +     $(INSTALL) -D -m 0644 package/mender/tenant.conf \
>> +             $(TARGET_DIR)/etc/mender/mender.conf
>
> Are you sure that installing tenant.conf as mender.conf is what you
> want to do here ?

Ouch.

>
>> +     $(INSTALL) -D -m 0644 package/mender/server.crt \
>> +             $(TARGET_DIR)/etc/mender/server.crt
>> +     $(INSTALL) -D -m 0755 package/mender/mender-device-identity \
>> +             $(TARGET_DIR)/var/share/mender/identity/mender-device-identity
>> +     $(INSTALL) -D -m 0755 package/mender/mender-inventory-network \
>> +             $(TARGET_DIR)/var/share/mender/inventory/mender-inventory-network
>> +     $(INSTALL) -D -m 0755 package/mender/mender-inventory-hostinfo \
>> +             $(TARGET_DIR)/var/share/mender/inventory/mender-inventory-hostinfo
>> +     $(INSTALL) -D -m 0644 package/mender/mender.service \
>> +             $(TARGET_DIR)/usr/lib/systemd/system/mender.service
>
> Is this enough to enable the systemd service ? In most packages, we do
> a dance like this:
>
> define OLSR_INSTALL_INIT_SYSTEMD
>         $(INSTALL) -D -m 644 package/olsr/olsr.service \
>                 $(TARGET_DIR)/usr/lib/systemd/system/olsr.service
>         mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
>         ln -sf ../../../../usr/lib/systemd/system/olsr.service \
>                 $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/olsr.service
> endef
>
> Best regards,
>
> Thomas Petazzoni
> --
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com

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

* [Buildroot] [PATCH v2] package/mender: new package
  2018-05-04  9:09   ` Angelo Compagnucci
@ 2018-05-04  9:16     ` Thomas Petazzoni
  2018-05-04  9:20       ` Angelo Compagnucci
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2018-05-04  9:16 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 4 May 2018 11:09:52 +0200, Angelo Compagnucci wrote:

> > Not a complete review by far, but I'm wondering if it makes sense to
> > include server certificates in Buildroot. I would assume that one would
> > want to generate his own certificate instead, no ?  
> 
> It's a test certificate just to starting up. The same file is included
> in the official yocto package so I thought it could useful to have
> here.

Ah, OK. Then perhaps it is fine to have this test certificate as well.

> > Is there anything that makes mender tied to systemd, other than the
> > fact that you provide only a systemd mender.service, and no init
> > script ?  
> 
> Mender depends on systemd stating to the requirements here
> https://docs.mender.io/1.4/devices/system-requirements

I'm wondering whether this is a real dependency (i.e they are linked
with systemd libraries), or whether it is just that they have only
tested their integration with systemd.

But OK, if they advertise this as a dependency, it's reasonable to have
that as well in Buildroot. It can be relaxed later on if someone is
interested in using Mender in a non-systemd system.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

* [Buildroot] [PATCH v2] package/mender: new package
  2018-05-04  9:16     ` Thomas Petazzoni
@ 2018-05-04  9:20       ` Angelo Compagnucci
  0 siblings, 0 replies; 7+ messages in thread
From: Angelo Compagnucci @ 2018-05-04  9:20 UTC (permalink / raw)
  To: buildroot

Dear Thomas,

On Fri, May 4, 2018 at 11:16 AM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Fri, 4 May 2018 11:09:52 +0200, Angelo Compagnucci wrote:
>
>> > Not a complete review by far, but I'm wondering if it makes sense to
>> > include server certificates in Buildroot. I would assume that one would
>> > want to generate his own certificate instead, no ?
>>
>> It's a test certificate just to starting up. The same file is included
>> in the official yocto package so I thought it could useful to have
>> here.
>
> Ah, OK. Then perhaps it is fine to have this test certificate as well.
>
>> > Is there anything that makes mender tied to systemd, other than the
>> > fact that you provide only a systemd mender.service, and no init
>> > script ?
>>
>> Mender depends on systemd stating to the requirements here
>> https://docs.mender.io/1.4/devices/system-requirements
>
> I'm wondering whether this is a real dependency (i.e they are linked
> with systemd libraries), or whether it is just that they have only
> tested their integration with systemd.
>
> But OK, if they advertise this as a dependency, it's reasonable to have
> that as well in Buildroot. It can be relaxed later on if someone is
> interested in using Mender in a non-systemd system.

Systemd is used to automate the workflow of
download/install/reboot/verify operations of the mender daemon.
This part can be disabled at compile time if a user is planning to use
mender manually and don't want to relay on the mender daemon.
I think this is fairly a not so common use case to justify the package changes.

BTW, I will look into this if there is the requirement.

>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com

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

* [Buildroot] [PATCH v2] package/mender: new package
@ 2018-06-04 21:37 Dan Walkes
  2018-06-05  7:33 ` Thomas Petazzoni
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Walkes @ 2018-06-04 21:37 UTC (permalink / raw)
  To: buildroot

Angelo,
Thanks for providing this patch.  I'm also interested in buildroot
support for mender.

>> I'm wondering whether this is a real dependency (i.e they are linked
>> with systemd libraries), or whether it is just that they have only
>> tested their integration with systemd.

> BTW, I will look into this if there is the requirement.

I expect it's just that they only test integration with systemd and
systemd is not a requirement.  See the comment at [1] from Mirza Krak
on the Mender dev team.

> Mender does not have a hard-requirement on systemd (BR2_INIT_SYSTEMD),  there is only a conveniently provided systemd service by default.

I've started with the patch at [2], then made a few small changes to
get the package running on an x86 qemu virtual machine with default
sysv init scripts.  See the project at [3] and branch at [4] for
details.

For some reason I don't understand, I needed to add a step to
specifically install the binary after the golang build, it wasn't
happening by default for me.  See the patch at [5].

I've noticed the current mender patches do not have support for
mender-artifact today.  In order to build the mender artifact utility
I think I'd need to build a host golang package based on mender
artifact [6] but it looks like only target packages are currently
supported today with pkg-golang buildroot [7], is that correct?  How
should I build the mender-artifact utility for the host?  What would
be the correct way to invoke the mender-artifact utility to actually
generate the artifact?  Would this be done through a custom post-image
script?

Has work already started on mender-artifact support in another patch
or on a branch somewhere?

Thanks!
Dan

[1] https://groups.google.com/a/lists.mender.io/d/msg/mender/9xQbUpDot5Q/_Ir6FpxAAAAJ
[2] https://patchwork.ozlabs.org/patch/908627/
[3] https://github.com/Trellis-Logic/buildroot-external/tree/add-mender-wip
[4] https://github.com/Trellis-Logic/buildroot/tree/add-mender-wip
[5] https://github.com/Trellis-Logic/buildroot/commit/1be4c0c6a09526de6cfa164476bf42b0dd40617d
[6] https://github.com/mendersoftware/mender-artifact
[7] https://github.com/buildroot/buildroot/blob/c4c85c12eb7f39d2faf54f080de973f7d69224f0/docs/manual/adding-packages-golang.txt#L53

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

* [Buildroot] [PATCH v2] package/mender: new package
  2018-06-04 21:37 Dan Walkes
@ 2018-06-05  7:33 ` Thomas Petazzoni
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2018-06-05  7:33 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 4 Jun 2018 15:37:52 -0600, Dan Walkes wrote:

> Thanks for providing this patch.  I'm also interested in buildroot
> support for mender.

Great! Thanks for your comments and feedback on the Mender integration,
definitely useful.

> I expect it's just that they only test integration with systemd and
> systemd is not a requirement.  See the comment at [1] from Mirza Krak
> on the Mender dev team.
> 
> > Mender does not have a hard-requirement on systemd (BR2_INIT_SYSTEMD),  there is only a conveniently provided systemd service by default.  
> 
> I've started with the patch at [2], then made a few small changes to
> get the package running on an x86 qemu virtual machine with default
> sysv init scripts.  See the project at [3] and branch at [4] for
> details.

Great. Perhaps I could merge Angelo's patch, and you could send
follow-up patch improving it, such as providing non-systemd
integration ?

> For some reason I don't understand, I needed to add a step to
> specifically install the binary after the golang build, it wasn't
> happening by default for me.  See the patch at [5].
> 
> I've noticed the current mender patches do not have support for
> mender-artifact today.  In order to build the mender artifact utility
> I think I'd need to build a host golang package based on mender
> artifact [6] but it looks like only target packages are currently
> supported today with pkg-golang buildroot [7], is that correct?  How
> should I build the mender-artifact utility for the host?

The pkg-golang infrastructure should probably be extended to build host
packages as well. So far it wasn't needed, but if it's needed, then
let's do it.

>  What would
> be the correct way to invoke the mender-artifact utility to actually
> generate the artifact?  Would this be done through a custom post-image
> script?

Yes, that's generally the idea for tools that generate some kind of
firmware image.

> Has work already started on mender-artifact support in another patch
> or on a branch somewhere?

Everything submitted to the Buildroot mailing list is recorded in our
patch tracking system
(https://patchwork.ozlabs.org/project/buildroot/list/). And no, there's
no work on mender-artifact support that has been submitted, at least
not that I remember.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-06-05  7:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-03 21:52 [Buildroot] [PATCH v2] package/mender: new package Angelo Compagnucci
2018-05-04  7:23 ` Thomas Petazzoni
2018-05-04  9:09   ` Angelo Compagnucci
2018-05-04  9:16     ` Thomas Petazzoni
2018-05-04  9:20       ` Angelo Compagnucci
  -- strict thread matches above, loose matches on Subject: below --
2018-06-04 21:37 Dan Walkes
2018-06-05  7:33 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox