summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.adoc10
-rw-r--r--README.adoc2
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb7
-rw-r--r--recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb3
-rw-r--r--recipes-sota/aktualizr/aktualizr-hsm-prov.bb6
-rw-r--r--recipes-sota/aktualizr/aktualizr-implicit-prov.bb6
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb3
-rw-r--r--recipes-sota/aktualizr/files/LICENSE373
-rw-r--r--recipes-sota/aktualizr/garage-sign-version.inc17
-rw-r--r--recipes-sota/config/aktualizr-disable-send-ip.bb3
-rw-r--r--recipes-sota/config/aktualizr-example-interface.bb3
-rw-r--r--recipes-sota/config/aktualizr-log-debug.bb3
-rw-r--r--recipes-sota/config/files/LICENSE373
-rw-r--r--recipes-support/softhsm-testtoken/files/createtoken.sh2
-rw-r--r--recipes-support/softhsm-testtoken/softhsm-testtoken.bb4
-rwxr-xr-xscripts/find_aktualizr_dependencies.sh23
-rwxr-xr-xscripts/find_dependencies.py214
-rwxr-xr-xscripts/find_packages.py125
18 files changed, 277 insertions, 900 deletions
diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc
index 93a0815..4ad9836 100644
--- a/CONTRIBUTING.adoc
+++ b/CONTRIBUTING.adoc
@@ -1,5 +1,13 @@
1= Contributing 1= Contributing
2 2
3We welcome pull requests from anyone. The master branch is the primary branch for development, and if you wish to add new functionality, it probably belongs there. We attempt to maintain recent previous branches and welcome bug fixes and backports for those. Currently, the actively maintained branches are sumo, rocko, and pyro. Previously, morty was also a stable branch, but it has not been updated or actively maintained for a while. 3We welcome pull requests from anyone. The master branch is the primary branch for development, and if you wish to add new functionality, it probably belongs there. We attempt to maintain recent previous branches and welcome bug fixes and backports for those. Currently, the actively maintained branches are:
4
5* sumo
6* rocko
7
8Previously, some older branches were also regularly supported, and while they should still be stable, they have not been updated or actively maintained for a while. These branches include:
9
10* pyro
11* morty
4 12
5If you are developing with meta-updater, it may be helpful to read the README and other documentation for link:README.adoc[this repo], https://github.com/advancedtelematic/aktualizr[aktualizr], and the https://github.com/advancedtelematic/updater-repo/[updater-repo], particularly the sections about development and debugging. 13If you are developing with meta-updater, it may be helpful to read the README and other documentation for link:README.adoc[this repo], https://github.com/advancedtelematic/aktualizr[aktualizr], and the https://github.com/advancedtelematic/updater-repo/[updater-repo], particularly the sections about development and debugging.
diff --git a/README.adoc b/README.adoc
index 75ee9ae..d2bd4b5 100644
--- a/README.adoc
+++ b/README.adoc
@@ -81,7 +81,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w
81* `OSTREE_INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy. 81* `OSTREE_INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy.
82* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push]. 82* `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push].
83* `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are https://github.com/advancedtelematic/aktualizr/blob/master/docs/automatic-provisioning.adoc[`aktualizr-auto-prov`], https://github.com/advancedtelematic/aktualizr/blob/master/docs/implicit-provisioning.adoc[`aktualizr-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe. 83* `SOTA_CLIENT_PROV` - which provisioning method to use. Valid options are https://github.com/advancedtelematic/aktualizr/blob/master/docs/automatic-provisioning.adoc[`aktualizr-auto-prov`], https://github.com/advancedtelematic/aktualizr/blob/master/docs/implicit-provisioning.adoc[`aktualizr-implicit-prov`], and https://github.com/advancedtelematic/aktualizr/blob/master/docs/hsm-provisioning.adoc[`aktualizr-hsm-prov`]. The default is `aktualizr-auto-prov`. This can also be set to an empty string to avoid using a provisioning recipe.
84* `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid option is `hsm` (to build with HSM support) 84* `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid options are `hsm` (to build with HSM support) and `secondary-network` (to set up a simulated 'in-vehicle' network with support for a primary node with a DHCP server and a secondary node with a DHCP client).
85* `SOTA_SECONDARY_ECUS` - a list of paths separated by spaces of JSON configuration files for virtual secondaries on the host. These will be installed into `/var/sota/ecus` on the device. 85* `SOTA_SECONDARY_ECUS` - a list of paths separated by spaces of JSON configuration files for virtual secondaries on the host. These will be installed into `/var/sota/ecus` on the device.
86* `SOTA_VIRTUAL_SECONDARIES` - a list of paths separated by spaces of JSON configuration files for virtual secondaries installed on the device. If `SOTA_SECONDARY_ECUS` is used to install them, then you can expect them to be installed in `/var/sota/ecus`. 86* `SOTA_VIRTUAL_SECONDARIES` - a list of paths separated by spaces of JSON configuration files for virtual secondaries installed on the device. If `SOTA_SECONDARY_ECUS` is used to install them, then you can expect them to be installed in `/var/sota/ecus`.
87 87
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
index 77f8f22..9fa95ed 100644
--- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
@@ -3,15 +3,14 @@ DESCRIPTION = "Configuration for automatically provisioning Aktualizr, the SOTA
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
7
7DEPENDS = "aktualizr-native zip-native" 8DEPENDS = "aktualizr-native zip-native"
8RDEPENDS_${PN} = "aktualizr" 9RDEPENDS_${PN} = "aktualizr"
9PV = "1.0" 10PV = "1.0"
10PR = "6" 11PR = "6"
11 12
12SRC_URI = " \ 13SRC_URI = ""
13 file://LICENSE \
14 "
15 14
16require environment.inc 15require environment.inc
17require credentials.inc 16require credentials.inc
diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb
index e00d41a..83504f1 100644
--- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb
@@ -7,12 +7,11 @@ DESCRIPTION = "Configuration for implicitly provisioning Aktualizr using externa
7HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 7HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
8SECTION = "base" 8SECTION = "base"
9LICENSE = "MPL-2.0" 9LICENSE = "MPL-2.0"
10LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 10LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
11 11
12DEPENDS = "aktualizr aktualizr-native openssl-native" 12DEPENDS = "aktualizr aktualizr-native openssl-native"
13 13
14SRC_URI = " \ 14SRC_URI = " \
15 file://LICENSE \
16 file://ca.cnf \ 15 file://ca.cnf \
17 " 16 "
18PV = "1.0" 17PV = "1.0"
diff --git a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb
index ce92e9c..0450138 100644
--- a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb
@@ -3,13 +3,11 @@ DESCRIPTION = "Configuration for HSM provisioning with Aktualizr, the SOTA Clien
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
7 7
8DEPENDS = "aktualizr aktualizr-native" 8DEPENDS = "aktualizr aktualizr-native"
9 9
10SRC_URI = " \ 10SRC_URI = ""
11 file://LICENSE \
12 "
13PV = "1.0" 11PV = "1.0"
14PR = "6" 12PR = "6"
15 13
diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
index 6e5f338..5c54e8a 100644
--- a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
@@ -3,13 +3,11 @@ DESCRIPTION = "Configuration for implicitly provisioning Aktualizr, the SOTA Cli
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
7 7
8DEPENDS = "aktualizr aktualizr-native" 8DEPENDS = "aktualizr aktualizr-native"
9 9
10SRC_URI = " \ 10SRC_URI = ""
11 file://LICENSE \
12 "
13PV = "1.0" 11PV = "1.0"
14PR = "1" 12PR = "1"
15 13
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 3684372..9a0441f 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -26,7 +26,7 @@ SRC_URI = " \
26 file://aktualizr-secondary.socket \ 26 file://aktualizr-secondary.socket \
27 file://aktualizr-serialcan.service \ 27 file://aktualizr-serialcan.service \
28 " 28 "
29SRCREV = "41ffd4a967a15f9b4638573cda12bd9d4c260626" 29SRCREV = "9207f7534a03a09cbc1e8b9c414070210380cab1"
30BRANCH ?= "master" 30BRANCH ?= "master"
31 31
32S = "${WORKDIR}/git" 32S = "${WORKDIR}/git"
@@ -99,6 +99,7 @@ FILES_${PN}-examples = " \
99 ${libdir}/sota/demo_secondary.json \ 99 ${libdir}/sota/demo_secondary.json \
100 ${bindir}/example-interface \ 100 ${bindir}/example-interface \
101 ${bindir}/isotp-test-interface \ 101 ${bindir}/isotp-test-interface \
102 ${bindir}/hmi_stub \
102 " 103 "
103 104
104FILES_${PN}-host-tools = " \ 105FILES_${PN}-host-tools = " \
diff --git a/recipes-sota/aktualizr/files/LICENSE b/recipes-sota/aktualizr/files/LICENSE
deleted file mode 100644
index a612ad9..0000000
--- a/recipes-sota/aktualizr/files/LICENSE
+++ /dev/null
@@ -1,373 +0,0 @@
1Mozilla Public License Version 2.0
2==================================
3
41. Definitions
5--------------
6
71.1. "Contributor"
8 means each individual or legal entity that creates, contributes to
9 the creation of, or owns Covered Software.
10
111.2. "Contributor Version"
12 means the combination of the Contributions of others (if any) used
13 by a Contributor and that particular Contributor's Contribution.
14
151.3. "Contribution"
16 means Covered Software of a particular Contributor.
17
181.4. "Covered Software"
19 means Source Code Form to which the initial Contributor has attached
20 the notice in Exhibit A, the Executable Form of such Source Code
21 Form, and Modifications of such Source Code Form, in each case
22 including portions thereof.
23
241.5. "Incompatible With Secondary Licenses"
25 means
26
27 (a) that the initial Contributor has attached the notice described
28 in Exhibit B to the Covered Software; or
29
30 (b) that the Covered Software was made available under the terms of
31 version 1.1 or earlier of the License, but not also under the
32 terms of a Secondary License.
33
341.6. "Executable Form"
35 means any form of the work other than Source Code Form.
36
371.7. "Larger Work"
38 means a work that combines Covered Software with other material, in
39 a separate file or files, that is not Covered Software.
40
411.8. "License"
42 means this document.
43
441.9. "Licensable"
45 means having the right to grant, to the maximum extent possible,
46 whether at the time of the initial grant or subsequently, any and
47 all of the rights conveyed by this License.
48
491.10. "Modifications"
50 means any of the following:
51
52 (a) any file in Source Code Form that results from an addition to,
53 deletion from, or modification of the contents of Covered
54 Software; or
55
56 (b) any new file in Source Code Form that contains any Covered
57 Software.
58
591.11. "Patent Claims" of a Contributor
60 means any patent claim(s), including without limitation, method,
61 process, and apparatus claims, in any patent Licensable by such
62 Contributor that would be infringed, but for the grant of the
63 License, by the making, using, selling, offering for sale, having
64 made, import, or transfer of either its Contributions or its
65 Contributor Version.
66
671.12. "Secondary License"
68 means either the GNU General Public License, Version 2.0, the GNU
69 Lesser General Public License, Version 2.1, the GNU Affero General
70 Public License, Version 3.0, or any later versions of those
71 licenses.
72
731.13. "Source Code Form"
74 means the form of the work preferred for making modifications.
75
761.14. "You" (or "Your")
77 means an individual or a legal entity exercising rights under this
78 License. For legal entities, "You" includes any entity that
79 controls, is controlled by, or is under common control with You. For
80 purposes of this definition, "control" means (a) the power, direct
81 or indirect, to cause the direction or management of such entity,
82 whether by contract or otherwise, or (b) ownership of more than
83 fifty percent (50%) of the outstanding shares or beneficial
84 ownership of such entity.
85
862. License Grants and Conditions
87--------------------------------
88
892.1. Grants
90
91Each Contributor hereby grants You a world-wide, royalty-free,
92non-exclusive license:
93
94(a) under intellectual property rights (other than patent or trademark)
95 Licensable by such Contributor to use, reproduce, make available,
96 modify, display, perform, distribute, and otherwise exploit its
97 Contributions, either on an unmodified basis, with Modifications, or
98 as part of a Larger Work; and
99
100(b) under Patent Claims of such Contributor to make, use, sell, offer
101 for sale, have made, import, and otherwise transfer either its
102 Contributions or its Contributor Version.
103
1042.2. Effective Date
105
106The licenses granted in Section 2.1 with respect to any Contribution
107become effective for each Contribution on the date the Contributor first
108distributes such Contribution.
109
1102.3. Limitations on Grant Scope
111
112The licenses granted in this Section 2 are the only rights granted under
113this License. No additional rights or licenses will be implied from the
114distribution or licensing of Covered Software under this License.
115Notwithstanding Section 2.1(b) above, no patent license is granted by a
116Contributor:
117
118(a) for any code that a Contributor has removed from Covered Software;
119 or
120
121(b) for infringements caused by: (i) Your and any other third party's
122 modifications of Covered Software, or (ii) the combination of its
123 Contributions with other software (except as part of its Contributor
124 Version); or
125
126(c) under Patent Claims infringed by Covered Software in the absence of
127 its Contributions.
128
129This License does not grant any rights in the trademarks, service marks,
130or logos of any Contributor (except as may be necessary to comply with
131the notice requirements in Section 3.4).
132
1332.4. Subsequent Licenses
134
135No Contributor makes additional grants as a result of Your choice to
136distribute the Covered Software under a subsequent version of this
137License (see Section 10.2) or under the terms of a Secondary License (if
138permitted under the terms of Section 3.3).
139
1402.5. Representation
141
142Each Contributor represents that the Contributor believes its
143Contributions are its original creation(s) or it has sufficient rights
144to grant the rights to its Contributions conveyed by this License.
145
1462.6. Fair Use
147
148This License is not intended to limit any rights You have under
149applicable copyright doctrines of fair use, fair dealing, or other
150equivalents.
151
1522.7. Conditions
153
154Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155in Section 2.1.
156
1573. Responsibilities
158-------------------
159
1603.1. Distribution of Source Form
161
162All distribution of Covered Software in Source Code Form, including any
163Modifications that You create or to which You contribute, must be under
164the terms of this License. You must inform recipients that the Source
165Code Form of the Covered Software is governed by the terms of this
166License, and how they can obtain a copy of this License. You may not
167attempt to alter or restrict the recipients' rights in the Source Code
168Form.
169
1703.2. Distribution of Executable Form
171
172If You distribute Covered Software in Executable Form then:
173
174(a) such Covered Software must also be made available in Source Code
175 Form, as described in Section 3.1, and You must inform recipients of
176 the Executable Form how they can obtain a copy of such Source Code
177 Form by reasonable means in a timely manner, at a charge no more
178 than the cost of distribution to the recipient; and
179
180(b) You may distribute such Executable Form under the terms of this
181 License, or sublicense it under different terms, provided that the
182 license for the Executable Form does not attempt to limit or alter
183 the recipients' rights in the Source Code Form under this License.
184
1853.3. Distribution of a Larger Work
186
187You may create and distribute a Larger Work under terms of Your choice,
188provided that You also comply with the requirements of this License for
189the Covered Software. If the Larger Work is a combination of Covered
190Software with a work governed by one or more Secondary Licenses, and the
191Covered Software is not Incompatible With Secondary Licenses, this
192License permits You to additionally distribute such Covered Software
193under the terms of such Secondary License(s), so that the recipient of
194the Larger Work may, at their option, further distribute the Covered
195Software under the terms of either this License or such Secondary
196License(s).
197
1983.4. Notices
199
200You may not remove or alter the substance of any license notices
201(including copyright notices, patent notices, disclaimers of warranty,
202or limitations of liability) contained within the Source Code Form of
203the Covered Software, except that You may alter any license notices to
204the extent required to remedy known factual inaccuracies.
205
2063.5. Application of Additional Terms
207
208You may choose to offer, and to charge a fee for, warranty, support,
209indemnity or liability obligations to one or more recipients of Covered
210Software. However, You may do so only on Your own behalf, and not on
211behalf of any Contributor. You must make it absolutely clear that any
212such warranty, support, indemnity, or liability obligation is offered by
213You alone, and You hereby agree to indemnify every Contributor for any
214liability incurred by such Contributor as a result of warranty, support,
215indemnity or liability terms You offer. You may include additional
216disclaimers of warranty and limitations of liability specific to any
217jurisdiction.
218
2194. Inability to Comply Due to Statute or Regulation
220---------------------------------------------------
221
222If it is impossible for You to comply with any of the terms of this
223License with respect to some or all of the Covered Software due to
224statute, judicial order, or regulation then You must: (a) comply with
225the terms of this License to the maximum extent possible; and (b)
226describe the limitations and the code they affect. Such description must
227be placed in a text file included with all distributions of the Covered
228Software under this License. Except to the extent prohibited by statute
229or regulation, such description must be sufficiently detailed for a
230recipient of ordinary skill to be able to understand it.
231
2325. Termination
233--------------
234
2355.1. The rights granted under this License will terminate automatically
236if You fail to comply with any of its terms. However, if You become
237compliant, then the rights granted under this License from a particular
238Contributor are reinstated (a) provisionally, unless and until such
239Contributor explicitly and finally terminates Your grants, and (b) on an
240ongoing basis, if such Contributor fails to notify You of the
241non-compliance by some reasonable means prior to 60 days after You have
242come back into compliance. Moreover, Your grants from a particular
243Contributor are reinstated on an ongoing basis if such Contributor
244notifies You of the non-compliance by some reasonable means, this is the
245first time You have received notice of non-compliance with this License
246from such Contributor, and You become compliant prior to 30 days after
247Your receipt of the notice.
248
2495.2. If You initiate litigation against any entity by asserting a patent
250infringement claim (excluding declaratory judgment actions,
251counter-claims, and cross-claims) alleging that a Contributor Version
252directly or indirectly infringes any patent, then the rights granted to
253You by any and all Contributors for the Covered Software under Section
2542.1 of this License shall terminate.
255
2565.3. In the event of termination under Sections 5.1 or 5.2 above, all
257end user license agreements (excluding distributors and resellers) which
258have been validly granted by You or Your distributors under this License
259prior to termination shall survive termination.
260
261************************************************************************
262* *
263* 6. Disclaimer of Warranty *
264* ------------------------- *
265* *
266* Covered Software is provided under this License on an "as is" *
267* basis, without warranty of any kind, either expressed, implied, or *
268* statutory, including, without limitation, warranties that the *
269* Covered Software is free of defects, merchantable, fit for a *
270* particular purpose or non-infringing. The entire risk as to the *
271* quality and performance of the Covered Software is with You. *
272* Should any Covered Software prove defective in any respect, You *
273* (not any Contributor) assume the cost of any necessary servicing, *
274* repair, or correction. This disclaimer of warranty constitutes an *
275* essential part of this License. No use of any Covered Software is *
276* authorized under this License except under this disclaimer. *
277* *
278************************************************************************
279
280************************************************************************
281* *
282* 7. Limitation of Liability *
283* -------------------------- *
284* *
285* Under no circumstances and under no legal theory, whether tort *
286* (including negligence), contract, or otherwise, shall any *
287* Contributor, or anyone who distributes Covered Software as *
288* permitted above, be liable to You for any direct, indirect, *
289* special, incidental, or consequential damages of any character *
290* including, without limitation, damages for lost profits, loss of *
291* goodwill, work stoppage, computer failure or malfunction, or any *
292* and all other commercial damages or losses, even if such party *
293* shall have been informed of the possibility of such damages. This *
294* limitation of liability shall not apply to liability for death or *
295* personal injury resulting from such party's negligence to the *
296* extent applicable law prohibits such limitation. Some *
297* jurisdictions do not allow the exclusion or limitation of *
298* incidental or consequential damages, so this exclusion and *
299* limitation may not apply to You. *
300* *
301************************************************************************
302
3038. Litigation
304-------------
305
306Any litigation relating to this License may be brought only in the
307courts of a jurisdiction where the defendant maintains its principal
308place of business and such litigation shall be governed by laws of that
309jurisdiction, without reference to its conflict-of-law provisions.
310Nothing in this Section shall prevent a party's ability to bring
311cross-claims or counter-claims.
312
3139. Miscellaneous
314----------------
315
316This License represents the complete agreement concerning the subject
317matter hereof. If any provision of this License is held to be
318unenforceable, such provision shall be reformed only to the extent
319necessary to make it enforceable. Any law or regulation which provides
320that the language of a contract shall be construed against the drafter
321shall not be used to construe this License against a Contributor.
322
32310. Versions of the License
324---------------------------
325
32610.1. New Versions
327
328Mozilla Foundation is the license steward. Except as provided in Section
32910.3, no one other than the license steward has the right to modify or
330publish new versions of this License. Each version will be given a
331distinguishing version number.
332
33310.2. Effect of New Versions
334
335You may distribute the Covered Software under the terms of the version
336of the License under which You originally received the Covered Software,
337or under the terms of any subsequent version published by the license
338steward.
339
34010.3. Modified Versions
341
342If you create software not governed by this License, and you want to
343create a new license for such software, you may create and use a
344modified version of this License if you rename the license and remove
345any references to the name of the license steward (except to note that
346such modified license differs from this License).
347
34810.4. Distributing Source Code Form that is Incompatible With Secondary
349Licenses
350
351If You choose to distribute Source Code Form that is Incompatible With
352Secondary Licenses under the terms of this version of the License, the
353notice described in Exhibit B of this License must be attached.
354
355Exhibit A - Source Code Form License Notice
356-------------------------------------------
357
358 This Source Code Form is subject to the terms of the Mozilla Public
359 License, v. 2.0. If a copy of the MPL was not distributed with this
360 file, You can obtain one at http://mozilla.org/MPL/2.0/.
361
362If it is not possible or desirable to put the notice in a particular
363file, then You may include the notice in a location (such as a LICENSE
364file in a relevant directory) where a recipient would be likely to look
365for such a notice.
366
367You may add additional accurate notices of copyright ownership.
368
369Exhibit B - "Incompatible With Secondary Licenses" Notice
370---------------------------------------------------------
371
372 This Source Code Form is "Incompatible With Secondary Licenses", as
373 defined by the Mozilla Public License, v. 2.0.
diff --git a/recipes-sota/aktualizr/garage-sign-version.inc b/recipes-sota/aktualizr/garage-sign-version.inc
index f2d04e8..1b89a3d 100644
--- a/recipes-sota/aktualizr/garage-sign-version.inc
+++ b/recipes-sota/aktualizr/garage-sign-version.inc
@@ -11,8 +11,21 @@ python () {
11 url = url_file.read().decode().strip(' \t\n') + '/health/version' 11 url = url_file.read().decode().strip(' \t\n') + '/health/version'
12 except (KeyError, ValueError, RuntimeError): 12 except (KeyError, ValueError, RuntimeError):
13 return 13 return
14 r = urllib.request.urlopen(url) 14 connected = False
15 if r.code != 200: 15 tries = 3
16 for i in range(tries):
17 try:
18 r = urllib.request.urlopen(url)
19 if r.code == 200:
20 connected = True
21 break
22 else:
23 print('Bad return code from server ' + url + ': ' + str(r.code) +
24 ' (attempt ' + str(i + 1) + ' of ' + str(tries) + ')')
25 except urllib.error.URLError as e:
26 print('Error connecting to server ' + url + ': ' + str(e) +
27 ' (attempt ' + str(i + 1) + ' of ' + str(tries) + ')')
28 if not connected:
16 return 29 return
17 resp = r.read().decode('utf-8') 30 resp = r.read().decode('utf-8')
18 j = json.loads(resp) 31 j = json.loads(resp)
diff --git a/recipes-sota/config/aktualizr-disable-send-ip.bb b/recipes-sota/config/aktualizr-disable-send-ip.bb
index cab7696..8dd2647 100644
--- a/recipes-sota/config/aktualizr-disable-send-ip.bb
+++ b/recipes-sota/config/aktualizr-disable-send-ip.bb
@@ -3,10 +3,9 @@ DESCRIPTION = "Configures aktualizr to disable IP reporting to the server"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
7 7
8SRC_URI = " \ 8SRC_URI = " \
9 file://LICENSE \
10 file://30-disable-send-ip.toml \ 9 file://30-disable-send-ip.toml \
11 " 10 "
12 11
diff --git a/recipes-sota/config/aktualizr-example-interface.bb b/recipes-sota/config/aktualizr-example-interface.bb
index 37a9184..ac75352 100644
--- a/recipes-sota/config/aktualizr-example-interface.bb
+++ b/recipes-sota/config/aktualizr-example-interface.bb
@@ -3,10 +3,9 @@ DESCRIPTION = "Aktualizr example interface for legacy secondaries"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
7 7
8SRC_URI = " \ 8SRC_URI = " \
9 file://LICENSE \
10 file://30-example-interface.toml \ 9 file://30-example-interface.toml \
11 " 10 "
12 11
diff --git a/recipes-sota/config/aktualizr-log-debug.bb b/recipes-sota/config/aktualizr-log-debug.bb
index e628616..098faf4 100644
--- a/recipes-sota/config/aktualizr-log-debug.bb
+++ b/recipes-sota/config/aktualizr-log-debug.bb
@@ -3,10 +3,9 @@ DESCRIPTION = "Configures aktualizr to log at a debugging level"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
7 7
8SRC_URI = " \ 8SRC_URI = " \
9 file://LICENSE \
10 file://05-log-debug.toml \ 9 file://05-log-debug.toml \
11 " 10 "
12 11
diff --git a/recipes-sota/config/files/LICENSE b/recipes-sota/config/files/LICENSE
deleted file mode 100644
index a612ad9..0000000
--- a/recipes-sota/config/files/LICENSE
+++ /dev/null
@@ -1,373 +0,0 @@
1Mozilla Public License Version 2.0
2==================================
3
41. Definitions
5--------------
6
71.1. "Contributor"
8 means each individual or legal entity that creates, contributes to
9 the creation of, or owns Covered Software.
10
111.2. "Contributor Version"
12 means the combination of the Contributions of others (if any) used
13 by a Contributor and that particular Contributor's Contribution.
14
151.3. "Contribution"
16 means Covered Software of a particular Contributor.
17
181.4. "Covered Software"
19 means Source Code Form to which the initial Contributor has attached
20 the notice in Exhibit A, the Executable Form of such Source Code
21 Form, and Modifications of such Source Code Form, in each case
22 including portions thereof.
23
241.5. "Incompatible With Secondary Licenses"
25 means
26
27 (a) that the initial Contributor has attached the notice described
28 in Exhibit B to the Covered Software; or
29
30 (b) that the Covered Software was made available under the terms of
31 version 1.1 or earlier of the License, but not also under the
32 terms of a Secondary License.
33
341.6. "Executable Form"
35 means any form of the work other than Source Code Form.
36
371.7. "Larger Work"
38 means a work that combines Covered Software with other material, in
39 a separate file or files, that is not Covered Software.
40
411.8. "License"
42 means this document.
43
441.9. "Licensable"
45 means having the right to grant, to the maximum extent possible,
46 whether at the time of the initial grant or subsequently, any and
47 all of the rights conveyed by this License.
48
491.10. "Modifications"
50 means any of the following:
51
52 (a) any file in Source Code Form that results from an addition to,
53 deletion from, or modification of the contents of Covered
54 Software; or
55
56 (b) any new file in Source Code Form that contains any Covered
57 Software.
58
591.11. "Patent Claims" of a Contributor
60 means any patent claim(s), including without limitation, method,
61 process, and apparatus claims, in any patent Licensable by such
62 Contributor that would be infringed, but for the grant of the
63 License, by the making, using, selling, offering for sale, having
64 made, import, or transfer of either its Contributions or its
65 Contributor Version.
66
671.12. "Secondary License"
68 means either the GNU General Public License, Version 2.0, the GNU
69 Lesser General Public License, Version 2.1, the GNU Affero General
70 Public License, Version 3.0, or any later versions of those
71 licenses.
72
731.13. "Source Code Form"
74 means the form of the work preferred for making modifications.
75
761.14. "You" (or "Your")
77 means an individual or a legal entity exercising rights under this
78 License. For legal entities, "You" includes any entity that
79 controls, is controlled by, or is under common control with You. For
80 purposes of this definition, "control" means (a) the power, direct
81 or indirect, to cause the direction or management of such entity,
82 whether by contract or otherwise, or (b) ownership of more than
83 fifty percent (50%) of the outstanding shares or beneficial
84 ownership of such entity.
85
862. License Grants and Conditions
87--------------------------------
88
892.1. Grants
90
91Each Contributor hereby grants You a world-wide, royalty-free,
92non-exclusive license:
93
94(a) under intellectual property rights (other than patent or trademark)
95 Licensable by such Contributor to use, reproduce, make available,
96 modify, display, perform, distribute, and otherwise exploit its
97 Contributions, either on an unmodified basis, with Modifications, or
98 as part of a Larger Work; and
99
100(b) under Patent Claims of such Contributor to make, use, sell, offer
101 for sale, have made, import, and otherwise transfer either its
102 Contributions or its Contributor Version.
103
1042.2. Effective Date
105
106The licenses granted in Section 2.1 with respect to any Contribution
107become effective for each Contribution on the date the Contributor first
108distributes such Contribution.
109
1102.3. Limitations on Grant Scope
111
112The licenses granted in this Section 2 are the only rights granted under
113this License. No additional rights or licenses will be implied from the
114distribution or licensing of Covered Software under this License.
115Notwithstanding Section 2.1(b) above, no patent license is granted by a
116Contributor:
117
118(a) for any code that a Contributor has removed from Covered Software;
119 or
120
121(b) for infringements caused by: (i) Your and any other third party's
122 modifications of Covered Software, or (ii) the combination of its
123 Contributions with other software (except as part of its Contributor
124 Version); or
125
126(c) under Patent Claims infringed by Covered Software in the absence of
127 its Contributions.
128
129This License does not grant any rights in the trademarks, service marks,
130or logos of any Contributor (except as may be necessary to comply with
131the notice requirements in Section 3.4).
132
1332.4. Subsequent Licenses
134
135No Contributor makes additional grants as a result of Your choice to
136distribute the Covered Software under a subsequent version of this
137License (see Section 10.2) or under the terms of a Secondary License (if
138permitted under the terms of Section 3.3).
139
1402.5. Representation
141
142Each Contributor represents that the Contributor believes its
143Contributions are its original creation(s) or it has sufficient rights
144to grant the rights to its Contributions conveyed by this License.
145
1462.6. Fair Use
147
148This License is not intended to limit any rights You have under
149applicable copyright doctrines of fair use, fair dealing, or other
150equivalents.
151
1522.7. Conditions
153
154Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
155in Section 2.1.
156
1573. Responsibilities
158-------------------
159
1603.1. Distribution of Source Form
161
162All distribution of Covered Software in Source Code Form, including any
163Modifications that You create or to which You contribute, must be under
164the terms of this License. You must inform recipients that the Source
165Code Form of the Covered Software is governed by the terms of this
166License, and how they can obtain a copy of this License. You may not
167attempt to alter or restrict the recipients' rights in the Source Code
168Form.
169
1703.2. Distribution of Executable Form
171
172If You distribute Covered Software in Executable Form then:
173
174(a) such Covered Software must also be made available in Source Code
175 Form, as described in Section 3.1, and You must inform recipients of
176 the Executable Form how they can obtain a copy of such Source Code
177 Form by reasonable means in a timely manner, at a charge no more
178 than the cost of distribution to the recipient; and
179
180(b) You may distribute such Executable Form under the terms of this
181 License, or sublicense it under different terms, provided that the
182 license for the Executable Form does not attempt to limit or alter
183 the recipients' rights in the Source Code Form under this License.
184
1853.3. Distribution of a Larger Work
186
187You may create and distribute a Larger Work under terms of Your choice,
188provided that You also comply with the requirements of this License for
189the Covered Software. If the Larger Work is a combination of Covered
190Software with a work governed by one or more Secondary Licenses, and the
191Covered Software is not Incompatible With Secondary Licenses, this
192License permits You to additionally distribute such Covered Software
193under the terms of such Secondary License(s), so that the recipient of
194the Larger Work may, at their option, further distribute the Covered
195Software under the terms of either this License or such Secondary
196License(s).
197
1983.4. Notices
199
200You may not remove or alter the substance of any license notices
201(including copyright notices, patent notices, disclaimers of warranty,
202or limitations of liability) contained within the Source Code Form of
203the Covered Software, except that You may alter any license notices to
204the extent required to remedy known factual inaccuracies.
205
2063.5. Application of Additional Terms
207
208You may choose to offer, and to charge a fee for, warranty, support,
209indemnity or liability obligations to one or more recipients of Covered
210Software. However, You may do so only on Your own behalf, and not on
211behalf of any Contributor. You must make it absolutely clear that any
212such warranty, support, indemnity, or liability obligation is offered by
213You alone, and You hereby agree to indemnify every Contributor for any
214liability incurred by such Contributor as a result of warranty, support,
215indemnity or liability terms You offer. You may include additional
216disclaimers of warranty and limitations of liability specific to any
217jurisdiction.
218
2194. Inability to Comply Due to Statute or Regulation
220---------------------------------------------------
221
222If it is impossible for You to comply with any of the terms of this
223License with respect to some or all of the Covered Software due to
224statute, judicial order, or regulation then You must: (a) comply with
225the terms of this License to the maximum extent possible; and (b)
226describe the limitations and the code they affect. Such description must
227be placed in a text file included with all distributions of the Covered
228Software under this License. Except to the extent prohibited by statute
229or regulation, such description must be sufficiently detailed for a
230recipient of ordinary skill to be able to understand it.
231
2325. Termination
233--------------
234
2355.1. The rights granted under this License will terminate automatically
236if You fail to comply with any of its terms. However, if You become
237compliant, then the rights granted under this License from a particular
238Contributor are reinstated (a) provisionally, unless and until such
239Contributor explicitly and finally terminates Your grants, and (b) on an
240ongoing basis, if such Contributor fails to notify You of the
241non-compliance by some reasonable means prior to 60 days after You have
242come back into compliance. Moreover, Your grants from a particular
243Contributor are reinstated on an ongoing basis if such Contributor
244notifies You of the non-compliance by some reasonable means, this is the
245first time You have received notice of non-compliance with this License
246from such Contributor, and You become compliant prior to 30 days after
247Your receipt of the notice.
248
2495.2. If You initiate litigation against any entity by asserting a patent
250infringement claim (excluding declaratory judgment actions,
251counter-claims, and cross-claims) alleging that a Contributor Version
252directly or indirectly infringes any patent, then the rights granted to
253You by any and all Contributors for the Covered Software under Section
2542.1 of this License shall terminate.
255
2565.3. In the event of termination under Sections 5.1 or 5.2 above, all
257end user license agreements (excluding distributors and resellers) which
258have been validly granted by You or Your distributors under this License
259prior to termination shall survive termination.
260
261************************************************************************
262* *
263* 6. Disclaimer of Warranty *
264* ------------------------- *
265* *
266* Covered Software is provided under this License on an "as is" *
267* basis, without warranty of any kind, either expressed, implied, or *
268* statutory, including, without limitation, warranties that the *
269* Covered Software is free of defects, merchantable, fit for a *
270* particular purpose or non-infringing. The entire risk as to the *
271* quality and performance of the Covered Software is with You. *
272* Should any Covered Software prove defective in any respect, You *
273* (not any Contributor) assume the cost of any necessary servicing, *
274* repair, or correction. This disclaimer of warranty constitutes an *
275* essential part of this License. No use of any Covered Software is *
276* authorized under this License except under this disclaimer. *
277* *
278************************************************************************
279
280************************************************************************
281* *
282* 7. Limitation of Liability *
283* -------------------------- *
284* *
285* Under no circumstances and under no legal theory, whether tort *
286* (including negligence), contract, or otherwise, shall any *
287* Contributor, or anyone who distributes Covered Software as *
288* permitted above, be liable to You for any direct, indirect, *
289* special, incidental, or consequential damages of any character *
290* including, without limitation, damages for lost profits, loss of *
291* goodwill, work stoppage, computer failure or malfunction, or any *
292* and all other commercial damages or losses, even if such party *
293* shall have been informed of the possibility of such damages. This *
294* limitation of liability shall not apply to liability for death or *
295* personal injury resulting from such party's negligence to the *
296* extent applicable law prohibits such limitation. Some *
297* jurisdictions do not allow the exclusion or limitation of *
298* incidental or consequential damages, so this exclusion and *
299* limitation may not apply to You. *
300* *
301************************************************************************
302
3038. Litigation
304-------------
305
306Any litigation relating to this License may be brought only in the
307courts of a jurisdiction where the defendant maintains its principal
308place of business and such litigation shall be governed by laws of that
309jurisdiction, without reference to its conflict-of-law provisions.
310Nothing in this Section shall prevent a party's ability to bring
311cross-claims or counter-claims.
312
3139. Miscellaneous
314----------------
315
316This License represents the complete agreement concerning the subject
317matter hereof. If any provision of this License is held to be
318unenforceable, such provision shall be reformed only to the extent
319necessary to make it enforceable. Any law or regulation which provides
320that the language of a contract shall be construed against the drafter
321shall not be used to construe this License against a Contributor.
322
32310. Versions of the License
324---------------------------
325
32610.1. New Versions
327
328Mozilla Foundation is the license steward. Except as provided in Section
32910.3, no one other than the license steward has the right to modify or
330publish new versions of this License. Each version will be given a
331distinguishing version number.
332
33310.2. Effect of New Versions
334
335You may distribute the Covered Software under the terms of the version
336of the License under which You originally received the Covered Software,
337or under the terms of any subsequent version published by the license
338steward.
339
34010.3. Modified Versions
341
342If you create software not governed by this License, and you want to
343create a new license for such software, you may create and use a
344modified version of this License if you rename the license and remove
345any references to the name of the license steward (except to note that
346such modified license differs from this License).
347
34810.4. Distributing Source Code Form that is Incompatible With Secondary
349Licenses
350
351If You choose to distribute Source Code Form that is Incompatible With
352Secondary Licenses under the terms of this version of the License, the
353notice described in Exhibit B of this License must be attached.
354
355Exhibit A - Source Code Form License Notice
356-------------------------------------------
357
358 This Source Code Form is subject to the terms of the Mozilla Public
359 License, v. 2.0. If a copy of the MPL was not distributed with this
360 file, You can obtain one at http://mozilla.org/MPL/2.0/.
361
362If it is not possible or desirable to put the notice in a particular
363file, then You may include the notice in a location (such as a LICENSE
364file in a relevant directory) where a recipient would be likely to look
365for such a notice.
366
367You may add additional accurate notices of copyright ownership.
368
369Exhibit B - "Incompatible With Secondary Licenses" Notice
370---------------------------------------------------------
371
372 This Source Code Form is "Incompatible With Secondary Licenses", as
373 defined by the Mozilla Public License, v. 2.0.
diff --git a/recipes-support/softhsm-testtoken/files/createtoken.sh b/recipes-support/softhsm-testtoken/files/createtoken.sh
index b01db47..7b16f4e 100644
--- a/recipes-support/softhsm-testtoken/files/createtoken.sh
+++ b/recipes-support/softhsm-testtoken/files/createtoken.sh
@@ -5,7 +5,7 @@ if pkcs11-tool --module=/usr/lib/softhsm/libsofthsm2.so -O; then
5 exit 0 5 exit 0
6fi 6fi
7 7
8if ! ls /var/sota/token/pkey.pem /var/sota/token/client.pem /var/sota/token/pkey.pem; then 8if ! ls /var/sota/token/pkey.pem /var/sota/token/client.pem; then
9 # Key/certificate pair is not present, repeat 9 # Key/certificate pair is not present, repeat
10 exit 1 10 exit 1
11fi 11fi
diff --git a/recipes-support/softhsm-testtoken/softhsm-testtoken.bb b/recipes-support/softhsm-testtoken/softhsm-testtoken.bb
index c5691db..029fe1c 100644
--- a/recipes-support/softhsm-testtoken/softhsm-testtoken.bb
+++ b/recipes-support/softhsm-testtoken/softhsm-testtoken.bb
@@ -1,8 +1,6 @@
1SUMMARY = "Mock smartcard for aktualizr" 1SUMMARY = "Mock smartcard for aktualizr"
2LICENSE = "MIT" 2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ 3LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
4 file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
5
6 4
7inherit systemd 5inherit systemd
8 6
diff --git a/scripts/find_aktualizr_dependencies.sh b/scripts/find_aktualizr_dependencies.sh
new file mode 100755
index 0000000..786d8a9
--- /dev/null
+++ b/scripts/find_aktualizr_dependencies.sh
@@ -0,0 +1,23 @@
1#!/bin/bash
2set -euo pipefail
3
4parentdir="$(dirname "$0")"
5
6# Does NOT include garage-sign, anything used only for testing (i.e. strace and
7# gtest), any of the git submodules, all of which are also only used for
8# testing (tuf-test-vectors, isotp-c, ostreesysroot, and HdrHistogram_c), or
9# any other third party modules included directly into the source tree
10# (jsoncpp, open62541, picojson). Also check libp11, dpkg, and systemd since
11# those are common dependencies not enabled by default.
12${parentdir}/find_dependencies.py aktualizr
13${parentdir}/find_dependencies.py aktualizr-auto-prov
14${parentdir}/find_dependencies.py aktualizr-implicit-prov
15${parentdir}/find_dependencies.py aktualizr-ca-implicit-prov
16${parentdir}/find_dependencies.py aktualizr-hsm-prov
17${parentdir}/find_dependencies.py aktualizr-disable-send-ip
18${parentdir}/find_dependencies.py aktualizr-example-interface
19${parentdir}/find_dependencies.py aktualizr-log-debug
20${parentdir}/find_dependencies.py libp11
21${parentdir}/find_dependencies.py dpkg
22${parentdir}/find_dependencies.py systemd
23
diff --git a/scripts/find_dependencies.py b/scripts/find_dependencies.py
new file mode 100755
index 0000000..cffe32b
--- /dev/null
+++ b/scripts/find_dependencies.py
@@ -0,0 +1,214 @@
1#!/usr/bin/env python3
2
3from argparse import ArgumentParser
4import os.path
5import sys
6
7scripts_path = os.path.dirname(os.path.realpath(__file__))
8bb_lib_path = os.path.abspath(scripts_path + '/../../poky/bitbake/lib')
9sys.path = sys.path + [bb_lib_path]
10
11import bb.fetch2
12import bb.tinfoil
13
14
15PRINT_PROGRESS = True
16SKIP_BUILD_TOOLS = True
17KNOWN_BUILD_TOOLS = ['virtual/x86_64-poky-linux-gcc', # gcc-cross-x86_64
18 'virtual/x86_64-poky-linux-compilerlibs', # gcc-runtime
19 'virtual/i586-poky-linux-gcc', # gcc-cross-i586
20 'virtual/i586-poky-linux-compilerlibs', # gcc-runtime
21 'virtual/libc', # glibc
22 'virtual/libintl', # glibc
23 'virtual/libiconv', # glibc
24 'virtual/crypt', # glibc
25 'autoconf-native',
26 'automake-native',
27 'libtool-native',
28 'gnu-config-native',
29 'm4-native',
30 'texinfo-dummy-native',
31 'gettext-minimal-native',
32 'libtool-cross',
33 'gettext-native',
34 'util-linux-native',
35 'pkgconfig-native',
36 'makedepend-native']
37
38
39def get_recipe_info(tinfoil, rn):
40 try:
41 info = tinfoil.get_recipe_info(rn)
42 except Exception:
43 print('Failed to get recipe info for: %s' % rn)
44 return []
45 if not info:
46 print('No recipe info found for: %s' % rn)
47 return []
48 append_files = tinfoil.get_file_appends(info.fn)
49 appends = True
50 data = tinfoil.parse_recipe_file(info.fn, appends, append_files)
51 data.pn = info.pn
52 data.pv = info.pv
53 return data
54
55
56def print_package(manifest_file, data, is_project):
57 src_uri = data.getVar('SRC_URI').split()
58 lic = data.getVar('LICENSE')
59 summary = data.getVar('SUMMARY')
60 homepage = data.getVar('HOMEPAGE')
61 srcrev = data.getVar('SRCREV')
62 branch = data.getVar('BRANCH')
63
64 if is_project:
65 manifest_file.write(' id:\n')
66 else:
67 manifest_file.write('- id:\n')
68 manifest_file.write(' package_manager: "Yocto"\n')
69 manifest_file.write(' namespace: ""\n')
70 manifest_file.write(' name: "%s"\n' % data.pn)
71 manifest_file.write(' version: "%s"\n' % data.pv)
72 manifest_file.write(' declared_lics:\n')
73 manifest_file.write(' - "%s"\n' % lic)
74 if is_project:
75 manifest_file.write(' aliases: []\n')
76 if summary:
77 manifest_file.write(' description: "%s"\n' % summary)
78 else:
79 description = data.getVar('DESCRIPTION')
80 manifest_file.write(' description: "%s"\n' % description)
81 manifest_file.write(' homepage_url: "%s"\n' % homepage)
82 # Binary artifacts almost never exist in Yocto.
83 manifest_file.write(' binary_artifact:\n')
84 manifest_file.write(' url: ""\n')
85 manifest_file.write(' hash: ""\n')
86 manifest_file.write(' hash_algorithm: ""\n')
87 manifest_file.write(' source_artifact:\n')
88 repos = []
89 for src in src_uri:
90 # Strip options.
91 # TODO: ignore files with apply=false?
92 src = src.split(';', maxsplit=1)[0]
93 src_type = src.split('://', maxsplit=1)[0]
94 if src_type == 'file':
95 # TODO: Get full path of patches and other files within the source
96 # repo, not just the filesystem?
97 fetch = bb.fetch2.Fetch([], data)
98 local = fetch.localpath(src)
99 manifest_file.write(' - "%s"\n' % local)
100 else:
101 manifest_file.write(' - "%s"\n' % src)
102 if src_type != 'http' and src_type != 'https' and src_type != 'ftp' and src_type != 'ssh':
103 repos.append(src)
104 if len(repos) > 1:
105 print('Multiple repos for one package are not supported. Package: %s' % info.pn)
106 for repo in repos:
107 vcs_type, url = repo.split('://', maxsplit=1)
108 manifest_file.write(' vcs:\n')
109 if vcs_type == 'gitsm':
110 vcs_type = 'git'
111 manifest_file.write(' type: "%s"\n' % vcs_type)
112 manifest_file.write(' url: "%s"\n' % url)
113 # TODO: Actually support multiple repos here:
114 # TODO: catch and replace AUTOINC?
115 manifest_file.write(' revision: "%s"\n' % srcrev)
116 manifest_file.write(' branch: "%s"\n' % branch)
117
118
119def find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, packages, rn, order):
120 data = recipe_info[rn]
121 # Filter out packages from the assume_provided list.
122 depends = []
123 for dep in data.depends:
124 if dep not in assume_provided:
125 depends.append(dep)
126
127 if PRINT_PROGRESS:
128 # Print high-order dependencies as a form of logging/progress notifcation.
129 if order == 2:
130 print(rn)
131 if order == 3:
132 print(' ' + rn)
133
134 # order == 1 is for the initial recipe. We've already printed its
135 # information, so skip it.
136 if order > 1:
137 spaces = ' ' * order
138 manifest_file.write('%s- namespace: ""\n' % spaces)
139 manifest_file.write('%s name: "%s"\n' % (spaces, data.pn))
140 manifest_file.write('%s version: "%s"\n' % (spaces, data.pv))
141 if not depends:
142 manifest_file.write('%s dependencies: []\n' % spaces)
143 else:
144 manifest_file.write('%s dependencies:\n' % spaces)
145
146 # First find all dependencies not seen yet to our master list.
147 for dep in depends:
148 if dep not in packages:
149 packages.append(dep)
150 dep_data = get_recipe_info(tinfoil, dep)
151 # Do this once now to reduce the number of bitbake calls.
152 dep_data.depends = dep_data.getVar('DEPENDS').split()
153 recipe_info[dep] = dep_data
154
155 # Then recursively analyze all of the dependencies for the current recipe.
156 for dep in depends:
157 find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, packages, dep, order + 1)
158
159 if order > 1:
160 manifest_file.write('%s errors: []\n' % spaces)
161
162
163def main():
164 parser = ArgumentParser(description='Find all dependencies of a recipe.')
165 parser.add_argument('recipe', metavar='recipe', help='a recipe to investigate')
166 args = parser.parse_args()
167 rn = args.recipe
168 with bb.tinfoil.Tinfoil() as tinfoil:
169 tinfoil.prepare()
170 # These are the packages that bitbake assumes are provided by the host
171 # system. They do not have recipes, so searching tinfoil for them will
172 # not work. Anyway, by nature they are only build tools and will not be
173 # distributed in an image.
174 assume_provided = tinfoil.config_data.getVar('ASSUME_PROVIDED').split()
175 if SKIP_BUILD_TOOLS:
176 assume_provided.extend(KNOWN_BUILD_TOOLS)
177
178 data = get_recipe_info(tinfoil, rn)
179 if not data:
180 print('Nothing to do!')
181 return
182
183 with open(rn + '-dependencies.yml', "w") as manifest_file:
184 manifest_file.write('project:\n')
185 data.depends = []
186 depends = data.getVar('DEPENDS').split()
187 for dep in depends:
188 if dep not in assume_provided:
189 data.depends.append(dep)
190 print_package(manifest_file, data, is_project=True)
191 manifest_file.write(' scopes:\n')
192 manifest_file.write(' - name: "all"\n')
193 manifest_file.write(' delivered: true\n')
194 if not data.depends:
195 manifest_file.write(' dependencies: []\n')
196 else:
197 manifest_file.write(' dependencies:\n')
198
199 recipe_info = dict([(rn, data)])
200 packages = []
201 find_dependencies(manifest_file, tinfoil, assume_provided, recipe_info, packages, rn, order=1)
202
203 manifest_file.write('packages:\n')
204
205 # Iterate through the list of packages found to print out their full
206 # information. Skip the initial recipe since we already printed it out.
207 for p in packages:
208 if p is not rn:
209 data = recipe_info[p]
210 print_package(manifest_file, data, is_project=False)
211
212
213if __name__ == "__main__":
214 main()
diff --git a/scripts/find_packages.py b/scripts/find_packages.py
deleted file mode 100755
index 7a60a17..0000000
--- a/scripts/find_packages.py
+++ /dev/null
@@ -1,125 +0,0 @@
1#!/usr/bin/env python3
2
3import os.path
4import sys
5
6scripts_path = os.path.dirname(os.path.realpath(__file__))
7bb_lib_path = os.path.abspath(scripts_path + '/../../poky/bitbake/lib')
8sys.path = sys.path + [bb_lib_path]
9
10import bb.fetch2
11import bb.tinfoil
12
13
14def print_deps(tinfoil, abcd_file, rn):
15 try:
16 info = tinfoil.get_recipe_info(rn)
17 except Exception:
18 print('Failed to get recipe info for: %s' % rn)
19 return []
20 if not info:
21 print('No recipe info found for: %s' % rn)
22 return []
23 append_files = tinfoil.get_file_appends(info.fn)
24 appends = True
25 data = tinfoil.parse_recipe_file(info.fn, appends, append_files)
26 src_uri = data.getVar('SRC_URI').split()
27 lic = data.getVar('LICENSE')
28 summary = data.getVar('SUMMARY')
29 description = data.getVar('DESCRIPTION')
30 homepage = data.getVar('HOMEPAGE')
31 srcrev = data.getVar('SRCREV')
32 branch = data.getVar('BRANCH')
33 depends = data.getVar('DEPENDS').split()
34
35 abcd_file.write('- id:\n')
36 abcd_file.write(' package_manager: "Yocto"\n')
37 abcd_file.write(' name: "%s"\n' % info.pn)
38 abcd_file.write(' version: "%s"\n' % info.pv)
39 abcd_file.write(' declared_lics:\n')
40 abcd_file.write(' - "%s"\n' % lic)
41 if summary:
42 abcd_file.write(' description: "%s"\n' % summary)
43 else:
44 abcd_file.write(' description: "%s"\n' % description)
45 abcd_file.write(' homepage_url: "%s"\n' % homepage)
46 abcd_file.write(' source_artifact:\n')
47 repos = []
48 for src in src_uri:
49 # Strip options.
50 # TODO: ignore files with apply=false?
51 src = src.split(';', maxsplit=1)[0]
52 src_type = src.split('://', maxsplit=1)[0]
53 if src_type == 'file':
54 # TODO: Get full path of patches and other files within the source
55 # repo, not just the filesystem?
56 fetch = bb.fetch2.Fetch([], data)
57 local = fetch.localpath(src)
58 abcd_file.write(' - "%s"\n' % local)
59 else:
60 abcd_file.write(' - "%s"\n' % src)
61 if src_type != 'http' and src_type != 'https' and src_type != 'ftp' and src_type != 'ssh':
62 repos.append(src)
63 if len(repos) > 1:
64 print('Multiple repos not fully supported yet. Pacakge: %s' % info.pn)
65 for repo in repos:
66 vcs_type, url = repo.split('://', maxsplit=1)
67 abcd_file.write(' vcs:\n')
68 if vcs_type == 'gitsm':
69 vcs_type = 'git'
70 abcd_file.write(' type: "%s"\n' % vcs_type)
71 abcd_file.write(' url: "%s"\n' % url)
72 # TODO: Actually support multiple repos here:
73 abcd_file.write(' revision: "%s"\n' % srcrev)
74 abcd_file.write(' branch: "%s"\n' % branch)
75
76 abcd_file.write(' dependencies:\n')
77 for dep in depends:
78 abcd_file.write(' - "%s"\n' % dep)
79 # TODO: search for transitive dependencies here? Each dependency will
80 # get checked for its own dependencies sooner or later.
81
82 return depends
83
84
85def main():
86 abcd_manifest = 'manifest.abcd'
87 with open(abcd_manifest, "w") as abcd_file, bb.tinfoil.Tinfoil() as tinfoil:
88 tinfoil.prepare()
89 # These are the packages that bitbake assumes are provided by the host
90 # system. They do not have recipes, so searching tinfoil for them will
91 # not work. Anyway, by nature they are not included in code we release,
92 # only used by it.
93 assume_provided = tinfoil.config_data.getVar('ASSUME_PROVIDED').split()
94 abcd_file.write('packages:\n')
95
96 # Does NOT include garage-sign, anything used only for testing (i.e.
97 # strace and gtest), any of the git submodules, all of which are also
98 # only used for testing (tuf-test-vectors, isotp-c, ostreesysroot,
99 # and HdrHistogram_c), or any other third party modules included
100 # directly into the source tree (jsoncpp, open62541, picojson)
101 recipes_to_check = ['aktualizr',
102 'aktualizr-native',
103 'aktualizr-auto-prov',
104 'aktualizr-implicit-prov',
105 'aktualizr-ca-implicit-prov',
106 'aktualizr-hsm-prov',
107 'aktualizr-disable-send-ip',
108 'aktualizr-example-interface',
109 'aktualizr-log-debug',
110 'libp11', # BUILD_P11 (HSM) only
111 'dpkg', # BUILD_DEB only
112 'systemd'] # BUILD_SYSTEMD only
113
114 # Iterate through the list of recipes to check. Append any dependencies
115 # found that aren't already in the list. As long as we only add to the
116 # list, it should be safe.
117 for recipe in recipes_to_check:
118 depends = print_deps(tinfoil, abcd_file, recipe)
119 for dep in depends:
120 if dep not in recipes_to_check and dep not in assume_provided:
121 recipes_to_check.append(dep)
122
123
124if __name__ == "__main__":
125 main()