diff options
-rw-r--r-- | CONTRIBUTING.adoc | 3 | ||||
-rw-r--r-- | classes/image_types_ostree.bbclass | 2 | ||||
-rw-r--r-- | classes/sota.bbclass | 1 | ||||
-rw-r--r-- | lib/oeqa/selftest/cases/updater.py | 73 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-auto-prov.bb | 4 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb | 7 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-hsm-prov.bb | 6 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 6 | ||||
-rwxr-xr-x | recipes-sota/aktualizr/aktualizr_git.bb | 11 | ||||
-rw-r--r-- | recipes-sota/ostree/ostree_git.bb | 87 | ||||
-rw-r--r-- | scripts/ci/Dockerfile.bitbake | 36 | ||||
-rw-r--r-- | scripts/ci/Jenkinsfile.bleeding | 74 | ||||
-rw-r--r-- | scripts/ci/README.adoc | 14 | ||||
-rwxr-xr-x | scripts/ci/build.sh | 18 | ||||
-rwxr-xr-x | scripts/ci/configure.sh | 54 |
15 files changed, 308 insertions, 88 deletions
diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index df7a717..93a0815 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc | |||
@@ -1,4 +1,5 @@ | |||
1 | = Contributing | 1 | = Contributing |
2 | 2 | ||
3 | We welcome pull requests from everyone. 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 and development and debugging. | 3 | We 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. |
4 | 4 | ||
5 | If 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/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 6aacc52..ca8aee3 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -159,7 +159,7 @@ IMAGE_CMD_ostreepush () { | |||
159 | # Print warnings if credetials are not set or if the file has not been found. | 159 | # Print warnings if credetials are not set or if the file has not been found. |
160 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 160 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
161 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then | 161 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then |
162 | garage-push --repo=${OSTREE_REPO} \ | 162 | garage-push -vv --repo=${OSTREE_REPO} \ |
163 | --ref=${OSTREE_BRANCHNAME} \ | 163 | --ref=${OSTREE_BRANCHNAME} \ |
164 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | 164 | --credentials=${SOTA_PACKED_CREDENTIALS} \ |
165 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt | 165 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 38d4ce5..e1c5ecd 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -24,7 +24,6 @@ OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', T | |||
24 | 24 | ||
25 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo | 25 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo |
26 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" | 26 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" |
27 | # For UPTANE operation, OSTREE_BRANCHNAME must start with "${MACHINE}-" | ||
28 | OSTREE_BRANCHNAME ?= "${MACHINE}" | 27 | OSTREE_BRANCHNAME ?= "${MACHINE}" |
29 | OSTREE_OSNAME ?= "poky" | 28 | OSTREE_OSNAME ?= "poky" |
30 | OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" | 29 | OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" |
diff --git a/lib/oeqa/selftest/cases/updater.py b/lib/oeqa/selftest/cases/updater.py index 0253a84..e620491 100644 --- a/lib/oeqa/selftest/cases/updater.py +++ b/lib/oeqa/selftest/cases/updater.py | |||
@@ -115,8 +115,8 @@ class AktualizrToolsTests(OESelftestTestCase): | |||
115 | bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS', 'T'], 'aktualizr-native') | 115 | bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS', 'T'], 'aktualizr-native') |
116 | creds = bb_vars['SOTA_PACKED_CREDENTIALS'] | 116 | creds = bb_vars['SOTA_PACKED_CREDENTIALS'] |
117 | temp_dir = bb_vars['T'] | 117 | temp_dir = bb_vars['T'] |
118 | bb_vars_prov = get_bb_vars(['STAGING_DIR_NATIVE', 'libdir'], 'aktualizr-implicit-prov') | 118 | bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-implicit-prov') |
119 | config = bb_vars_prov['STAGING_DIR_NATIVE'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov.toml' | 119 | config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov.toml' |
120 | 120 | ||
121 | akt_native_run(self, 'aktualizr_cert_provider -c {creds} -r -l {temp} -g {config}' | 121 | akt_native_run(self, 'aktualizr_cert_provider -c {creds} -r -l {temp} -g {config}' |
122 | .format(creds=creds, temp=temp_dir, config=config)) | 122 | .format(creds=creds, temp=temp_dir, config=config)) |
@@ -141,7 +141,7 @@ class AutoProvTests(OESelftestTestCase): | |||
141 | if re.search(layer, result.output) is None: | 141 | if re.search(layer, result.output) is None: |
142 | # Assume the directory layout for finding other layers. We could also | 142 | # Assume the directory layout for finding other layers. We could also |
143 | # make assumptions by using 'show-layers', but either way, if the | 143 | # make assumptions by using 'show-layers', but either way, if the |
144 | # layers we need aren't where we expect them, we are out of like. | 144 | # layers we need aren't where we expect them, we are out of luck. |
145 | path = os.path.abspath(os.path.dirname(__file__)) | 145 | path = os.path.abspath(os.path.dirname(__file__)) |
146 | metadir = path + "/../../../../../" | 146 | metadir = path + "/../../../../../" |
147 | self.meta_qemu = metadir + layer | 147 | self.meta_qemu = metadir + layer |
@@ -193,6 +193,49 @@ class AutoProvTests(OESelftestTestCase): | |||
193 | 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode()) | 193 | 'Legacy secondary initialization failed: ' + stderr.decode() + stdout.decode()) |
194 | 194 | ||
195 | 195 | ||
196 | class ManualControlTests(OESelftestTestCase): | ||
197 | |||
198 | def setUpLocal(self): | ||
199 | layer = "meta-updater-qemux86-64" | ||
200 | result = runCmd('bitbake-layers show-layers') | ||
201 | if re.search(layer, result.output) is None: | ||
202 | # Assume the directory layout for finding other layers. We could also | ||
203 | # make assumptions by using 'show-layers', but either way, if the | ||
204 | # layers we need aren't where we expect them, we are out of like. | ||
205 | path = os.path.abspath(os.path.dirname(__file__)) | ||
206 | metadir = path + "/../../../../../" | ||
207 | self.meta_qemu = metadir + layer | ||
208 | runCmd('bitbake-layers add-layer "%s"' % self.meta_qemu) | ||
209 | else: | ||
210 | self.meta_qemu = None | ||
211 | self.append_config('MACHINE = "qemux86-64"') | ||
212 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-auto-prov "') | ||
213 | self.append_config('SYSTEMD_AUTO_ENABLE_aktualizr = "disable"') | ||
214 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | ||
215 | |||
216 | def tearDownLocal(self): | ||
217 | qemu_terminate(self.s) | ||
218 | if self.meta_qemu: | ||
219 | runCmd('bitbake-layers remove-layer "%s"' % self.meta_qemu, ignore_status=True) | ||
220 | |||
221 | def qemu_command(self, command): | ||
222 | return qemu_send_command(self.qemu.ssh_port, command) | ||
223 | |||
224 | def test_manual_running_mode_once(self): | ||
225 | """ | ||
226 | Disable the systemd service then run aktualizr manually | ||
227 | """ | ||
228 | sleep(20) | ||
229 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') | ||
230 | self.assertIn(b'Fetched metadata: no', stdout, | ||
231 | 'Aktualizr should not have run yet' + stderr.decode() + stdout.decode()) | ||
232 | |||
233 | stdout, stderr, retcode = self.qemu_command('aktualizr --running-mode=once') | ||
234 | |||
235 | stdout, stderr, retcode = self.qemu_command('aktualizr-info') | ||
236 | self.assertIn(b'Fetched metadata: yes', stdout, | ||
237 | 'Aktualizr should have run' + stderr.decode() + stdout.decode()) | ||
238 | |||
196 | class RpiTests(OESelftestTestCase): | 239 | class RpiTests(OESelftestTestCase): |
197 | 240 | ||
198 | def setUpLocal(self): | 241 | def setUpLocal(self): |
@@ -204,7 +247,7 @@ class RpiTests(OESelftestTestCase): | |||
204 | result = runCmd('bitbake-layers show-layers') | 247 | result = runCmd('bitbake-layers show-layers') |
205 | # Assume the directory layout for finding other layers. We could also | 248 | # Assume the directory layout for finding other layers. We could also |
206 | # make assumptions by using 'show-layers', but either way, if the | 249 | # make assumptions by using 'show-layers', but either way, if the |
207 | # layers we need aren't where we expect them, we are out of like. | 250 | # layers we need aren't where we expect them, we are out of luck. |
208 | path = os.path.abspath(os.path.dirname(__file__)) | 251 | path = os.path.abspath(os.path.dirname(__file__)) |
209 | metadir = path + "/../../../../../" | 252 | metadir = path + "/../../../../../" |
210 | if re.search(layer_python, result.output) is None: | 253 | if re.search(layer_python, result.output) is None: |
@@ -277,7 +320,7 @@ class GrubTests(OESelftestTestCase): | |||
277 | result = runCmd('bitbake-layers show-layers') | 320 | result = runCmd('bitbake-layers show-layers') |
278 | # Assume the directory layout for finding other layers. We could also | 321 | # Assume the directory layout for finding other layers. We could also |
279 | # make assumptions by using 'show-layers', but either way, if the | 322 | # make assumptions by using 'show-layers', but either way, if the |
280 | # layers we need aren't where we expect them, we are out of like. | 323 | # layers we need aren't where we expect them, we are out of luck. |
281 | path = os.path.abspath(os.path.dirname(__file__)) | 324 | path = os.path.abspath(os.path.dirname(__file__)) |
282 | metadir = path + "/../../../../../" | 325 | metadir = path + "/../../../../../" |
283 | if re.search(layer_intel, result.output) is None: | 326 | if re.search(layer_intel, result.output) is None: |
@@ -339,7 +382,7 @@ class ImplProvTests(OESelftestTestCase): | |||
339 | if re.search(layer, result.output) is None: | 382 | if re.search(layer, result.output) is None: |
340 | # Assume the directory layout for finding other layers. We could also | 383 | # Assume the directory layout for finding other layers. We could also |
341 | # make assumptions by using 'show-layers', but either way, if the | 384 | # make assumptions by using 'show-layers', but either way, if the |
342 | # layers we need aren't where we expect them, we are out of like. | 385 | # layers we need aren't where we expect them, we are out of luck. |
343 | path = os.path.abspath(os.path.dirname(__file__)) | 386 | path = os.path.abspath(os.path.dirname(__file__)) |
344 | metadir = path + "/../../../../../" | 387 | metadir = path + "/../../../../../" |
345 | self.meta_qemu = metadir + layer | 388 | self.meta_qemu = metadir + layer |
@@ -348,6 +391,7 @@ class ImplProvTests(OESelftestTestCase): | |||
348 | self.meta_qemu = None | 391 | self.meta_qemu = None |
349 | self.append_config('MACHINE = "qemux86-64"') | 392 | self.append_config('MACHINE = "qemux86-64"') |
350 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-implicit-prov "') | 393 | self.append_config('SOTA_CLIENT_PROV = " aktualizr-implicit-prov "') |
394 | runCmd('bitbake -c cleanall aktualizr aktualizr-implicit-prov') | ||
351 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | 395 | self.qemu, self.s = qemu_launch(machine='qemux86-64') |
352 | 396 | ||
353 | def tearDownLocal(self): | 397 | def tearDownLocal(self): |
@@ -392,8 +436,8 @@ class ImplProvTests(OESelftestTestCase): | |||
392 | # Run cert_provider. | 436 | # Run cert_provider. |
393 | bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') | 437 | bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') |
394 | creds = bb_vars['SOTA_PACKED_CREDENTIALS'] | 438 | creds = bb_vars['SOTA_PACKED_CREDENTIALS'] |
395 | bb_vars_prov = get_bb_vars(['STAGING_DIR_NATIVE', 'libdir'], 'aktualizr-implicit-prov') | 439 | bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-implicit-prov') |
396 | config = bb_vars_prov['STAGING_DIR_NATIVE'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov.toml' | 440 | config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_implicit_prov.toml' |
397 | 441 | ||
398 | akt_native_run(self, 'aktualizr_cert_provider -c {creds} -t root@localhost -p {port} -s -g {config}' | 442 | akt_native_run(self, 'aktualizr_cert_provider -c {creds} -t root@localhost -p {port} -s -g {config}' |
399 | .format(creds=creds, port=self.qemu.ssh_port, config=config)) | 443 | .format(creds=creds, port=self.qemu.ssh_port, config=config)) |
@@ -409,7 +453,7 @@ class HsmTests(OESelftestTestCase): | |||
409 | if re.search(layer, result.output) is None: | 453 | if re.search(layer, result.output) is None: |
410 | # Assume the directory layout for finding other layers. We could also | 454 | # Assume the directory layout for finding other layers. We could also |
411 | # make assumptions by using 'show-layers', but either way, if the | 455 | # make assumptions by using 'show-layers', but either way, if the |
412 | # layers we need aren't where we expect them, we are out of like. | 456 | # layers we need aren't where we expect them, we are out of luck. |
413 | path = os.path.abspath(os.path.dirname(__file__)) | 457 | path = os.path.abspath(os.path.dirname(__file__)) |
414 | metadir = path + "/../../../../../" | 458 | metadir = path + "/../../../../../" |
415 | self.meta_qemu = metadir + layer | 459 | self.meta_qemu = metadir + layer |
@@ -419,6 +463,7 @@ class HsmTests(OESelftestTestCase): | |||
419 | self.append_config('MACHINE = "qemux86-64"') | 463 | self.append_config('MACHINE = "qemux86-64"') |
420 | self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"') | 464 | self.append_config('SOTA_CLIENT_PROV = "aktualizr-hsm-prov"') |
421 | self.append_config('SOTA_CLIENT_FEATURES = "hsm"') | 465 | self.append_config('SOTA_CLIENT_FEATURES = "hsm"') |
466 | runCmd('bitbake -c cleanall aktualizr aktualizr-hsm-prov') | ||
422 | self.qemu, self.s = qemu_launch(machine='qemux86-64') | 467 | self.qemu, self.s = qemu_launch(machine='qemux86-64') |
423 | 468 | ||
424 | def tearDownLocal(self): | 469 | def tearDownLocal(self): |
@@ -473,8 +518,8 @@ class HsmTests(OESelftestTestCase): | |||
473 | # Run cert_provider. | 518 | # Run cert_provider. |
474 | bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') | 519 | bb_vars = get_bb_vars(['SOTA_PACKED_CREDENTIALS'], 'aktualizr-native') |
475 | creds = bb_vars['SOTA_PACKED_CREDENTIALS'] | 520 | creds = bb_vars['SOTA_PACKED_CREDENTIALS'] |
476 | bb_vars_prov = get_bb_vars(['STAGING_DIR_NATIVE', 'libdir'], 'aktualizr-hsm-prov') | 521 | bb_vars_prov = get_bb_vars(['STAGING_DIR_HOST', 'libdir'], 'aktualizr-hsm-prov') |
477 | config = bb_vars_prov['STAGING_DIR_NATIVE'] + bb_vars_prov['libdir'] + '/sota/sota_hsm_prov.toml' | 522 | config = bb_vars_prov['STAGING_DIR_HOST'] + bb_vars_prov['libdir'] + '/sota/sota_hsm_prov.toml' |
478 | 523 | ||
479 | akt_native_run(self, 'aktualizr_cert_provider -c {creds} -t root@localhost -p {port} -r -s -g {config}' | 524 | akt_native_run(self, 'aktualizr_cert_provider -c {creds} -t root@localhost -p {port} -r -s -g {config}' |
480 | .format(creds=creds, port=self.qemu.ssh_port, config=config)) | 525 | .format(creds=creds, port=self.qemu.ssh_port, config=config)) |
@@ -527,7 +572,7 @@ class SecondaryTests(OESelftestTestCase): | |||
527 | if re.search(layer, result.output) is None: | 572 | if re.search(layer, result.output) is None: |
528 | # Assume the directory layout for finding other layers. We could also | 573 | # Assume the directory layout for finding other layers. We could also |
529 | # make assumptions by using 'show-layers', but either way, if the | 574 | # make assumptions by using 'show-layers', but either way, if the |
530 | # layers we need aren't where we expect them, we are out of like. | 575 | # layers we need aren't where we expect them, we are out of luck. |
531 | path = os.path.abspath(os.path.dirname(__file__)) | 576 | path = os.path.abspath(os.path.dirname(__file__)) |
532 | metadir = path + "/../../../../../" | 577 | metadir = path + "/../../../../../" |
533 | self.meta_qemu = metadir + layer | 578 | self.meta_qemu = metadir + layer |
@@ -554,7 +599,7 @@ class SecondaryTests(OESelftestTestCase): | |||
554 | 599 | ||
555 | def test_secondary_listening(self): | 600 | def test_secondary_listening(self): |
556 | print('Checking aktualizr-secondary service is listening') | 601 | print('Checking aktualizr-secondary service is listening') |
557 | stdout, stderr, retcode = self.qemu_command('echo test | nc localhost 9030') | 602 | stdout, stderr, retcode = self.qemu_command('aktualizr-check-discovery') |
558 | self.assertEqual(retcode, 0, "Unable to connect to secondary") | 603 | self.assertEqual(retcode, 0, "Unable to connect to secondary") |
559 | 604 | ||
560 | 605 | ||
@@ -572,7 +617,7 @@ class PrimaryTests(OESelftestTestCase): | |||
572 | if re.search(layer, result.output) is None: | 617 | if re.search(layer, result.output) is None: |
573 | # Assume the directory layout for finding other layers. We could also | 618 | # Assume the directory layout for finding other layers. We could also |
574 | # make assumptions by using 'show-layers', but either way, if the | 619 | # make assumptions by using 'show-layers', but either way, if the |
575 | # layers we need aren't where we expect them, we are out of like. | 620 | # layers we need aren't where we expect them, we are out of luck. |
576 | path = os.path.abspath(os.path.dirname(__file__)) | 621 | path = os.path.abspath(os.path.dirname(__file__)) |
577 | metadir = path + "/../../../../../" | 622 | metadir = path + "/../../../../../" |
578 | self.meta_qemu = metadir + layer | 623 | self.meta_qemu = metadir + layer |
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb index 7f4f2e4..77f8f22 100644 --- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb | |||
@@ -36,7 +36,7 @@ do_install() { | |||
36 | aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} | 36 | aktualizr_toml=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-network', 'sota_autoprov_primary.toml', 'sota_autoprov.toml', d)} |
37 | 37 | ||
38 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ | 38 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/${aktualizr_toml} \ |
39 | ${D}${libdir}/sota/conf.d/20-${aktualizr_toml}.toml | 39 | ${D}${libdir}/sota/conf.d/20-${aktualizr_toml} |
40 | 40 | ||
41 | # deploy SOTA credentials | 41 | # deploy SOTA credentials |
42 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then | 42 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then |
@@ -49,7 +49,7 @@ do_install() { | |||
49 | 49 | ||
50 | FILES_${PN} = " \ | 50 | FILES_${PN} = " \ |
51 | ${libdir}/sota/conf.d \ | 51 | ${libdir}/sota/conf.d \ |
52 | ${libdir}/sota/conf.d/20-${aktualizr_toml}.toml \ | 52 | ${libdir}/sota/conf.d/20-${aktualizr_toml} \ |
53 | ${localstatedir}/sota \ | 53 | ${localstatedir}/sota \ |
54 | ${localstatedir}/sota/sota_provisioning_credentials.zip \ | 54 | ${localstatedir}/sota/sota_provisioning_credentials.zip \ |
55 | " | 55 | " |
diff --git a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb index 4d5ff79..e00d41a 100644 --- a/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-ca-implicit-prov.bb | |||
@@ -9,8 +9,7 @@ SECTION = "base" | |||
9 | LICENSE = "MPL-2.0" | 9 | LICENSE = "MPL-2.0" |
10 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 10 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" |
11 | 11 | ||
12 | DEPENDS = "aktualizr-native openssl-native" | 12 | DEPENDS = "aktualizr aktualizr-native openssl-native" |
13 | RDEPENDS_${PN} = "aktualizr" | ||
14 | 13 | ||
15 | SRC_URI = " \ | 14 | SRC_URI = " \ |
16 | file://LICENSE \ | 15 | file://LICENSE \ |
@@ -52,7 +51,7 @@ do_install() { | |||
52 | fi | 51 | fi |
53 | 52 | ||
54 | install -m 0700 -d ${D}${localstatedir}/sota | 53 | install -m 0700 -d ${D}${localstatedir}/sota |
55 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml \ | 54 | install -m 0644 ${STAGING_DIR_HOST}${libdir}/sota/sota_implicit_prov_ca.toml \ |
56 | ${D}${libdir}/sota/conf.d/20-sota_implicit_prov_ca.toml | 55 | ${D}${libdir}/sota/conf.d/20-sota_implicit_prov_ca.toml |
57 | aktualizr_cert_provider --credentials ${SOTA_PACKED_CREDENTIALS} \ | 56 | aktualizr_cert_provider --credentials ${SOTA_PACKED_CREDENTIALS} \ |
58 | --device-ca ${SOTA_CACERT_PATH} \ | 57 | --device-ca ${SOTA_CACERT_PATH} \ |
@@ -60,7 +59,7 @@ do_install() { | |||
60 | --root-ca \ | 59 | --root-ca \ |
61 | --server-url \ | 60 | --server-url \ |
62 | --local ${D}${localstatedir}/sota \ | 61 | --local ${D}${localstatedir}/sota \ |
63 | --config ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov_ca.toml | 62 | --config ${STAGING_DIR_HOST}${libdir}/sota/sota_implicit_prov_ca.toml |
64 | } | 63 | } |
65 | 64 | ||
66 | FILES_${PN} = " \ | 65 | FILES_${PN} = " \ |
diff --git a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb index d526cd2..ce92e9c 100644 --- a/recipes-sota/aktualizr/aktualizr-hsm-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-hsm-prov.bb | |||
@@ -5,8 +5,7 @@ SECTION = "base" | |||
5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" |
7 | 7 | ||
8 | DEPENDS = "aktualizr-native" | 8 | DEPENDS = "aktualizr aktualizr-native" |
9 | RDEPENDS_${PN} = "aktualizr" | ||
10 | 9 | ||
11 | SRC_URI = " \ | 10 | SRC_URI = " \ |
12 | file://LICENSE \ | 11 | file://LICENSE \ |
@@ -19,11 +18,10 @@ require credentials.inc | |||
19 | 18 | ||
20 | do_install() { | 19 | do_install() { |
21 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 20 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
22 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml \ | 21 | install -m 0644 ${STAGING_DIR_HOST}${libdir}/sota/sota_hsm_prov.toml \ |
23 | ${D}${libdir}/sota/conf.d/20-sota_hsm_prov.toml | 22 | ${D}${libdir}/sota/conf.d/20-sota_hsm_prov.toml |
24 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 23 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
25 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} --no-root-ca \ | 24 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} --no-root-ca \ |
26 | -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_prov.toml \ | ||
27 | -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} | 25 | -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} |
28 | fi | 26 | fi |
29 | } | 27 | } |
diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb index e08eeef..6e5f338 100644 --- a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb | |||
@@ -5,8 +5,7 @@ SECTION = "base" | |||
5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 6 | LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" |
7 | 7 | ||
8 | DEPENDS = "aktualizr-native" | 8 | DEPENDS = "aktualizr aktualizr-native" |
9 | RDEPENDS_${PN} = "aktualizr" | ||
10 | 9 | ||
11 | SRC_URI = " \ | 10 | SRC_URI = " \ |
12 | file://LICENSE \ | 11 | file://LICENSE \ |
@@ -19,11 +18,10 @@ require credentials.inc | |||
19 | 18 | ||
20 | do_install() { | 19 | do_install() { |
21 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 20 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
22 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml \ | 21 | install -m 0644 ${STAGING_DIR_HOST}${libdir}/sota/sota_implicit_prov.toml \ |
23 | ${D}${libdir}/sota/conf.d/20-sota_implicit_prov.toml | 22 | ${D}${libdir}/sota/conf.d/20-sota_implicit_prov.toml |
24 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 23 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
25 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \ | 24 | aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \ |
26 | -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_implicit_prov.toml \ | ||
27 | -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} | 25 | -o ${D}${libdir}/sota/conf.d/30-implicit_server.toml -p ${D} |
28 | fi | 26 | fi |
29 | } | 27 | } |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 8dc4b31..3684372 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
@@ -13,6 +13,9 @@ RDEPENDS_${PN}_class-target = "lshw " | |||
13 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " | 13 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " |
14 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' softhsm softhsm-testtoken', '', d)}" | 14 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' softhsm softhsm-testtoken', '', d)}" |
15 | 15 | ||
16 | RDEPENDS_${PN}_append_class-target = " ${PN}-tools " | ||
17 | RDEPENDS_${PN}-secondary_append_class-target = " ${PN}-tools " | ||
18 | |||
16 | PV = "1.0+git${SRCPV}" | 19 | PV = "1.0+git${SRCPV}" |
17 | PR = "7" | 20 | PR = "7" |
18 | 21 | ||
@@ -23,7 +26,7 @@ SRC_URI = " \ | |||
23 | file://aktualizr-secondary.socket \ | 26 | file://aktualizr-secondary.socket \ |
24 | file://aktualizr-serialcan.service \ | 27 | file://aktualizr-serialcan.service \ |
25 | " | 28 | " |
26 | SRCREV = "114dc6c519ca9a605d73ad292821348607d0fa12" | 29 | SRCREV = "41ffd4a967a15f9b4638573cda12bd9d4c260626" |
27 | BRANCH ?= "master" | 30 | BRANCH ?= "master" |
28 | 31 | ||
29 | S = "${WORKDIR}/git" | 32 | S = "${WORKDIR}/git" |
@@ -81,7 +84,7 @@ do_install_append_class-native () { | |||
81 | install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir} | 84 | install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir} |
82 | } | 85 | } |
83 | 86 | ||
84 | PACKAGES =+ " ${PN}-examples ${PN}-host-tools ${PN}-secondary " | 87 | PACKAGES =+ " ${PN}-examples ${PN}-host-tools ${PN}-tools ${PN}-secondary " |
85 | 88 | ||
86 | FILES_${PN} = " \ | 89 | FILES_${PN} = " \ |
87 | ${bindir}/aktualizr \ | 90 | ${bindir}/aktualizr \ |
@@ -111,6 +114,10 @@ FILES_${PN}-host-tools = " \ | |||
111 | ${libdir}/sota/sota_implicit_prov_ca.toml \ | 114 | ${libdir}/sota/sota_implicit_prov_ca.toml \ |
112 | " | 115 | " |
113 | 116 | ||
117 | FILES_${PN}-tools = " \ | ||
118 | ${bindir}/aktualizr-check-discovery \ | ||
119 | " | ||
120 | |||
114 | FILES_${PN}-secondary = " \ | 121 | FILES_${PN}-secondary = " \ |
115 | ${bindir}/aktualizr-secondary \ | 122 | ${bindir}/aktualizr-secondary \ |
116 | ${libdir}/sota/sota_secondary.toml \ | 123 | ${libdir}/sota/sota_secondary.toml \ |
diff --git a/recipes-sota/ostree/ostree_git.bb b/recipes-sota/ostree/ostree_git.bb index afb767f..6fa6ad4 100644 --- a/recipes-sota/ostree/ostree_git.bb +++ b/recipes-sota/ostree/ostree_git.bb | |||
@@ -1,10 +1,9 @@ | |||
1 | SUMMARY = "Tool for managing bootable, immutable, versioned filesystem trees" | 1 | SUMMARY = "Tool for managing bootable, immutable, versioned filesystem trees" |
2 | LICENSE = "GPLv2+" | 2 | HOMEPAGE = "https://ostree.readthedocs.io/en/latest/" |
3 | LICENSE = "LGPLv2+" | ||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" | 4 | LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2" |
4 | 5 | ||
5 | inherit autotools pkgconfig systemd gobject-introspection | 6 | inherit autotools pkgconfig systemd bash-completion gobject-introspection |
6 | |||
7 | INHERIT_remove_class-native = "systemd" | ||
8 | 7 | ||
9 | SRC_URI = "gitsm://github.com/ostreedev/ostree.git;branch=master" | 8 | SRC_URI = "gitsm://github.com/ostreedev/ostree.git;branch=master" |
10 | 9 | ||
@@ -17,76 +16,54 @@ S = "${WORKDIR}/git" | |||
17 | 16 | ||
18 | BBCLASSEXTEND = "native" | 17 | BBCLASSEXTEND = "native" |
19 | 18 | ||
20 | DEPENDS += "attr libarchive glib-2.0 pkgconfig gpgme libgsystem fuse e2fsprogs gtk-doc-native curl xz" | 19 | DEPENDS += "attr libarchive libcap glib-2.0 gpgme libgsystem fuse e2fsprogs curl xz" |
21 | DEPENDS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}" | 20 | DEPENDS += "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" |
22 | DEPENDS_remove_class-native = "systemd-native" | 21 | RDEPENDS_${PN}-dracut = "bash" |
23 | |||
24 | RDEPENDS_${PN} = "util-linux-libuuid util-linux-libblkid util-linux-libmount libcap bash" | ||
25 | 22 | ||
26 | EXTRA_OECONF = "CFLAGS='-Wno-error=missing-prototypes' --with-libarchive --disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --disable-man --with-smack --with-builtin-grub2-mkconfig --with-curl --without-soup" | 23 | CFLAGS_append = " -Wno-error=missing-prototypes" |
24 | EXTRA_OECONF = "--disable-gtk-doc --disable-man --with-smack --with-builtin-grub2-mkconfig --with-curl --without-soup" | ||
27 | EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat" | 25 | EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat" |
28 | 26 | ||
27 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" | ||
28 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/ --with-dracut" | ||
29 | |||
29 | # Path to ${prefix}/lib/ostree/ostree-grub-generator is hardcoded on the | 30 | # Path to ${prefix}/lib/ostree/ostree-grub-generator is hardcoded on the |
30 | # do_configure stage so we do depend on it | 31 | # do_configure stage so we do depend on it |
31 | SYSROOT_DIR = "${STAGING_DIR_TARGET}" | 32 | SYSROOT_DIR = "${STAGING_DIR_TARGET}" |
32 | SYSROOT_DIR_class-native = "${STAGING_DIR_NATIVE}" | 33 | SYSROOT_DIR_class-native = "${STAGING_DIR_NATIVE}" |
33 | do_configure[vardeps] += "SYSROOT_DIR" | 34 | do_configure[vardeps] += "SYSROOT_DIR" |
34 | 35 | ||
35 | SYSTEMD_REQUIRED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}" | ||
36 | SYSTEMD_REQUIRED_class-native = "" | ||
37 | |||
38 | SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service" | 36 | SYSTEMD_SERVICE_${PN} = "ostree-prepare-root.service ostree-remount.service" |
39 | SYSTEMD_SERVICE_${PN}_class-native = "" | ||
40 | |||
41 | PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
42 | PACKAGECONFIG_class-native = "" | ||
43 | PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/ --with-dracut" | ||
44 | |||
45 | FILES_${PN} += "${libdir}/ostree/ ${libdir}/ostbuild" | ||
46 | 37 | ||
38 | export BUILD_SYS | ||
39 | export HOST_SYS | ||
47 | export STAGING_INCDIR | 40 | export STAGING_INCDIR |
48 | export STAGING_LIBDIR | 41 | export STAGING_LIBDIR |
49 | 42 | ||
50 | do_configure() { | 43 | do_configure_prepend() { |
51 | unset docdir | 44 | unset docdir |
52 | NOCONFIGURE=1 "${S}/autogen.sh" | 45 | NOCONFIGURE=1 "${S}/autogen.sh" |
53 | oe_runconf | ||
54 | } | ||
55 | |||
56 | do_compile_prepend() { | ||
57 | export BUILD_SYS="${BUILD_SYS}" | ||
58 | export HOST_SYS="${HOST_SYS}" | ||
59 | } | ||
60 | |||
61 | export SYSTEMD_REQUIRED | ||
62 | |||
63 | do_install_append() { | ||
64 | if [ -n ${SYSTEMD_REQUIRED} ]; then | ||
65 | install -m 0644 -D ${S}/src/boot/ostree-prepare-root.service ${D}${systemd_unitdir}/system/ostree-prepare-root.service | ||
66 | install -m 0644 -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service | ||
67 | fi | ||
68 | } | 46 | } |
69 | 47 | ||
70 | do_install_append_class-native() { | 48 | do_install_append_class-native() { |
71 | create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="${STAGING_LIBDIR_NATIVE}/ostree/ostree-grub-generator" | 49 | create_wrapper ${D}${bindir}/ostree OSTREE_GRUB2_EXEC="${STAGING_LIBDIR_NATIVE}/ostree/ostree-grub-generator" |
72 | } | 50 | } |
73 | 51 | ||
74 | 52 | PACKAGES += " \ | |
75 | FILES_${PN} += " \ | 53 | ${PN}-switchroot \ |
76 | ${@'${systemd_unitdir}/system/' if d.getVar('SYSTEMD_REQUIRED', True) else ''} \ | 54 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'ostree-dracut', '', d)} \ |
77 | ${@'${libdir}/dracut/modules.d/98ostree/module-setup.sh' if d.getVar('SYSTEMD_REQUIRED', True) else ''} \ | ||
78 | ${datadir}/gir-1.0 \ | ||
79 | ${datadir}/gir-1.0/OSTree-1.0.gir \ | ||
80 | ${libdir}/girepository-1.0 \ | ||
81 | ${libdir}/girepository-1.0/OSTree-1.0.typelib \ | ||
82 | ${libdir}/tmpfiles.d/ostree-tmpfiles.conf \ | ||
83 | ${datadir}/bash-completion/completions/ostree \ | ||
84 | ${systemd_unitdir}/system-generators/ostree-system-generator \ | ||
85 | " | 55 | " |
86 | 56 | ||
87 | PACKAGES =+ "${PN}-switchroot" | 57 | FILES_${PN} = "${bindir} \ |
88 | 58 | ${sysconfdir}/ostree \ | |
59 | ${datadir}/ostree \ | ||
60 | ${libdir}/*.so.* \ | ||
61 | ${libdir}/ostree/ostree-grub-generator \ | ||
62 | ${libdir}/ostree/ostree-remount \ | ||
63 | ${libdir}/girepository-1.0/* \ | ||
64 | ${@bb.utils.contains('DISTRO_FEATURES','systemd','${libdir}/tmpfiles.d', '', d)} \ | ||
65 | ${@bb.utils.contains('DISTRO_FEATURES','systemd','${systemd_unitdir}/system-generators', '', d)} \ | ||
66 | " | ||
67 | FILES_${PN}-dev += " ${datadir}/gir-1.0" | ||
68 | FILES_${PN}-dracut = "${sysconfdir}/dracut.conf.d ${libdir}/dracut" | ||
89 | FILES_${PN}-switchroot = "${libdir}/ostree/ostree-prepare-root" | 69 | FILES_${PN}-switchroot = "${libdir}/ostree/ostree-prepare-root" |
90 | RDEPENDS_${PN}-switchroot = "" | ||
91 | DEPENDS_remove_class-native = "systemd-native" | ||
92 | |||
diff --git a/scripts/ci/Dockerfile.bitbake b/scripts/ci/Dockerfile.bitbake new file mode 100644 index 0000000..4dfafec --- /dev/null +++ b/scripts/ci/Dockerfile.bitbake | |||
@@ -0,0 +1,36 @@ | |||
1 | FROM debian:stable | ||
2 | LABEL Description="Image for bitbaking" | ||
3 | |||
4 | RUN sed -i 's#deb http://deb.debian.org/debian stable main#deb http://deb.debian.org/debian stable main contrib#g' /etc/apt/sources.list | ||
5 | RUN sed -i 's#deb http://deb.debian.org/debian stable-updates main#deb http://deb.debian.org/debian stable-updates main contrib#g' /etc/apt/sources.list | ||
6 | RUN apt-get update -q && apt-get install -qy \ | ||
7 | build-essential \ | ||
8 | bzip2 \ | ||
9 | chrpath \ | ||
10 | cpio \ | ||
11 | default-jre \ | ||
12 | diffstat \ | ||
13 | gawk \ | ||
14 | gcc-multilib \ | ||
15 | git-core \ | ||
16 | iputils-ping \ | ||
17 | iproute \ | ||
18 | libpython-dev \ | ||
19 | libsdl1.2-dev \ | ||
20 | locales \ | ||
21 | procps \ | ||
22 | python \ | ||
23 | python3 \ | ||
24 | python3-pexpect \ | ||
25 | qemu \ | ||
26 | socat \ | ||
27 | texinfo \ | ||
28 | unzip \ | ||
29 | wget \ | ||
30 | xterm \ | ||
31 | xz-utils | ||
32 | |||
33 | RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen | ||
34 | ENV LC_ALL="en_US.UTF-8" | ||
35 | ENV LANG="en_US.UTF-8" | ||
36 | ENV LANGUAGE="en_US.UTF-8" | ||
diff --git a/scripts/ci/Jenkinsfile.bleeding b/scripts/ci/Jenkinsfile.bleeding new file mode 100644 index 0000000..6d0f1e7 --- /dev/null +++ b/scripts/ci/Jenkinsfile.bleeding | |||
@@ -0,0 +1,74 @@ | |||
1 | // This CI setup checks out aktualizr, meta-updater and updater-repo and builds | ||
2 | // master branches whenever a change is pushed to any of these | ||
3 | |||
4 | pipeline { | ||
5 | agent none | ||
6 | environment { | ||
7 | TEST_AKTUALIZR_REMOTE = 'aktualizr' | ||
8 | TEST_AKTUALIZR_DIR = 'aktualizr' | ||
9 | TEST_AKTUALIZR_BRANCH = 'master' | ||
10 | TEST_BITBAKE_COMMON_DIR = "/opt/jenkins/bitbake-common" | ||
11 | } | ||
12 | stages { | ||
13 | stage('checkout') { | ||
14 | agent any | ||
15 | steps { | ||
16 | checkout([$class: 'GitSCM', | ||
17 | userRemoteConfigs: [ | ||
18 | [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] | ||
19 | ], | ||
20 | branches: [[name: 'refs/heads/master']], | ||
21 | extensions: [ | ||
22 | [$class: 'DisableRemotePoll'], | ||
23 | [$class: 'PruneStaleBranch'], | ||
24 | [$class: 'RelativeTargetDirectory', | ||
25 | relativeTargetDir: 'aktualizr' | ||
26 | ] | ||
27 | ], | ||
28 | ]) | ||
29 | |||
30 | checkout([$class: 'RepoScm', | ||
31 | manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', | ||
32 | manifestBranch: null, | ||
33 | manifestFile: 'master.xml', | ||
34 | manifestGroup: null, | ||
35 | mirrorDir: null, | ||
36 | jobs: 0, | ||
37 | depth: 0, | ||
38 | localManifest: null, | ||
39 | destinationDir: 'updater-repo', | ||
40 | repoUrl: null, | ||
41 | currentBranch: false, | ||
42 | resetFirst: true, | ||
43 | quiet: false, | ||
44 | trace: false, | ||
45 | showAllChanges: false, | ||
46 | ]) | ||
47 | |||
48 | // ignore bitbake build directories in docker | ||
49 | sh 'echo \'build*\' > .dockerignore' | ||
50 | |||
51 | // override meta-updater commit with currently tested branch | ||
52 | sh ''' | ||
53 | META_UPDATER_COMMIT=$(git rev-parse HEAD) | ||
54 | cd updater-repo/meta-updater | ||
55 | git checkout $META_UPDATER_COMMIT | ||
56 | ''' | ||
57 | } | ||
58 | } | ||
59 | stage('build-core-image-minimal') { | ||
60 | agent { | ||
61 | dockerfile { | ||
62 | filename 'scripts/ci/Dockerfile.bitbake' | ||
63 | args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' | ||
64 | } | ||
65 | } | ||
66 | steps { | ||
67 | sh 'scripts/ci/configure.sh' | ||
68 | |||
69 | sh 'scripts/ci/build.sh core-image-minimal' | ||
70 | } | ||
71 | } | ||
72 | } | ||
73 | } | ||
74 | // vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: | ||
diff --git a/scripts/ci/README.adoc b/scripts/ci/README.adoc new file mode 100644 index 0000000..222982b --- /dev/null +++ b/scripts/ci/README.adoc | |||
@@ -0,0 +1,14 @@ | |||
1 | = Jenkins setup for running meta-updater CI | ||
2 | |||
3 | As bitbake is quite resource-hungry, there are some special steps that are | ||
4 | needed to run Jenkins CI tasks: | ||
5 | |||
6 | - docker should be installed and the `jenkins` unix user should belong to | ||
7 | the `docker` group | ||
8 | - `/opt/jenkins` should exist and have `jenkins:jenkins` permissions, it | ||
9 | will be mapped as a volume on the same location in the docker build | ||
10 | container | ||
11 | |||
12 | Note that for nodes running Jenkins slaves as a docker container, the | ||
13 | `/opt/jenkins` directory must exist on the host system as well, with | ||
14 | permissions matching the user and groupd ids in Jenkins' docker | ||
diff --git a/scripts/ci/build.sh b/scripts/ci/build.sh new file mode 100755 index 0000000..6235428 --- /dev/null +++ b/scripts/ci/build.sh | |||
@@ -0,0 +1,18 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -euo pipefail | ||
4 | set -x | ||
5 | |||
6 | TEST_MACHINE=${TEST_MACHINE:-qemux86-64} | ||
7 | TEST_BUILD_DIR=${TEST_BUILD_DIR:-build} | ||
8 | TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} | ||
9 | |||
10 | IMAGE_NAME=${1:-core-image-minimal} | ||
11 | |||
12 | ( | ||
13 | set +euo pipefail | ||
14 | set +x | ||
15 | . "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" | ||
16 | |||
17 | bitbake "${IMAGE_NAME}" | ||
18 | ) | ||
diff --git a/scripts/ci/configure.sh b/scripts/ci/configure.sh new file mode 100755 index 0000000..1e87a7b --- /dev/null +++ b/scripts/ci/configure.sh | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | set -euo pipefail | ||
4 | set -x | ||
5 | |||
6 | TEST_MACHINE=${TEST_MACHINE:-qemux86-64} | ||
7 | TEST_BUILD_DIR=${TEST_BUILD_DIR:-build} | ||
8 | TEST_REPO_DIR=${TEST_REPO_DIR:-updater-repo} | ||
9 | |||
10 | TEST_AKTUALIZR_DIR=${TEST_AKTUALIZR_DIR:-.} | ||
11 | TEST_AKTUALIZR_BRANCH=${TEST_AKTUALIZR_BRANCH:-master} | ||
12 | TEST_AKTUALIZR_REV=${TEST_AKTUALIZR_REV:-$(GIT_DIR="$TEST_AKTUALIZR_DIR/.git" git rev-parse "$TEST_AKTUALIZR_REMOTE/$TEST_AKTUALIZR_BRANCH")} | ||
13 | TEST_BITBAKE_COMMON_DIR=${TEST_BITBAKE_COMMON_DIR:-} | ||
14 | |||
15 | # move existing conf directory to backup, before generating a new one | ||
16 | rm -rf "${TEST_BUILD_DIR}/conf.old" || true | ||
17 | mv "${TEST_BUILD_DIR}/conf" "${TEST_BUILD_DIR}/conf.old" || true | ||
18 | |||
19 | ( | ||
20 | set +euo pipefail | ||
21 | set +x | ||
22 | echo ">> Running envsetup.sh" | ||
23 | . "${TEST_REPO_DIR}/meta-updater/scripts/envsetup.sh" "${TEST_MACHINE}" "${TEST_BUILD_DIR}" | ||
24 | ) | ||
25 | |||
26 | set +x | ||
27 | |||
28 | echo ">> Set common bitbake config options" | ||
29 | cat << EOF > "${TEST_BUILD_DIR}/conf/site.conf" | ||
30 | SANITY_TESTED_DISTROS = "" | ||
31 | SSTATE_MIRRORS ?= "file://.* https://bitbake-cache.atsgarage.com/PATH;downloadfilename=PATH" | ||
32 | IMAGE_FEATURES += "ssh-server-openssh" | ||
33 | |||
34 | EOF | ||
35 | |||
36 | echo ">> Set aktualizr branch in bitbake's config" | ||
37 | cat << EOF >> "${TEST_BUILD_DIR}/conf/site.conf" | ||
38 | SRCREV_pn-aktualizr = "$TEST_AKTUALIZR_REV" | ||
39 | SRCREV_pn-aktualizr-native = "\${SRCREV_pn-aktualizr}" | ||
40 | BRANCH_pn-aktualizr = "$TEST_AKTUALIZR_BRANCH" | ||
41 | BRANCH_pn-aktualizr-native = "\${BRANCH_pn-aktualizr}" | ||
42 | |||
43 | EOF | ||
44 | |||
45 | if [[ -n $TEST_BITBAKE_COMMON_DIR ]]; then | ||
46 | echo ">> Set caching" | ||
47 | SSTATE_DIR="$TEST_BITBAKE_COMMON_DIR/sstate-cache" | ||
48 | DL_DIR="$TEST_BITBAKE_COMMON_DIR/downloads" | ||
49 | mkdir -p "$SSTATE_DIR" "$DL_DIR" | ||
50 | cat << EOF >> "${TEST_BUILD_DIR}/conf/site.conf" | ||
51 | SSTATE_DIR = "$SSTATE_DIR" | ||
52 | DL_DIR = "$DL_DIR" | ||
53 | EOF | ||
54 | fi | ||