* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-14 23:32 ` Arnout Vandecappelle
2018-08-14 23:13 ` [Buildroot] [PATCH 2/8] package/mender: update install of config files Mirza Krak
` (6 subsequent siblings)
7 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
And also added license checksums in mender.hash
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/mender.hash | 4 ++++
package/mender/mender.mk | 2 ++
2 files changed, 6 insertions(+)
diff --git a/package/mender/mender.hash b/package/mender/mender.hash
index 30a04fad7a..6a8bb5795b 100644
--- a/package/mender/mender.hash
+++ b/package/mender/mender.hash
@@ -1,2 +1,6 @@
# Locally computed:
sha256 267fa73ad472b034248ee298593b5c52ea0b105fd73c91febb3587280c61bee2 mender-1.4.0.tar.gz
+
+# License, locally computed
+sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 LICENSE
+sha256 54d6f54a2815cc2e3cef4f7dde5a3aae20f09b2cde394d8d3f1dce5d8a79d738 LIC_FILES_CHKSUM.sha256
diff --git a/package/mender/mender.mk b/package/mender/mender.mk
index 695b5e7a91..0dad93be28 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -6,6 +6,8 @@
MENDER_VERSION = 1.4.0
MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION))
+MENDER_LICENSE = Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT & OLDAP-2.8
+MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
define MENDER_INSTALL_CONFIG_FILES
$(INSTALL) -D -m 0644 package/mender/mender.conf \
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-14 23:13 ` [Buildroot] [PATCH 1/8] package/mender: update legal info Mirza Krak
@ 2018-08-14 23:32 ` Arnout Vandecappelle
2018-08-15 7:37 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Arnout Vandecappelle @ 2018-08-14 23:32 UTC (permalink / raw)
To: buildroot
Hi Mirza,
On 15-08-18 01:13, Mirza Krak wrote:
> And also added license checksums in mender.hash
>
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
> ---
> package/mender/mender.hash | 4 ++++
> package/mender/mender.mk | 2 ++
> 2 files changed, 6 insertions(+)
>
> diff --git a/package/mender/mender.hash b/package/mender/mender.hash
> index 30a04fad7a..6a8bb5795b 100644
> --- a/package/mender/mender.hash
> +++ b/package/mender/mender.hash
> @@ -1,2 +1,6 @@
> # Locally computed:
> sha256 267fa73ad472b034248ee298593b5c52ea0b105fd73c91febb3587280c61bee2 mender-1.4.0.tar.gz
> +
> +# License, locally computed
> +sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 LICENSE
> +sha256 54d6f54a2815cc2e3cef4f7dde5a3aae20f09b2cde394d8d3f1dce5d8a79d738 LIC_FILES_CHKSUM.sha256> diff --git a/package/mender/mender.mk b/package/mender/mender.mk
> index 695b5e7a91..0dad93be28 100644
> --- a/package/mender/mender.mk
> +++ b/package/mender/mender.mk
> @@ -6,6 +6,8 @@
>
> MENDER_VERSION = 1.4.0
> MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION))
> +MENDER_LICENSE = Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT & OLDAP-2.8
Although & is probably the proper delimiter to use for AND in SPDX format, we
currently use ", " everywhere, so please stick to that.
> +MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
Instead of LIC_FILES_CHKSUM.sha256, we should actually include all the files
mentioned in there in our license list. Well, actually, we can optimize it a
little bit because there are some identical files.
Alternatively, you could include all of them, and for the .hash file you can
just prepend 'sha256 ' to every line of LIC_FILES_CHKSUM.sha256 and append it
to the .hash file, with the comment
# From LIC_FILES_CHKSUM.sha256
On second thought, actually it is a good idea to include
LIC_FILES_CHKSUM.sha256 as well, to detect when a new subpackage with a new
license is added.
Regards,
Arnout
>
> define MENDER_INSTALL_CONFIG_FILES
> $(INSTALL) -D -m 0644 package/mender/mender.conf \
>
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-14 23:32 ` Arnout Vandecappelle
@ 2018-08-15 7:37 ` Mirza Krak
2018-08-16 15:36 ` Arnout Vandecappelle
0 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 7:37 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 1:32 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
> Hi Mirza,
Hi Arnout,
>
> On 15-08-18 01:13, Mirza Krak wrote:
>> And also added license checksums in mender.hash
>>
>> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
>> ---
>> package/mender/mender.hash | 4 ++++
>> package/mender/mender.mk | 2 ++
>> 2 files changed, 6 insertions(+)
>>
>> diff --git a/package/mender/mender.hash b/package/mender/mender.hash
>> index 30a04fad7a..6a8bb5795b 100644
>> --- a/package/mender/mender.hash
>> +++ b/package/mender/mender.hash
>> @@ -1,2 +1,6 @@
>> # Locally computed:
>> sha256 267fa73ad472b034248ee298593b5c52ea0b105fd73c91febb3587280c61bee2 mender-1.4.0.tar.gz
>> +
>> +# License, locally computed
>> +sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 LICENSE
>> +sha256 54d6f54a2815cc2e3cef4f7dde5a3aae20f09b2cde394d8d3f1dce5d8a79d738 LIC_FILES_CHKSUM.sha256> diff --git a/package/mender/mender.mk b/package/mender/mender.mk
>> index 695b5e7a91..0dad93be28 100644
>> --- a/package/mender/mender.mk
>> +++ b/package/mender/mender.mk
>> @@ -6,6 +6,8 @@
>>
>> MENDER_VERSION = 1.4.0
>> MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION))
>> +MENDER_LICENSE = Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT & OLDAP-2.8
>
> Although & is probably the proper delimiter to use for AND in SPDX format, we
> currently use ", " everywhere, so please stick to that.
Got it, thanks.
>> +MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
>
> Instead of LIC_FILES_CHKSUM.sha256, we should actually include all the files
> mentioned in there in our license list. Well, actually, we can optimize it a
> little bit because there are some identical files.
>
> Alternatively, you could include all of them, and for the .hash file you can
> just prepend 'sha256 ' to every line of LIC_FILES_CHKSUM.sha256 and append it
> to the .hash file, with the comment
>
> # From LIC_FILES_CHKSUM.sha256
>
>
> On second thought, actually it is a good idea to include
> LIC_FILES_CHKSUM.sha256 as well, to detect when a new subpackage with a new
> license is added.
I would really like to keep this as-is to avoid a heavy maintenance
burden. This file is maintained in the upstream package and would
rather not duplicate the work by extracting the information from
LIC_FILES_CHKSUM.sha256 to put it in mender.hash.
The checksum check of LIC_FILES_CHKSUM.sha256 will handle the sanity
check of the LICENSE files, and all the licenses that are in
LIC_FILES_CHKSUM.sha256 are already mentioned in the mender.mk file:
MENDER_LICENSE = Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, OLDAP-2.8
This should cover it. Or are there any big drawbacks with this
approach that I am not seeing?
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-15 7:37 ` Mirza Krak
@ 2018-08-16 15:36 ` Arnout Vandecappelle
2018-08-16 19:59 ` Mirza Krak
2018-08-16 20:18 ` Mirza Krak
0 siblings, 2 replies; 40+ messages in thread
From: Arnout Vandecappelle @ 2018-08-16 15:36 UTC (permalink / raw)
To: buildroot
On 15/08/2018 09:37, Mirza Krak wrote:
> On Wed, Aug 15, 2018 at 1:32 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> Hi Mirza,
>
> Hi Arnout,
>
>>
>> On 15-08-18 01:13, Mirza Krak wrote:
[snip]
>>> +MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
>>
>> Instead of LIC_FILES_CHKSUM.sha256, we should actually include all the files
>> mentioned in there in our license list. Well, actually, we can optimize it a
>> little bit because there are some identical files.
>>
>> Alternatively, you could include all of them, and for the .hash file you can
>> just prepend 'sha256 ' to every line of LIC_FILES_CHKSUM.sha256 and append it
>> to the .hash file, with the comment
>>
>> # From LIC_FILES_CHKSUM.sha256
>>
>>
>> On second thought, actually it is a good idea to include
>> LIC_FILES_CHKSUM.sha256 as well, to detect when a new subpackage with a new
>> license is added.
>
> I would really like to keep this as-is to avoid a heavy maintenance
> burden. This file is maintained in the upstream package and would
> rather not duplicate the work by extracting the information from
> LIC_FILES_CHKSUM.sha256 to put it in mender.hash.
>
> The checksum check of LIC_FILES_CHKSUM.sha256 will handle the sanity
> check of the LICENSE files, and all the licenses that are in
> LIC_FILES_CHKSUM.sha256 are already mentioned in the mender.mk file:
>
> MENDER_LICENSE = Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, OLDAP-2.8
>
> This should cover it. Or are there any big drawbacks with this
> approach that I am not seeing?
Well, we really want to collect the license text for all applicable licenses.
So you should include at least one file for each license mentioned in
MENDER_LICENSE. Since the checksums are already available, I thought the easiest
would be to create part of the hash file from the existing file. Like:
# Generated with sed '/^[A-Za-z0-9_]/s/^/sha256 /' LIC_FILES_CHKSUM.sha256
# Apache-2.0 license.
sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 LICENSE
...
Regards,
Arnout
--
Arnout Vandecappelle arnout at mind be
Senior Embedded Software Architect +32-16-286500
Essensium/Mind http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-16 15:36 ` Arnout Vandecappelle
@ 2018-08-16 19:59 ` Mirza Krak
2018-08-16 20:18 ` Mirza Krak
1 sibling, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-16 19:59 UTC (permalink / raw)
To: buildroot
On Thu, Aug 16, 2018 at 5:36 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
> On 15/08/2018 09:37, Mirza Krak wrote:
>> On Wed, Aug 15, 2018 at 1:32 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>>> Hi Mirza,
>>
>> Hi Arnout,
>>
>>>
>>> On 15-08-18 01:13, Mirza Krak wrote:
>
> [snip]
>>>> +MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
>>>
>>> Instead of LIC_FILES_CHKSUM.sha256, we should actually include all the files
>>> mentioned in there in our license list. Well, actually, we can optimize it a
>>> little bit because there are some identical files.
>>>
>>> Alternatively, you could include all of them, and for the .hash file you can
>>> just prepend 'sha256 ' to every line of LIC_FILES_CHKSUM.sha256 and append it
>>> to the .hash file, with the comment
>>>
>>> # From LIC_FILES_CHKSUM.sha256
>>>
>>>
>>> On second thought, actually it is a good idea to include
>>> LIC_FILES_CHKSUM.sha256 as well, to detect when a new subpackage with a new
>>> license is added.
>>
>> I would really like to keep this as-is to avoid a heavy maintenance
>> burden. This file is maintained in the upstream package and would
>> rather not duplicate the work by extracting the information from
>> LIC_FILES_CHKSUM.sha256 to put it in mender.hash.
>>
>> The checksum check of LIC_FILES_CHKSUM.sha256 will handle the sanity
>> check of the LICENSE files, and all the licenses that are in
>> LIC_FILES_CHKSUM.sha256 are already mentioned in the mender.mk file:
>>
>> MENDER_LICENSE = Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, OLDAP-2.8
>>
>> This should cover it. Or are there any big drawbacks with this
>> approach that I am not seeing?
>
> Well, we really want to collect the license text for all applicable licenses.
> So you should include at least one file for each license mentioned in
> MENDER_LICENSE. Since the checksums are already available, I thought the easiest
> would be to create part of the hash file from the existing file. Like:
>
> # Generated with sed '/^[A-Za-z0-9_]/s/^/sha256 /' LIC_FILES_CHKSUM.sha256
> # Apache-2.0 license.
> sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 LICENSE
Got it, and thanks for providing the "sed magic" :).
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-16 15:36 ` Arnout Vandecappelle
2018-08-16 19:59 ` Mirza Krak
@ 2018-08-16 20:18 ` Mirza Krak
2018-08-17 3:48 ` Baruch Siach
1 sibling, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-16 20:18 UTC (permalink / raw)
To: buildroot
On Thu, Aug 16, 2018 at 5:36 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>
>
> On 15/08/2018 09:37, Mirza Krak wrote:
>> On Wed, Aug 15, 2018 at 1:32 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>>> Hi Mirza,
>>
>> Hi Arnout,
>>
>>>
>>> On 15-08-18 01:13, Mirza Krak wrote:
>
> [snip]
>>>> +MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
>>>
>>> Instead of LIC_FILES_CHKSUM.sha256, we should actually include all the files
>>> mentioned in there in our license list. Well, actually, we can optimize it a
>>> little bit because there are some identical files.
>>>
>>> Alternatively, you could include all of them, and for the .hash file you can
>>> just prepend 'sha256 ' to every line of LIC_FILES_CHKSUM.sha256 and append it
>>> to the .hash file, with the comment
>>>
>>> # From LIC_FILES_CHKSUM.sha256
>>>
>>>
>>> On second thought, actually it is a good idea to include
>>> LIC_FILES_CHKSUM.sha256 as well, to detect when a new subpackage with a new
>>> license is added.
>>
>> I would really like to keep this as-is to avoid a heavy maintenance
>> burden. This file is maintained in the upstream package and would
>> rather not duplicate the work by extracting the information from
>> LIC_FILES_CHKSUM.sha256 to put it in mender.hash.
>>
>> The checksum check of LIC_FILES_CHKSUM.sha256 will handle the sanity
>> check of the LICENSE files, and all the licenses that are in
>> LIC_FILES_CHKSUM.sha256 are already mentioned in the mender.mk file:
>>
>> MENDER_LICENSE = Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, OLDAP-2.8
>>
>> This should cover it. Or are there any big drawbacks with this
>> approach that I am not seeing?
>
> Well, we really want to collect the license text for all applicable licenses.
> So you should include at least one file for each license mentioned in
> MENDER_LICENSE. Since the checksums are already available, I thought the easiest
> would be to create part of the hash file from the existing file. Like:
>
> # Generated with sed '/^[A-Za-z0-9_]/s/^/sha256 /' LIC_FILES_CHKSUM.sha256
> # Apache-2.0 license.
> sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 LICENSE
Hmm, though I having some issues with trying to accommodate this.
Adding the following line to mender.hash:
# BSD 2 Clause license.
sha256 8d427fd87bc9579ea368fde3d49f9ca22eac857f91a9dec7e3004bdfab7dee86
vendor/github.com/pkg/errors/LICENSE
Does not do anything, when I run:
$ make mender-legal-info
>>> mender 1.4.0 Collecting legal info
LICENSE: OK (sha256:
ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680)
LIC_FILES_CHKSUM.sha256: OK (sha256:
54d6f54a2815cc2e3cef4f7dde5a3aae20f09b2cde394d8d3f1dce5d8a79d738)
Inspecting other *.hash files in Buildroot, no one seems to reference
files that are outside of the "root source". Or should I specify the
path differently?
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-16 20:18 ` Mirza Krak
@ 2018-08-17 3:48 ` Baruch Siach
2018-08-17 6:53 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Baruch Siach @ 2018-08-17 3:48 UTC (permalink / raw)
To: buildroot
Hi Mirza,
Mirza Krak writes:
> On Thu, Aug 16, 2018 at 5:36 PM, Arnout Vandecappelle <arnout@mind.be> wrote:
>> On 15/08/2018 09:37, Mirza Krak wrote:
>>> On Wed, Aug 15, 2018 at 1:32 AM, Arnout Vandecappelle <arnout@mind.be> wrote:
>>>> On 15-08-18 01:13, Mirza Krak wrote:
>>
>> [snip]
>>>>> +MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
>>>>
>>>> Instead of LIC_FILES_CHKSUM.sha256, we should actually include all the files
>>>> mentioned in there in our license list. Well, actually, we can optimize it a
>>>> little bit because there are some identical files.
>>>>
>>>> Alternatively, you could include all of them, and for the .hash file you can
>>>> just prepend 'sha256 ' to every line of LIC_FILES_CHKSUM.sha256 and append it
>>>> to the .hash file, with the comment
>>>>
>>>> # From LIC_FILES_CHKSUM.sha256
>>>>
>>>>
>>>> On second thought, actually it is a good idea to include
>>>> LIC_FILES_CHKSUM.sha256 as well, to detect when a new subpackage with a new
>>>> license is added.
>>>
>>> I would really like to keep this as-is to avoid a heavy maintenance
>>> burden. This file is maintained in the upstream package and would
>>> rather not duplicate the work by extracting the information from
>>> LIC_FILES_CHKSUM.sha256 to put it in mender.hash.
>>>
>>> The checksum check of LIC_FILES_CHKSUM.sha256 will handle the sanity
>>> check of the LICENSE files, and all the licenses that are in
>>> LIC_FILES_CHKSUM.sha256 are already mentioned in the mender.mk file:
>>>
>>> MENDER_LICENSE = Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, OLDAP-2.8
>>>
>>> This should cover it. Or are there any big drawbacks with this
>>> approach that I am not seeing?
>>
>> Well, we really want to collect the license text for all applicable licenses.
>> So you should include at least one file for each license mentioned in
>> MENDER_LICENSE. Since the checksums are already available, I thought the easiest
>> would be to create part of the hash file from the existing file. Like:
>>
>> # Generated with sed '/^[A-Za-z0-9_]/s/^/sha256 /' LIC_FILES_CHKSUM.sha256
>> # Apache-2.0 license.
>> sha256 ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680 LICENSE
>
> Hmm, though I having some issues with trying to accommodate this.
>
> Adding the following line to mender.hash:
>
> # BSD 2 Clause license.
> sha256 8d427fd87bc9579ea368fde3d49f9ca22eac857f91a9dec7e3004bdfab7dee86
> vendor/github.com/pkg/errors/LICENSE
>
> Does not do anything, when I run:
>
> $ make mender-legal-info
> >>> mender 1.4.0 Collecting legal info
> LICENSE: OK (sha256:
> ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680)
> LIC_FILES_CHKSUM.sha256: OK (sha256:
> 54d6f54a2815cc2e3cef4f7dde5a3aae20f09b2cde394d8d3f1dce5d8a79d738)
>
> Inspecting other *.hash files in Buildroot, no one seems to reference
> files that are outside of the "root source". Or should I specify the
> path differently?
There are a number of packages with license files in subdirectories. For
example:
make alsa-lib-legal-info
...
>>> alsa-lib 1.1.6 Collecting legal info
COPYING: OK (sha256: 32434afcc8666ba060e111d715bfdb6c2d5dd8a35fa4d3ab8ad67d8f850d2f2b)
aserver/COPYING: OK (sha256: bfe16cf823bcff261fc6a062c07ee96660e3c39678f42f39a788a68dbc234ced)
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 1/8] package/mender: update legal info
2018-08-17 3:48 ` Baruch Siach
@ 2018-08-17 6:53 ` Mirza Krak
0 siblings, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-17 6:53 UTC (permalink / raw)
To: buildroot
On Fri, Aug 17, 2018 at 5:48 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Mirza,
>
< snip >
>>
>> Hmm, though I having some issues with trying to accommodate this.
>>
>> Adding the following line to mender.hash:
>>
>> # BSD 2 Clause license.
>> sha256 8d427fd87bc9579ea368fde3d49f9ca22eac857f91a9dec7e3004bdfab7dee86
>> vendor/github.com/pkg/errors/LICENSE
>>
>> Does not do anything, when I run:
>>
>> $ make mender-legal-info
>> >>> mender 1.4.0 Collecting legal info
>> LICENSE: OK (sha256:
>> ceb1b36ff073bd13d9806d4615b931707768ca9023805620acc32dd1cfc2f680)
>> LIC_FILES_CHKSUM.sha256: OK (sha256:
>> 54d6f54a2815cc2e3cef4f7dde5a3aae20f09b2cde394d8d3f1dce5d8a79d738)
>>
>> Inspecting other *.hash files in Buildroot, no one seems to reference
>> files that are outside of the "root source". Or should I specify the
>> path differently?
>
> There are a number of packages with license files in subdirectories. For
> example:
>
> make alsa-lib-legal-info
> ...
>>>> alsa-lib 1.1.6 Collecting legal info
> COPYING: OK (sha256: 32434afcc8666ba060e111d715bfdb6c2d5dd8a35fa4d3ab8ad67d8f850d2f2b)
> aserver/COPYING: OK (sha256: bfe16cf823bcff261fc6a062c07ee96660e3c39678f42f39a788a68dbc234ced)
Of course.
I missed adding the files to LICENSE_FILES. Doh!
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 2/8] package/mender: update install of config files
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
2018-08-14 23:13 ` [Buildroot] [PATCH 1/8] package/mender: update legal info Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-15 12:31 ` Thomas Petazzoni
2018-08-14 23:13 ` [Buildroot] [PATCH 3/8] package/mender: add dep on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV Mirza Krak
` (5 subsequent siblings)
7 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
Summary of changes:
- identity and inventory scripts are part of Mender source repo,
hence remove the local files and install from source directory.
- tenant.conf is not used by Mender, remove it
These are required to run Mender in managed mode (daemon).
- Create /data and /uboot directories.
- Symlink /var/lib/mender to /data
- Added /etc/mender/script/version file
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/mender-device-identity | 52 ------------------------
package/mender/mender-inventory-hostinfo | 21 ----------
package/mender/mender-inventory-network | 47 ---------------------
package/mender/mender.mk | 22 ++++++----
package/mender/mender.service | 1 -
package/mender/tenant.conf | 0
6 files changed, 14 insertions(+), 129 deletions(-)
delete mode 100644 package/mender/mender-device-identity
delete mode 100644 package/mender/mender-inventory-hostinfo
delete mode 100644 package/mender/mender-inventory-network
delete mode 100644 package/mender/tenant.conf
diff --git a/package/mender/mender-device-identity b/package/mender/mender-device-identity
deleted file mode 100644
index d87f843357..0000000000
--- a/package/mender/mender-device-identity
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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
deleted file mode 100644
index cf508fdf88..0000000000
--- a/package/mender/mender-inventory-hostinfo
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/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
deleted file mode 100644
index b017c4ea14..0000000000
--- a/package/mender/mender-inventory-network
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/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.mk b/package/mender/mender.mk
index 0dad93be28..b2df70256a 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -10,18 +10,24 @@ MENDER_LICENSE = Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT & OLDAP-2.8
MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
define MENDER_INSTALL_CONFIG_FILES
+ $(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
+ $(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
+ $(INSTALL) -d -m 755 $(TARGET_DIR)/uboot
+ $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/share/mender/inventory
+
+ $(INSTALL) -d -m 755 $(TARGET_DIR)/etc/mender/scripts
+ echo -n "2" > $(TARGET_DIR)/etc/mender/scripts/version
+
$(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/tenant.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 0755 $(@D)/support/mender-device-identity \
+ $(TARGET_DIR)/usr/share/mender/identity/mender-device-identity
+ $(INSTALL) -D -m 0755 $(@D)/support/mender-inventory-* \
+ $(TARGET_DIR)/usr/share/mender/inventory
+
+ ln -sf /data/mender $(TARGET_DIR)/var/lib/mender
endef
MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
diff --git a/package/mender/mender.service b/package/mender/mender.service
index ec77fbc46c..9ede55acb5 100644
--- a/package/mender/mender.service
+++ b/package/mender/mender.service
@@ -7,7 +7,6 @@ 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
diff --git a/package/mender/tenant.conf b/package/mender/tenant.conf
deleted file mode 100644
index e69de29bb2..0000000000
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 2/8] package/mender: update install of config files
2018-08-14 23:13 ` [Buildroot] [PATCH 2/8] package/mender: update install of config files Mirza Krak
@ 2018-08-15 12:31 ` Thomas Petazzoni
2018-08-15 12:42 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 12:31 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 01:13:31 +0200, Mirza Krak wrote:
> Summary of changes:
>
> - identity and inventory scripts are part of Mender source repo,
> hence remove the local files and install from source directory.
>
> - tenant.conf is not used by Mender, remove it
>
> These are required to run Mender in managed mode (daemon).
>
> - Create /data and /uboot directories.
> - Symlink /var/lib/mender to /data
> - Added /etc/mender/script/version file
>
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
There are too many changes in one commit here, please do these changes
one step at a time.
Do you know why tenant.conf was added in the current Mender packaging ?
Was it an old configuration file from previous Mender versions ?
> define MENDER_INSTALL_CONFIG_FILES
> + $(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
> + $(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
> + $(INSTALL) -d -m 755 $(TARGET_DIR)/uboot
> + $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/share/mender/inventory
Could you give a bit of background about these ?
> + $(INSTALL) -d -m 755 $(TARGET_DIR)/etc/mender/scripts
> + echo -n "2" > $(TARGET_DIR)/etc/mender/scripts/version
> +
> $(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/tenant.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 0755 $(@D)/support/mender-device-identity \
> + $(TARGET_DIR)/usr/share/mender/identity/mender-device-identity
The installation path has changed from /var/share, to /usr/share. Why ?
> + $(INSTALL) -D -m 0755 $(@D)/support/mender-inventory-* \
> + $(TARGET_DIR)/usr/share/mender/inventory
A $(INSTALL) -D invocation should have a full destination path, so:
$(foreach f,hostinfo network, \
$(INSTALL) -D -m 0755 $(@D)/support/mender-inventory-$(f) \
$(TARGET_DIR)/usr/share/mender/inventory/mender-inventory-$(f)
)
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 2/8] package/mender: update install of config files
2018-08-15 12:31 ` Thomas Petazzoni
@ 2018-08-15 12:42 ` Mirza Krak
2018-08-15 17:41 ` Thomas Petazzoni
0 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 12:42 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 2:31 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 01:13:31 +0200, Mirza Krak wrote:
>> Summary of changes:
>>
>> - identity and inventory scripts are part of Mender source repo,
>> hence remove the local files and install from source directory.
>>
>> - tenant.conf is not used by Mender, remove it
>>
>> These are required to run Mender in managed mode (daemon).
>>
>> - Create /data and /uboot directories.
>> - Symlink /var/lib/mender to /data
>> - Added /etc/mender/script/version file
>>
>> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
>
> There are too many changes in one commit here, please do these changes
> one step at a time.
Sure.
>
> Do you know why tenant.conf was added in the current Mender packaging ?
> Was it an old configuration file from previous Mender versions ?
This was something that we did deploy in our Yocto recipes (which
might have been source of inspiration for the package in Buildroot),
but it was never actually used for anything. There is an option in
mender.conf for this, TenantToken.
>> define MENDER_INSTALL_CONFIG_FILES
>> + $(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
>> + $(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
>> + $(INSTALL) -d -m 755 $(TARGET_DIR)/uboot
>> + $(INSTALL) -d -m 755 $(TARGET_DIR)/usr/share/mender/inventory
>
> Could you give a bit of background about these ?
Will do.
>
>> + $(INSTALL) -d -m 755 $(TARGET_DIR)/etc/mender/scripts
>> + echo -n "2" > $(TARGET_DIR)/etc/mender/scripts/version
>> +
>> $(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/tenant.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 0755 $(@D)/support/mender-device-identity \
>> + $(TARGET_DIR)/usr/share/mender/identity/mender-device-identity
>
> The installation path has changed from /var/share, to /usr/share. Why ?
/var/share was incorrect, it has always been /usr/share.
>
>> + $(INSTALL) -D -m 0755 $(@D)/support/mender-inventory-* \
>> + $(TARGET_DIR)/usr/share/mender/inventory
>
> A $(INSTALL) -D invocation should have a full destination path, so:
>
> $(foreach f,hostinfo network, \
> $(INSTALL) -D -m 0755 $(@D)/support/mender-inventory-$(f) \
> $(TARGET_DIR)/usr/share/mender/inventory/mender-inventory-$(f)
> )
>
> Thanks!
Ok, thanks.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 2/8] package/mender: update install of config files
2018-08-15 12:42 ` Mirza Krak
@ 2018-08-15 17:41 ` Thomas Petazzoni
2018-08-15 18:48 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 17:41 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 14:42:51 +0200, Mirza Krak wrote:
> > Do you know why tenant.conf was added in the current Mender packaging ?
> > Was it an old configuration file from previous Mender versions ?
>
> This was something that we did deploy in our Yocto recipes (which
> might have been source of inspiration for the package in Buildroot),
> but it was never actually used for anything. There is an option in
> mender.conf for this, TenantToken.
Which is set to ?
tenant.conf was the target of a symlink, created in the systemd unit
file:
/bin/ln -sf /etc/mender/tenant.conf /var/lib/mender/authtentoken
How does it work now ?
> > The installation path has changed from /var/share, to /usr/share. Why ?
>
> /var/share was incorrect, it has always been /usr/share.
So in its current state, the mender package in Buildroot doesn't work ?
I'm trying to figure out if this is a bug, or just a preference. If
it's a bug, we need to fix it in the master branch, and perhaps
backport it to our LTS release.
In your next iteration of the patches, could you please clearly
separate the bug fixes as separate patches. They should come first in
the series, before the improvements/cleanups.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 2/8] package/mender: update install of config files
2018-08-15 17:41 ` Thomas Petazzoni
@ 2018-08-15 18:48 ` Mirza Krak
2018-08-15 19:02 ` Thomas Petazzoni
0 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 18:48 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 7:41 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 14:42:51 +0200, Mirza Krak wrote:
>
>> > Do you know why tenant.conf was added in the current Mender packaging ?
>> > Was it an old configuration file from previous Mender versions ?
>>
>> This was something that we did deploy in our Yocto recipes (which
>> might have been source of inspiration for the package in Buildroot),
>> but it was never actually used for anything. There is an option in
>> mender.conf for this, TenantToken.
>
> Which is set to ?
>
> tenant.conf was the target of a symlink, created in the systemd unit
> file:
>
> /bin/ln -sf /etc/mender/tenant.conf /var/lib/mender/authtentoken
>
> How does it work now ?
Example:
/etc/mender/mender.conf
{
TenantToken: "very long base64 encoded string"
}
This is a configuration option that has to do with Hosted Mender,
where you you need to set this for the devices to connect to the
correct organization in a multi-tenant system.
I also looked up some details, the removal of tenant.conf usage (and
/var/lib/mender/authtentoken) was in version 1.2.0, where it was
switched to be an mender.conf option instead as the example above
demonstrates. As the first version that was integrated in Buildroot
was 1.4.0, the inclusion of tenant.conf and the creation of the
symlink was not necessary.
>> > The installation path has changed from /var/share, to /usr/share. Why ?
>>
>> /var/share was incorrect, it has always been /usr/share.
>
> So in its current state, the mender package in Buildroot doesn't work ?
We need to define works. If we define works as that the mender.service
is started successfully and the daemon is running, currently this does
not work. And the path change from /var/share -> /usr/share is one of
the fixes. The other one is a "sane" mender.conf file, currently there
are only "template" values in the file installed that are not replaced
with actually working values.
For Mender to actually be able to perform updates (works) it requires
integration with U-boot and a specific partition layout, as it is A &
B update solution. Will go in more detail on this in the other thread,
with similar questions.
> I'm trying to figure out if this is a bug, or just a preference. If
> it's a bug, we need to fix it in the master branch, and perhaps
> backport it to our LTS release.
>
> In your next iteration of the patches, could you please clearly
> separate the bug fixes as separate patches. They should come first in
> the series, before the improvements/cleanups.
Yes, I can do that.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 2/8] package/mender: update install of config files
2018-08-15 18:48 ` Mirza Krak
@ 2018-08-15 19:02 ` Thomas Petazzoni
0 siblings, 0 replies; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 19:02 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 20:48:27 +0200, Mirza Krak wrote:
> On Wed, Aug 15, 2018 at 7:41 PM, Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> > Hello,
> >
> > On Wed, 15 Aug 2018 14:42:51 +0200, Mirza Krak wrote:
> >
> >> > Do you know why tenant.conf was added in the current Mender packaging ?
> >> > Was it an old configuration file from previous Mender versions ?
> >>
> >> This was something that we did deploy in our Yocto recipes (which
> >> might have been source of inspiration for the package in Buildroot),
> >> but it was never actually used for anything. There is an option in
> >> mender.conf for this, TenantToken.
> >
> > Which is set to ?
> >
> > tenant.conf was the target of a symlink, created in the systemd unit
> > file:
> >
> > /bin/ln -sf /etc/mender/tenant.conf /var/lib/mender/authtentoken
> >
> > How does it work now ?
>
> Example:
>
> /etc/mender/mender.conf
> {
> TenantToken: "very long base64 encoded string"
> }
>
> This is a configuration option that has to do with Hosted Mender,
> where you you need to set this for the devices to connect to the
> correct organization in a multi-tenant system.
>
> I also looked up some details, the removal of tenant.conf usage (and
> /var/lib/mender/authtentoken) was in version 1.2.0, where it was
> switched to be an mender.conf option instead as the example above
> demonstrates. As the first version that was integrated in Buildroot
> was 1.4.0, the inclusion of tenant.conf and the creation of the
> symlink was not necessary.
OK, thanks a lot for this research. Please make this a separate patch
from the rest, with this very good explanation as the commit log.
> >> > The installation path has changed from /var/share, to /usr/share. Why ?
> >>
> >> /var/share was incorrect, it has always been /usr/share.
> >
> > So in its current state, the mender package in Buildroot doesn't work ?
>
> We need to define works. If we define works as that the mender.service
> is started successfully and the daemon is running, currently this does
> not work. And the path change from /var/share -> /usr/share is one of
> the fixes.
OK, so we want this as a separate patch as well, so that we can apply
it to master and backport to our LTS branch.
> The other one is a "sane" mender.conf file, currently there
> are only "template" values in the file installed that are not replaced
> with actually working values.
It is kind of expected that the mender.conf provided in Buildroot is a
template and needs to be replaced. I don't think it is really possible
to provide an out-of-the-box working solution for update systems. As
you explain below, it requires integration with the bootloader, a
specific organization of the partitions, etc.
> For Mender to actually be able to perform updates (works) it requires
> integration with U-boot and a specific partition layout, as it is A &
> B update solution. Will go in more detail on this in the other thread,
> with similar questions.
OK, thanks!
> > In your next iteration of the patches, could you please clearly
> > separate the bug fixes as separate patches. They should come first in
> > the series, before the improvements/cleanups.
>
> Yes, I can do that.
Thanks a lot!
I have to say I'm really pleased to have people with deep knowledge of
Mender taking care of its Buildroot packaging. This will definitely
help in making Mender more usable in the context of Buildroot.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 3/8] package/mender: add dep on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
2018-08-14 23:13 ` [Buildroot] [PATCH 1/8] package/mender: update legal info Mirza Krak
2018-08-14 23:13 ` [Buildroot] [PATCH 2/8] package/mender: update install of config files Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-15 5:08 ` Baruch Siach
2018-08-14 23:13 ` [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option Mirza Krak
` (4 subsequent siblings)
7 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
The Mender client uses fw_printenv/fw_setenv to manipulate the U-boot
environment, e.g to change the boot candidate after a update has been
done.
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/Config.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/package/mender/Config.in b/package/mender/Config.in
index e461857486..8c2838c64a 100644
--- a/package/mender/Config.in
+++ b/package/mender/Config.in
@@ -3,6 +3,8 @@ config BR2_PACKAGE_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_PACKAGE_UBOOT_TOOLS
+ depends on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
help
Mender is an open source over-the-air (OTA) software updater
for embedded Linux devices. Mender comprises a client
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 3/8] package/mender: add dep on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
2018-08-14 23:13 ` [Buildroot] [PATCH 3/8] package/mender: add dep on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV Mirza Krak
@ 2018-08-15 5:08 ` Baruch Siach
2018-08-15 7:21 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Baruch Siach @ 2018-08-15 5:08 UTC (permalink / raw)
To: buildroot
Hi Mirza,
Mirza Krak writes:
> The Mender client uses fw_printenv/fw_setenv to manipulate the U-boot
> environment, e.g to change the boot candidate after a update has been
> done.
>
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
> ---
> package/mender/Config.in | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/package/mender/Config.in b/package/mender/Config.in
> index e461857486..8c2838c64a 100644
> --- a/package/mender/Config.in
> +++ b/package/mender/Config.in
> @@ -3,6 +3,8 @@ config BR2_PACKAGE_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_PACKAGE_UBOOT_TOOLS
> + depends on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
For non-obvious dependencies like these we prefer 'select'. Also, since
this is a run-time only dependency, there should be a comment saying
that. So:
select BR2_PACKAGE_UBOOT_TOOLS # runtime
select BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV # runtime
baruch
> help
> Mender is an open source over-the-air (OTA) software updater
> for embedded Linux devices. Mender comprises a client
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 3/8] package/mender: add dep on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
2018-08-15 5:08 ` Baruch Siach
@ 2018-08-15 7:21 ` Mirza Krak
0 siblings, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 7:21 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 7:08 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Mirza,
Hi Baruch,
>
> Mirza Krak writes:
>> The Mender client uses fw_printenv/fw_setenv to manipulate the U-boot
>> environment, e.g to change the boot candidate after a update has been
>> done.
>>
>> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
>> ---
>> package/mender/Config.in | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/package/mender/Config.in b/package/mender/Config.in
>> index e461857486..8c2838c64a 100644
>> --- a/package/mender/Config.in
>> +++ b/package/mender/Config.in
>> @@ -3,6 +3,8 @@ config BR2_PACKAGE_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_PACKAGE_UBOOT_TOOLS
>> + depends on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
>
> For non-obvious dependencies like these we prefer 'select'. Also, since
> this is a run-time only dependency, there should be a comment saying
> that. So:
>
> select BR2_PACKAGE_UBOOT_TOOLS # runtime
> select BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV # runtime
Acknowledged.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
` (2 preceding siblings ...)
2018-08-14 23:13 ` [Buildroot] [PATCH 3/8] package/mender: add dep on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-15 5:10 ` Baruch Siach
2018-08-15 11:53 ` Thomas Petazzoni
2018-08-14 23:13 ` [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option Mirza Krak
` (3 subsequent siblings)
7 siblings, 2 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
ARTIFACT_NAME is used to set a unique string of the built artifact/image
and this will be reported to the Mender managment server as "current
software running".
The Mender managment server will skip updating device if the
ARTIFACT_NAME is the same on the target device as in the Mender artifact
and hence this name must be unique for every release.
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/Config.in | 13 +++++++++++++
package/mender/mender.mk | 7 +++++++
2 files changed, 20 insertions(+)
diff --git a/package/mender/Config.in b/package/mender/Config.in
index 8c2838c64a..036b7cf798 100644
--- a/package/mender/Config.in
+++ b/package/mender/Config.in
@@ -13,6 +13,19 @@ config BR2_PACKAGE_MENDER
https://github.com/mendersoftware/mender
+if BR2_PACKAGE_MENDER
+
+config BR2_PACKAGE_MENDER_ARTIFACT_NAME
+ string "Mender artifact name"
+ help
+ The name of the image or update that will be built. This is what the
+ device will report that it is running, and different updates must have
+ different names.
+
+ Will be stored in /etc/mender/artifact_info
+
+endif
+
comment "mender needs a toolchain w/ threads"
depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
diff --git a/package/mender/mender.mk b/package/mender/mender.mk
index b2df70256a..08bdd4bd78 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -9,6 +9,10 @@ MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION))
MENDER_LICENSE = Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT & OLDAP-2.8
MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
+ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME)),)
+$(error Mender device type not set. Check your BR2_PACKAGE_MENDER_ARTIFACT_NAME setting)
+endif
+
define MENDER_INSTALL_CONFIG_FILES
$(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
$(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
@@ -28,6 +32,9 @@ define MENDER_INSTALL_CONFIG_FILES
$(TARGET_DIR)/usr/share/mender/inventory
ln -sf /data/mender $(TARGET_DIR)/var/lib/mender
+
+ echo "artifact_name=$(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME))" > \
+ $(TARGET_DIR)/etc/mender/artifact_info
endef
MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option
2018-08-14 23:13 ` [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option Mirza Krak
@ 2018-08-15 5:10 ` Baruch Siach
2018-08-15 7:23 ` Mirza Krak
2018-08-15 11:53 ` Thomas Petazzoni
1 sibling, 1 reply; 40+ messages in thread
From: Baruch Siach @ 2018-08-15 5:10 UTC (permalink / raw)
To: buildroot
Hi Mirza,
Mirza Krak writes:
> ARTIFACT_NAME is used to set a unique string of the built artifact/image
> and this will be reported to the Mender managment server as "current
> software running".
>
> The Mender managment server will skip updating device if the
> ARTIFACT_NAME is the same on the target device as in the Mender artifact
> and hence this name must be unique for every release.
>
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
> ---
> package/mender/Config.in | 13 +++++++++++++
> package/mender/mender.mk | 7 +++++++
> 2 files changed, 20 insertions(+)
>
> diff --git a/package/mender/Config.in b/package/mender/Config.in
> index 8c2838c64a..036b7cf798 100644
> --- a/package/mender/Config.in
> +++ b/package/mender/Config.in
> @@ -13,6 +13,19 @@ config BR2_PACKAGE_MENDER
>
> https://github.com/mendersoftware/mender
>
> +if BR2_PACKAGE_MENDER
> +
> +config BR2_PACKAGE_MENDER_ARTIFACT_NAME
> + string "Mender artifact name"
You should have a default value here. Otherwise ...
> + help
> + The name of the image or update that will be built. This is what the
> + device will report that it is running, and different updates must have
> + different names.
> +
> + Will be stored in /etc/mender/artifact_info
> +
> +endif
> +
> comment "mender needs a toolchain w/ threads"
> depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
> depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
> diff --git a/package/mender/mender.mk b/package/mender/mender.mk
> index b2df70256a..08bdd4bd78 100644
> --- a/package/mender/mender.mk
> +++ b/package/mender/mender.mk
> @@ -9,6 +9,10 @@ MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION))
> MENDER_LICENSE = Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT & OLDAP-2.8
> MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
>
> +ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME)),)
> +$(error Mender device type not set. Check your BR2_PACKAGE_MENDER_ARTIFACT_NAME setting)
... this error will trigger by default. This will hit the autobuilders
badly.
Same goes for the next patch.
baruch
> +endif
> +
> define MENDER_INSTALL_CONFIG_FILES
> $(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
> $(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
> @@ -28,6 +32,9 @@ define MENDER_INSTALL_CONFIG_FILES
> $(TARGET_DIR)/usr/share/mender/inventory
>
> ln -sf /data/mender $(TARGET_DIR)/var/lib/mender
> +
> + echo "artifact_name=$(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME))" > \
> + $(TARGET_DIR)/etc/mender/artifact_info
> endef
>
> MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option
2018-08-15 5:10 ` Baruch Siach
@ 2018-08-15 7:23 ` Mirza Krak
0 siblings, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 7:23 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 7:10 AM, Baruch Siach <baruch@tkos.co.il> wrote:
> Hi Mirza,
>
> Mirza Krak writes:
>> ARTIFACT_NAME is used to set a unique string of the built artifact/image
>> and this will be reported to the Mender managment server as "current
>> software running".
>>
>> The Mender managment server will skip updating device if the
>> ARTIFACT_NAME is the same on the target device as in the Mender artifact
>> and hence this name must be unique for every release.
>>
>> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
>> ---
>> package/mender/Config.in | 13 +++++++++++++
>> package/mender/mender.mk | 7 +++++++
>> 2 files changed, 20 insertions(+)
>>
>> diff --git a/package/mender/Config.in b/package/mender/Config.in
>> index 8c2838c64a..036b7cf798 100644
>> --- a/package/mender/Config.in
>> +++ b/package/mender/Config.in
>> @@ -13,6 +13,19 @@ config BR2_PACKAGE_MENDER
>>
>> https://github.com/mendersoftware/mender
>>
>> +if BR2_PACKAGE_MENDER
>> +
>> +config BR2_PACKAGE_MENDER_ARTIFACT_NAME
>> + string "Mender artifact name"
>
> You should have a default value here. Otherwise ...
>
>> + help
>> + The name of the image or update that will be built. This is what the
>> + device will report that it is running, and different updates must have
>> + different names.
>> +
>> + Will be stored in /etc/mender/artifact_info
>> +
>> +endif
>> +
>> comment "mender needs a toolchain w/ threads"
>> depends on BR2_PACKAGE_HOST_GO_ARCH_SUPPORTS
>> depends on BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS
>> diff --git a/package/mender/mender.mk b/package/mender/mender.mk
>> index b2df70256a..08bdd4bd78 100644
>> --- a/package/mender/mender.mk
>> +++ b/package/mender/mender.mk
>> @@ -9,6 +9,10 @@ MENDER_SITE = $(call github,mendersoftware,mender,$(MENDER_VERSION))
>> MENDER_LICENSE = Apache-2.0 & BSD-2-Clause & BSD-3-Clause & MIT & OLDAP-2.8
>> MENDER_LICENSE_FILES = LICENSE LIC_FILES_CHKSUM.sha256
>>
>> +ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME)),)
>> +$(error Mender device type not set. Check your BR2_PACKAGE_MENDER_ARTIFACT_NAME setting)
>
> ... this error will trigger by default. This will hit the autobuilders
> badly.
>
> Same goes for the next patch.
Got it.
Thank you for reviewing.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option
2018-08-14 23:13 ` [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option Mirza Krak
2018-08-15 5:10 ` Baruch Siach
@ 2018-08-15 11:53 ` Thomas Petazzoni
2018-08-15 12:23 ` Mirza Krak
1 sibling, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 11:53 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 01:13:33 +0200, Mirza Krak wrote:
> +if BR2_PACKAGE_MENDER
> +
> +config BR2_PACKAGE_MENDER_ARTIFACT_NAME
> + string "Mender artifact name"
> + help
> + The name of the image or update that will be built. This is what the
> + device will report that it is running, and different updates must have
> + different names.
> +
> + Will be stored in /etc/mender/artifact_info
> +
> +endif
I am wondering if we really need a new option for that, or if you
shouldn't just let the user add /etc/mender/artifact_info to its root
filesystem overlay.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option
2018-08-15 11:53 ` Thomas Petazzoni
@ 2018-08-15 12:23 ` Mirza Krak
0 siblings, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 12:23 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 1:53 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 01:13:33 +0200, Mirza Krak wrote:
>
>> +if BR2_PACKAGE_MENDER
>> +
>> +config BR2_PACKAGE_MENDER_ARTIFACT_NAME
>> + string "Mender artifact name"
>> + help
>> + The name of the image or update that will be built. This is what the
>> + device will report that it is running, and different updates must have
>> + different names.
>> +
>> + Will be stored in /etc/mender/artifact_info
>> +
>> +endif
>
> I am wondering if we really need a new option for that, or if you
> shouldn't just let the user add /etc/mender/artifact_info to its root
> filesystem overlay.
This file is required to be present for the Mender client to start in
daemon mode, but I could just create a file with "dummy" content
without the option to satisfy that behavior and let users override
with file-system overlay if that is the preferred to minimize number
of options.
Though there is a reason why this was an option and it was to be able
to share this information with the mender-artifact tool, I do not know
if that is actually possible with how I did this. To provide some more
context, somewhere I have the intention of calling the mender-artifact
(host tool) tool with the following arguments:
#Create Mender artifact
mender-artifact write rootfs-image \
--update ${output_dir}/rootfs.ext4 \
--output-path ${mender_artifact} \
--artifact-name ${artifact_name} \
--device-type ${device_type}
I have not yet figured out where to put above but I am getting there
:). Mender artifacts are basically the ext4 image + some meta-data
(checksum, signature, file-size etc)
Target image and Mender artifact share information (device_type and
artifact_info/artifact_name) to be able to do sanity checks later on
when updates are applied. This was my intention of keeping
artifact_name as an option to be able to share it. But I gladly accept
suggestions on how to best solve this.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
` (3 preceding siblings ...)
2018-08-14 23:13 ` [Buildroot] [PATCH 4/8] package/mender: add BR2_PACKAGE_MENDER_ARTIFACT_NAME option Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-15 11:55 ` Thomas Petazzoni
2018-08-14 23:13 ` [Buildroot] [PATCH 6/8] package/mender: populate the mender.conf template Mirza Krak
` (2 subsequent siblings)
7 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
MENDER_DEVICE_TYPE is used to verify compatibility of Mender artifacts
against devices and it will also be reported to the Mender management
server from the device for the server to be able to verify this.
Device type can not change once a device has been provisioned with the
initial software and this is why it is stored on the persistent data
partition which is preserved across updates.
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/Config.in | 10 ++++++++++
package/mender/mender.mk | 7 +++++++
2 files changed, 17 insertions(+)
diff --git a/package/mender/Config.in b/package/mender/Config.in
index 036b7cf798..4297c17a90 100644
--- a/package/mender/Config.in
+++ b/package/mender/Config.in
@@ -24,6 +24,16 @@ config BR2_PACKAGE_MENDER_ARTIFACT_NAME
Will be stored in /etc/mender/artifact_info
+config BR2_PACKAGE_MENDER_DEVICE_TYPE
+ string "Mender device type"
+ help
+ A string that defines the type of device which will be used to check
+ compatibility of update artifacts. Once a device is flashed with this,
+ it will not change, even if the device is updated using Mender.
+
+ Will be stored in /data/mender/device_type. Note that /data is a mount
+ point for the persistent data partition.
+
endif
comment "mender needs a toolchain w/ threads"
diff --git a/package/mender/mender.mk b/package/mender/mender.mk
index 08bdd4bd78..670f9eb956 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -13,6 +13,10 @@ ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME)),)
$(error Mender device type not set. Check your BR2_PACKAGE_MENDER_ARTIFACT_NAME setting)
endif
+ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_DEVICE_TYPE)),)
+$(error Mender device type not set. Check your BR2_PACKAGE_MENDER_DEVICE_TYPE setting)
+endif
+
define MENDER_INSTALL_CONFIG_FILES
$(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
$(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
@@ -35,6 +39,9 @@ define MENDER_INSTALL_CONFIG_FILES
echo "artifact_name=$(call qstrip,$(BR2_PACKAGE_MENDER_ARTIFACT_NAME))" > \
$(TARGET_DIR)/etc/mender/artifact_info
+
+ echo "device_type=$(call qstrip,$(BR2_PACKAGE_MENDER_DEVICE_TYPE))" > \
+ $(TARGET_DIR)/data/mender/device_type
endef
MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option
2018-08-14 23:13 ` [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option Mirza Krak
@ 2018-08-15 11:55 ` Thomas Petazzoni
2018-08-15 12:26 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 11:55 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 01:13:34 +0200, Mirza Krak wrote:
> +config BR2_PACKAGE_MENDER_DEVICE_TYPE
> + string "Mender device type"
> + help
> + A string that defines the type of device which will be used to check
> + compatibility of update artifacts. Once a device is flashed with this,
> + it will not change, even if the device is updated using Mender.
> +
> + Will be stored in /data/mender/device_type. Note that /data is a mount
> + point for the persistent data partition.
I am a bit confused with "Note that /data is a mount point for the
persistent data partition". If /data is a different partition than the
root filesystem one, then what is the point of
having /data/mender/device_type in the root filesystem ? It will be
hidden by whatever partition gets mounted in /data.
(Side note: please make sure to run check-package on your changes, the
Config.in help text lines look a bit too long.)
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option
2018-08-15 11:55 ` Thomas Petazzoni
@ 2018-08-15 12:26 ` Mirza Krak
2018-08-15 12:42 ` Thomas Petazzoni
0 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 12:26 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 1:55 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 01:13:34 +0200, Mirza Krak wrote:
>
>> +config BR2_PACKAGE_MENDER_DEVICE_TYPE
>> + string "Mender device type"
>> + help
>> + A string that defines the type of device which will be used to check
>> + compatibility of update artifacts. Once a device is flashed with this,
>> + it will not change, even if the device is updated using Mender.
>> +
>> + Will be stored in /data/mender/device_type. Note that /data is a mount
>> + point for the persistent data partition.
>
> I am a bit confused with "Note that /data is a mount point for the
> persistent data partition". If /data is a different partition than the
> root filesystem one, then what is the point of
> having /data/mender/device_type in the root filesystem ? It will be
> hidden by whatever partition gets mounted in /data.
Understand the confusion, my intention was to convert the /data
directory on target image to an ext4 image in a post build step and
that is why I put these files there. Or is there a better way of
"staging" files for post build steps?
>
> (Side note: please make sure to run check-package on your changes, the
> Config.in help text lines look a bit too long.)
Will do.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option
2018-08-15 12:26 ` Mirza Krak
@ 2018-08-15 12:42 ` Thomas Petazzoni
2018-08-15 12:46 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 12:42 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 14:26:46 +0200, Mirza Krak wrote:
> > I am a bit confused with "Note that /data is a mount point for the
> > persistent data partition". If /data is a different partition than the
> > root filesystem one, then what is the point of
> > having /data/mender/device_type in the root filesystem ? It will be
> > hidden by whatever partition gets mounted in /data.
>
> Understand the confusion, my intention was to convert the /data
> directory on target image to an ext4 image in a post build step
Why do you want to do this ?
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option
2018-08-15 12:42 ` Thomas Petazzoni
@ 2018-08-15 12:46 ` Mirza Krak
2018-08-15 17:47 ` Thomas Petazzoni
0 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 12:46 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 2:42 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 14:26:46 +0200, Mirza Krak wrote:
>
>> > I am a bit confused with "Note that /data is a mount point for the
>> > persistent data partition". If /data is a different partition than the
>> > root filesystem one, then what is the point of
>> > having /data/mender/device_type in the root filesystem ? It will be
>> > hidden by whatever partition gets mounted in /data.
>>
>> Understand the confusion, my intention was to convert the /data
>> directory on target image to an ext4 image in a post build step
>
> Why do you want to do this ?
In the end I would like to create a "disk image" with _all_ the
content, and the data part must be populated at build time, as it
works at the moment.
Pseudo image:
image sdcard.img {
hdimage {
}
partition u-boot {
partition-type = 0xC
bootable = "true"
image = "boot.vfat"
}
partition rootfsA {
partition-type = 0x83
image = "rootfs.ext4"
size = 512M
}
partition rootfsB {
partition-type = 0x83
image = "rootfs.ext4"
size = 512M
}
partition data {
partition-type = 0x83
image = "data.ext4"
size = 512M
}
}
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option
2018-08-15 12:46 ` Mirza Krak
@ 2018-08-15 17:47 ` Thomas Petazzoni
2018-08-15 19:41 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 17:47 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 14:46:20 +0200, Mirza Krak wrote:
> >> > I am a bit confused with "Note that /data is a mount point for the
> >> > persistent data partition". If /data is a different partition than the
> >> > root filesystem one, then what is the point of
> >> > having /data/mender/device_type in the root filesystem ? It will be
> >> > hidden by whatever partition gets mounted in /data.
> >>
> >> Understand the confusion, my intention was to convert the /data
> >> directory on target image to an ext4 image in a post build step
> >
> > Why do you want to do this ?
>
> In the end I would like to create a "disk image" with _all_ the
> content, and the data part must be populated at build time, as it
> works at the moment.
>
> Pseudo image:
>
> image sdcard.img {
> hdimage {
> }
>
> partition u-boot {
> partition-type = 0xC
> bootable = "true"
> image = "boot.vfat"
> }
>
> partition rootfsA {
> partition-type = 0x83
> image = "rootfs.ext4"
> size = 512M
> }
>
> partition rootfsB {
> partition-type = 0x83
> image = "rootfs.ext4"
> size = 512M
> }
>
> partition data {
> partition-type = 0x83
> image = "data.ext4"
> size = 512M
> }
> }
I don't think we should enforce anything like that in the Mender
package. Buildroot's policy is to not have much policy on how the
system should be structured/organized. Maybe people won't need any data
partition because the system is completely state-less ? Maybe they need
two data partitions ? Maybe having it in /data is not what they want.
So, the mender package should not make any assumption like this. And I
still don't get why the device_type file should be in this data
partition :-)
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option
2018-08-15 17:47 ` Thomas Petazzoni
@ 2018-08-15 19:41 ` Mirza Krak
0 siblings, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 19:41 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 7:47 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
Hello,
< snip >
> I don't think we should enforce anything like that in the Mender
> package. Buildroot's policy is to not have much policy on how the
> system should be structured/organized. Maybe people won't need any data
> partition because the system is completely state-less ? Maybe they need
> two data partitions ? Maybe having it in /data is not what they want.
I highly appropriate you taking time to review this.
It is time for me to provide a bit more context :), I know all the
internals so I assume that other people know this as well :).
Mender is an end-to-end open-source update solution. This has some
implications and "enforcement". Other update solutions such as
swupdate or RAUC are generic update solutions and highly configurable
= no enforcement/policies. They do not really do anything specific
unless you apply some kind of configuration to them.
Mender is highly optimized to do A & B style updates really well and
that is it (for now), and is coupled with an management server for OTA
updates (optional as it is able to do stand-alone updates). Being
highly optimized for a specific use-case/style of updates also has
some (not many but still) "enforcement's" otherwise you lose some of
the benefits of being a "highly optimized" solution. I understand that
not everything can exist in the upstream Buildroot repository and some
things shall come in via file-system overlays and external patches but
I am trying to get in as much as possible to minimize the "external"
stuff and appreciate your feedback on where to draw the line.
This examples is based on updates on block based devices (eMMC/SD)
Mender _requires_ that the following partitions:
- rootfs A
- rootfs B
- data (persistent)
So "data" is not optional. You can have as many extra partitions as
you would like but above is minimum if Mender is to be used. You can
adjust where to mount the persistent data partition easily trough
file-system overlay, but "normally" it is /data. Things that are
stored on "data" part are not touched by updates and you only update
rootfs A and rootfs B.
Things stored on the "data" part by the Mender client:
- update progress logs / error logs on the persistent data part to be
able to provide failed updates to the server.
- authentication data provided by the server once the device is boot-strapped.
- device_type (explanation coming soon :))
- fw_env.config ()
device_type and fw_env.config must be populated during build-time, the
other stuff will be dynamically created by the Mender client once it
connects to a server etc.
My intention with installing it to /data in mender.mk is to have it in
place, even though it is in the wrong location. This can be later
extracted in a "post build" stage and converted to an ext4 image and
embedded in to an disk image as a separate partition. If am violating
Buildroot policies with this, I will back-off :).
>
> So, the mender package should not make any assumption like this. And I
> still don't get why the device_type file should be in this data
> partition :-)
The device_type file normally contains a string like:
device_type=raspberrypi3
or
device_type=beaglebone
The content of this file is reported to the Mender service as a
"compatibility" string, so that you can only install artifacts that
are targeting "raspberrypi3" on devices that actually are reporting
that they are a "raspberrypi3" device. And the reason for this to be
on the "data" part is that this value can not change once set.
The same applies for the fw_env.config file, which is an important
part for Mender to work it is put on "data" part to not be affected by
updates. There is a symlink in rootfs, /etc/fw_env.config ->
/data/uboot/fw_env.config
Sorry for the long email, but hopefully this brings some insights.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 6/8] package/mender: populate the mender.conf template
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
` (4 preceding siblings ...)
2018-08-14 23:13 ` [Buildroot] [PATCH 5/8] package/mender: add BR2_PACKAGE_MENDER_DEVICE_TYPE option Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-15 11:56 ` Thomas Petazzoni
2018-08-14 23:13 ` [Buildroot] [PATCH 7/8] package/mender: select BR2_PACKAGE_CA_CERTIFICATES Mirza Krak
2018-08-14 23:13 ` [Buildroot] [PATCH 8/8] package/mender: set version in go linker Mirza Krak
7 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
Options are provided for the Mender configuration and the
default values should work together with a Mender demo
environment.
https://docs.mender.io//getting-started/create-a-test-environment
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/Config.in | 69 ++++++++++++++++++++++++++++++++++++++
package/mender/mender.conf | 14 +++-----
package/mender/mender.mk | 12 +++++--
3 files changed, 84 insertions(+), 11 deletions(-)
diff --git a/package/mender/Config.in b/package/mender/Config.in
index 4297c17a90..6fa9079b1d 100644
--- a/package/mender/Config.in
+++ b/package/mender/Config.in
@@ -34,6 +34,75 @@ config BR2_PACKAGE_MENDER_DEVICE_TYPE
Will be stored in /data/mender/device_type. Note that /data is a mount
point for the persistent data partition.
+config BR2_PACKAGE_MENDER_INVENTORY_POLL_INTERVAL_SEC
+ int "Inventory poll interval"
+ default 1800
+ help
+ An integer that sets the number of seconds to wait between each inventory
+ poll to the Mender server.
+
+ https://docs.mender.io/client-configuration/configuration-file/polling-intervals
+
+config BR2_PACKAGE_MENDER_UPDATE_POLL_INTERVAL_SEC
+ int "Update poll interval"
+ default 1800
+ help
+ An integer that sets the number of seconds to wait between each check for
+ a new update. Note that the client may occasionally check more often if
+ there has been recent activity on the device
+
+ https://docs.mender.io/client-configuration/configuration-file/polling-intervals
+
+config BR2_PACKAGE_MENDER_RETRY_POLL_INTERVAL_SEC
+ int "Retry poll interval"
+ default 300
+ help
+ An integer that sets the number of seconds to wait between each attempt
+ to download an update file. Note that the client may attempt more often
+ initially to enable rapid upgrades, but will gradually fall back to this
+ value if the server is busy.
+
+ https://docs.mender.io/client-configuration/configuration-file/polling-intervals
+
+config BR2_PACKAGE_MENDER_SERVER_URL
+ string "Server URL"
+ default "https://docker.mender.io"
+ help
+ The server URL which is used as the basis for API requests. This should
+ be set to the server that runs the Mender server services. It should
+ include the whole URL, including https:// and a trailing slash.
+
+ The default points to the Mender demo server setup,
+ https://docs.mender.io/1.5/getting-started/create-a-test-environment
+
+config BR2_PACKAGE_MENDER_TENANT_TOKEN
+ string "Hosted Mender tenant token"
+ default "dummy"
+ help
+ A token which identifies which tenant a device belongs to. This is only
+ relevant if using Hosted Mender.
+
+config BR2_PACKAGE_MENDER_SERVER_CRT
+ string "Public certificate of the Mender server"
+ default "/etc/mender/server.crt"
+ help
+ The location of the public certificate of the server, if any. If this
+ certificate is missing, or the one presented by the server doesn't match
+ the one specified in this setting, the server certificate will be
+ validated using standard certificate trust chains
+
+config BR2_PACKAGE_MENDER_ROOTFS_PART_A
+ string "Root filesystem A device"
+ default "mmcblk0p2"
+ help
+ The Linux device that contains root filesystem A.
+
+config BR2_PACKAGE_MENDER_ROOTFS_PART_B
+ string "Root filesystem B device"
+ default "mmcblk0p3"
+ help
+ The Linux device that contains root filesystem B.
+
endif
comment "mender needs a toolchain w/ threads"
diff --git a/package/mender/mender.conf b/package/mender/mender.conf
index a5c7c545c3..cee8c7be9d 100644
--- a/package/mender/mender.conf
+++ b/package/mender/mender.conf
@@ -1,14 +1,10 @@
{
- "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@,
+ "UpdatePollIntervalSeconds": @MENDER_UPDATE_POLL_INTERVAL_SECONDS@,
"RetryPollIntervalSeconds": @MENDER_RETRY_POLL_INTERVAL_SECONDS@,
+ "RootfsPartA": "@MENDER_ROOTFS_PART_A@",
+ "RootfsPartB": "@MENDER_ROOTFS_PART_B@",
+ "ServerCertificate": "@MENDER_CERT_LOCATION@",
"ServerURL": "@MENDER_SERVER_URL@",
- "ServerCertificate": "@MENDER_CERT_LOCATION@"
+ "TenantToken": "@MENDER_TENANT_TOKEN@"
}
diff --git a/package/mender/mender.mk b/package/mender/mender.mk
index 670f9eb956..ce48c82671 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -26,8 +26,6 @@ define MENDER_INSTALL_CONFIG_FILES
$(INSTALL) -d -m 755 $(TARGET_DIR)/etc/mender/scripts
echo -n "2" > $(TARGET_DIR)/etc/mender/scripts/version
- $(INSTALL) -D -m 0644 package/mender/mender.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 $(@D)/support/mender-device-identity \
@@ -42,6 +40,16 @@ define MENDER_INSTALL_CONFIG_FILES
echo "device_type=$(call qstrip,$(BR2_PACKAGE_MENDER_DEVICE_TYPE))" > \
$(TARGET_DIR)/data/mender/device_type
+
+ sed -e 's#@MENDER_ROOTFS_PART_A@#$(call qstrip,$(BR2_PACKAGE_MENDER_ROOTFS_PART_A))#g' \
+ -e 's#@MENDER_ROOTFS_PART_B@#$(call qstrip,$(BR2_PACKAGE_MENDER_ROOTFS_PART_B))#g' \
+ -e 's/@MENDER_UPDATE_POLL_INTERVAL_SECONDS@/$(call qstrip,$(BR2_PACKAGE_MENDER_UPDATE_POLL_INTERVAL_SEC))/' \
+ -e 's/@MENDER_INVENTORY_POLL_INTERVAL_SECONDS@/$(call qstrip,$(BR2_PACKAGE_MENDER_INVENTORY_POLL_INTERVAL_SEC))/' \
+ -e 's/@MENDER_RETRY_POLL_INTERVAL_SECONDS@/$(call qstrip,$(BR2_PACKAGE_MENDER_RETRY_POLL_INTERVAL_SEC))/' \
+ -e 's#@MENDER_SERVER_URL@#$(call qstrip,$(BR2_PACKAGE_MENDER_SERVER_URL))#g' \
+ -e 's#@MENDER_CERT_LOCATION@#$(call qstrip,$(BR2_PACKAGE_MENDER_SERVER_CRT))#g' \
+ -e 's/@MENDER_TENANT_TOKEN@/$(call qstrip,$(BR2_PACKAGE_MENDER_TENANT_TOKEN))/' \
+ package/mender/mender.conf > $(TARGET_DIR)/etc/mender/mender.conf
endef
MENDER_POST_INSTALL_TARGET_HOOKS += MENDER_INSTALL_CONFIG_FILES
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 6/8] package/mender: populate the mender.conf template
2018-08-14 23:13 ` [Buildroot] [PATCH 6/8] package/mender: populate the mender.conf template Mirza Krak
@ 2018-08-15 11:56 ` Thomas Petazzoni
2018-08-15 12:27 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 11:56 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 01:13:35 +0200, Mirza Krak wrote:
> Options are provided for the Mender configuration and the
> default values should work together with a Mender demo
> environment.
>
> https://docs.mender.io//getting-started/create-a-test-environment
>
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
I'm sorry, but no. We are not going to add gazillions of options to
each and every package to be able to configure the zillions of possible
knobs that can be configured. We are not going to add options to create
virtual hosts in Apache or Lighttpd, we are not going to add options to
enable/disable each and every cipher in OpenSSH, etc.
The point of Buildroot is to provide a reasonable default mender.conf,
and let user override it with their own configuration file as part of a
root filesystem overlay.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 6/8] package/mender: populate the mender.conf template
2018-08-15 11:56 ` Thomas Petazzoni
@ 2018-08-15 12:27 ` Mirza Krak
0 siblings, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 12:27 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 1:56 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 01:13:35 +0200, Mirza Krak wrote:
>> Options are provided for the Mender configuration and the
>> default values should work together with a Mender demo
>> environment.
>>
>> https://docs.mender.io//getting-started/create-a-test-environment
>>
>> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
>
> I'm sorry, but no. We are not going to add gazillions of options to
> each and every package to be able to configure the zillions of possible
> knobs that can be configured. We are not going to add options to create
> virtual hosts in Apache or Lighttpd, we are not going to add options to
> enable/disable each and every cipher in OpenSSH, etc.
>
> The point of Buildroot is to provide a reasonable default mender.conf,
> and let user override it with their own configuration file as part of a
> root filesystem overlay.
Got it.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 7/8] package/mender: select BR2_PACKAGE_CA_CERTIFICATES
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
` (5 preceding siblings ...)
2018-08-14 23:13 ` [Buildroot] [PATCH 6/8] package/mender: populate the mender.conf template Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-15 11:57 ` Thomas Petazzoni
2018-08-14 23:13 ` [Buildroot] [PATCH 8/8] package/mender: set version in go linker Mirza Krak
7 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
Mender uses TLS to community with the management server,
and if CA signed certificates are used we must have
the ca-certificates package installed to be able to
verify these.
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/Config.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/mender/Config.in b/package/mender/Config.in
index 6fa9079b1d..f5a1a74110 100644
--- a/package/mender/Config.in
+++ b/package/mender/Config.in
@@ -5,6 +5,7 @@ config BR2_PACKAGE_MENDER
depends on BR2_TOOLCHAIN_HAS_THREADS
depends on BR2_PACKAGE_UBOOT_TOOLS
depends on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
+ select BR2_PACKAGE_CA_CERTIFICATES
help
Mender is an open source over-the-air (OTA) software updater
for embedded Linux devices. Mender comprises a client
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 7/8] package/mender: select BR2_PACKAGE_CA_CERTIFICATES
2018-08-14 23:13 ` [Buildroot] [PATCH 7/8] package/mender: select BR2_PACKAGE_CA_CERTIFICATES Mirza Krak
@ 2018-08-15 11:57 ` Thomas Petazzoni
2018-08-15 12:28 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 11:57 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 01:13:36 +0200, Mirza Krak wrote:
> Mender uses TLS to community with the management server,
> and if CA signed certificates are used we must have
> the ca-certificates package installed to be able to
> verify these.
>
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
> ---
> package/mender/Config.in | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/package/mender/Config.in b/package/mender/Config.in
> index 6fa9079b1d..f5a1a74110 100644
> --- a/package/mender/Config.in
> +++ b/package/mender/Config.in
> @@ -5,6 +5,7 @@ config BR2_PACKAGE_MENDER
> depends on BR2_TOOLCHAIN_HAS_THREADS
> depends on BR2_PACKAGE_UBOOT_TOOLS
> depends on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
> + select BR2_PACKAGE_CA_CERTIFICATES
Please add "# runtime" at the end of this line, to clarify that we
don't have a build dependency on this.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 7/8] package/mender: select BR2_PACKAGE_CA_CERTIFICATES
2018-08-15 11:57 ` Thomas Petazzoni
@ 2018-08-15 12:28 ` Mirza Krak
0 siblings, 0 replies; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 12:28 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 1:57 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 01:13:36 +0200, Mirza Krak wrote:
>> Mender uses TLS to community with the management server,
>> and if CA signed certificates are used we must have
>> the ca-certificates package installed to be able to
>> verify these.
>>
>> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
>> ---
>> package/mender/Config.in | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/package/mender/Config.in b/package/mender/Config.in
>> index 6fa9079b1d..f5a1a74110 100644
>> --- a/package/mender/Config.in
>> +++ b/package/mender/Config.in
>> @@ -5,6 +5,7 @@ config BR2_PACKAGE_MENDER
>> depends on BR2_TOOLCHAIN_HAS_THREADS
>> depends on BR2_PACKAGE_UBOOT_TOOLS
>> depends on BR2_PACKAGE_UBOOT_TOOLS_FWPRINTENV
>> + select BR2_PACKAGE_CA_CERTIFICATES
>
> Please add "# runtime" at the end of this line, to clarify that we
> don't have a build dependency on this.
Got it, thanks
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 8/8] package/mender: set version in go linker
2018-08-14 23:13 [Buildroot] [PATCH 0/8] various improvements to package/mender Mirza Krak
` (6 preceding siblings ...)
2018-08-14 23:13 ` [Buildroot] [PATCH 7/8] package/mender: select BR2_PACKAGE_CA_CERTIFICATES Mirza Krak
@ 2018-08-14 23:13 ` Mirza Krak
2018-08-15 11:58 ` Thomas Petazzoni
7 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-14 23:13 UTC (permalink / raw)
To: buildroot
This is used when calling the mender client with the
-version option and it says "unknown" if not set in
linker.
Now it displays the following:
# mender -version
1.4.0
runtime: go1.10.2
Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
---
package/mender/mender.mk | 2 ++
1 file changed, 2 insertions(+)
diff --git a/package/mender/mender.mk b/package/mender/mender.mk
index ce48c82671..db0eb55454 100644
--- a/package/mender/mender.mk
+++ b/package/mender/mender.mk
@@ -17,6 +17,8 @@ ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_DEVICE_TYPE)),)
$(error Mender device type not set. Check your BR2_PACKAGE_MENDER_DEVICE_TYPE setting)
endif
+MENDER_LDFLAGS = -X main.Version=$(MENDER_VERSION)
+
define MENDER_INSTALL_CONFIG_FILES
$(INSTALL) -d -m 755 $(TARGET_DIR)/data/mender
$(INSTALL) -d -m 755 $(TARGET_DIR)/data/uboot
--
2.18.0
^ permalink raw reply related [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 8/8] package/mender: set version in go linker
2018-08-14 23:13 ` [Buildroot] [PATCH 8/8] package/mender: set version in go linker Mirza Krak
@ 2018-08-15 11:58 ` Thomas Petazzoni
2018-08-15 12:32 ` Mirza Krak
0 siblings, 1 reply; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 11:58 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 01:13:37 +0200, Mirza Krak wrote:
> This is used when calling the mender client with the
> -version option and it says "unknown" if not set in
> linker.
>
> Now it displays the following:
>
> # mender -version
> 1.4.0
> runtime: go1.10.2
>
> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
> ---
> package/mender/mender.mk | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/package/mender/mender.mk b/package/mender/mender.mk
> index ce48c82671..db0eb55454 100644
> --- a/package/mender/mender.mk
> +++ b/package/mender/mender.mk
> @@ -17,6 +17,8 @@ ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_DEVICE_TYPE)),)
> $(error Mender device type not set. Check your BR2_PACKAGE_MENDER_DEVICE_TYPE setting)
> endif
>
> +MENDER_LDFLAGS = -X main.Version=$(MENDER_VERSION)
Is this main.Version property something specific to Mender, or
something that is common to Go packaging in general ? I'm just trying
to figure out if it should be in mender.mk like you did, or in
pkg-golang.mk.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread
* [Buildroot] [PATCH 8/8] package/mender: set version in go linker
2018-08-15 11:58 ` Thomas Petazzoni
@ 2018-08-15 12:32 ` Mirza Krak
2018-08-15 12:43 ` Thomas Petazzoni
0 siblings, 1 reply; 40+ messages in thread
From: Mirza Krak @ 2018-08-15 12:32 UTC (permalink / raw)
To: buildroot
On Wed, Aug 15, 2018 at 1:58 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 15 Aug 2018 01:13:37 +0200, Mirza Krak wrote:
>> This is used when calling the mender client with the
>> -version option and it says "unknown" if not set in
>> linker.
>>
>> Now it displays the following:
>>
>> # mender -version
>> 1.4.0
>> runtime: go1.10.2
>>
>> Signed-off-by: Mirza Krak <mirza.krak@northern.tech>
>> ---
>> package/mender/mender.mk | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/package/mender/mender.mk b/package/mender/mender.mk
>> index ce48c82671..db0eb55454 100644
>> --- a/package/mender/mender.mk
>> +++ b/package/mender/mender.mk
>> @@ -17,6 +17,8 @@ ifeq ($(call qstrip,$(BR2_PACKAGE_MENDER_DEVICE_TYPE)),)
>> $(error Mender device type not set. Check your BR2_PACKAGE_MENDER_DEVICE_TYPE setting)
>> endif
>>
>> +MENDER_LDFLAGS = -X main.Version=$(MENDER_VERSION)
>
> Is this main.Version property something specific to Mender, or
> something that is common to Go packaging in general ? I'm just trying
> to figure out if it should be in mender.mk like you did, or in
> pkg-golang.mk.
I would not know the answer to this as my experience is somewhat
limited when it comes to golang. But if we take a look at
docker-containerd.mk, it does this:
DOCKER_CONTAINERD_LDFLAGS = \
-X
github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION)
Maybe above an argument against putting it in pkg-golank.mk?
Marcin, maybe you know? Or someone else on the list.
--
Mirza Krak | Embedded Solutions Architect | https://mender.io
Northern.tech AS | @northerntechHQ
^ permalink raw reply [flat|nested] 40+ messages in thread* [Buildroot] [PATCH 8/8] package/mender: set version in go linker
2018-08-15 12:32 ` Mirza Krak
@ 2018-08-15 12:43 ` Thomas Petazzoni
0 siblings, 0 replies; 40+ messages in thread
From: Thomas Petazzoni @ 2018-08-15 12:43 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 15 Aug 2018 14:32:23 +0200, Mirza Krak wrote:
> I would not know the answer to this as my experience is somewhat
> limited when it comes to golang. But if we take a look at
> docker-containerd.mk, it does this:
>
> DOCKER_CONTAINERD_LDFLAGS = \
> -X
> github.com/docker/containerd.GitCommit=$(DOCKER_CONTAINERD_VERSION)
>
> Maybe above an argument against putting it in pkg-golank.mk?
Indeed, every package seems to use its own custom property, so your
patch looks good. Thanks!
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 40+ messages in thread