diff options
| author | Patrick Vacek <patrickvacek@gmail.com> | 2019-10-30 15:56:45 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-10-30 15:56:45 +0100 |
| commit | 0b087a34b708bfd808a013b3656f543d2709692e (patch) | |
| tree | 11b145a29e266242aa865a451455950649b4f5f6 | |
| parent | ee1548d2228498a8e8ff2a44d7cead23eb5cc7ed (diff) | |
| parent | c1766d6b3e4d7aa514dca098f49aaee8e33e08de (diff) | |
| download | meta-updater-0b087a34b708bfd808a013b3656f543d2709692e.tar.gz | |
Merge pull request #618 from advancedtelematic/feat/thud/2019.9-backport
Feat/thud/2019.9 backport
29 files changed, 219 insertions, 331 deletions
diff --git a/README.adoc b/README.adoc index 12e0446..4cccc7b 100644 --- a/README.adoc +++ b/README.adoc | |||
| @@ -1,17 +1,18 @@ | |||
| 1 | = meta-updater | 1 | = meta-updater |
| 2 | :toc: macro | 2 | :toc: macro |
| 3 | :toc-title: | 3 | :toc-title: |
| 4 | :aktualizr-docsroot: https://github.com/advancedtelematic/aktualizr/tree/master/docs/ota-client-guide/modules/ROOT/pages/ | 4 | :devguide-docsroot: https://docs.ota.here.com/ota-client/latest/ |
| 5 | :getstarted-docsroot: https://docs.ota.here.com/getstarted/dev/ | ||
| 5 | 6 | ||
| 6 | Meta-updater is a link:https://www.yoctoproject.org/software-overview/layers/[Yocto layer] that enables over-the-air updates (OTA) with https://github.com/ostreedev/ostree[OSTree] and https://github.com/advancedtelematic/aktualizr[Aktualizr] -- the default client for link:https://www.here.com/products/automotive/ota-technology[HERE OTA Connect]. | 7 | Meta-updater is a link:https://www.yoctoproject.org/software-overview/layers/[Yocto layer] that enables over-the-air updates (OTA) with https://github.com/ostreedev/ostree[OSTree] and https://github.com/advancedtelematic/aktualizr[Aktualizr] -- the default client for link:https://www.here.com/products/automotive/ota-technology[HERE OTA Connect]. |
| 7 | 8 | ||
| 8 | https://github.com/ostreedev/ostree[OSTree] is a tool for atomic full file system upgrades with rollback capability. OSTree has several advantages over traditional dual-bank systems, but the most important one is that it minimizes network bandwidth and data storage footprint by sharing files with the same contents across file system deployments. | 9 | https://github.com/ostreedev/ostree[OSTree] is a tool for atomic full file system upgrades with rollback capability. OSTree has several advantages over traditional dual-bank systems, but the most important one is that it minimizes network bandwidth and data storage footprint by sharing files with the same contents across file system deployments. |
| 9 | 10 | ||
| 10 | https://github.com/advancedtelematic/aktualizr[Aktualizr] (and https://github.com/advancedtelematic/rvi_sota_client[RVI SOTA client]) add authentication and provisioning capabilities to OTA and are integrated with OSTree. You can connect with these open-source applications or sign up for a free account at https://connect.ota.here.com/[HERE OTA Connect] to get started. | 11 | https://github.com/advancedtelematic/aktualizr[Aktualizr] implements https://uptane.github.io/uptane-standard/uptane-standard.html[Uptane], supports device authentication and provisioning, and is integrated with OSTree. You can connect aktualizr to your own server solution or sign up for a free account at https://connect.ota.here.com/[HERE OTA Connect] to get started. |
| 11 | 12 | ||
| 12 | == Quickstart | 13 | == Quickstart |
| 13 | 14 | ||
| 14 | If you don't already have a Yocto project that you want to add OTA to, you can use the xref:dev@getstarted::raspberry-pi.adoc[HERE OTA Connect Quickstart] project to rapidly get up and running on a Raspberry Pi. It takes a standard https://www.yoctoproject.org/tools-resources/projects/poky[poky] distribution, and adds OTA and OSTree capabilities. | 15 | If you don't already have a Yocto project that you want to add OTA to, you can use the xref:{getstarted-docsroot}get-started.html[HERE OTA Connect Quickstart] project to rapidly get up and running on a xref:{getstarted-docsroot}raspberry-pi.html[Raspberry Pi] or with xref:{getstarted-docsroot}qemuvirtualbox.html[QEMU]. It takes a standard https://www.yoctoproject.org/tools-resources/projects/poky[poky] distribution, and adds OTA and OSTree capabilities. |
| 15 | 16 | ||
| 16 | == Dependencies | 17 | == Dependencies |
| 17 | 18 | ||
| @@ -30,43 +31,43 @@ sudo apt install ovmf | |||
| 30 | [discrete] | 31 | [discrete] |
| 31 | == Table of Contents | 32 | == Table of Contents |
| 32 | 33 | ||
| 33 | The following documentation focuses on tasks that involve the meta-updater layer. If you want to get an idea of the overall developer workflow in OTA Connect, see the link:https://docs.ota.here.com/ota-client/dev/index.html[OTA Connect Developer Guide]. | 34 | The following documentation focuses on tasks that involve the meta-updater layer. If you want to get an idea of the overall developer workflow in OTA Connect, see the link:{devguide-docsroot}index.html[OTA Connect Developer Guide]. |
| 34 | [NOTE] | ||
| 35 | ==== | ||
| 36 | The following links point to files in the aktualizr repository where the source of the developer guide is stored. | ||
| 37 | ==== | ||
| 38 | 35 | ||
| 39 | * xref:{aktualizr-docsroot}meta-updater-build.adoc[Build] | 36 | * xref:{devguide-docsroot}supported-boards.html[Supported boards] |
| 40 | + | 37 | + |
| 41 | Learn how to use this layer to build a basic disk image and add it to your own Yocto project. | 38 | Find out if your board is supported and learn about the minimum hardware requirements. |
| 42 | + | 39 | + |
| 43 | * xref:{aktualizr-docsroot}supported-boards.adoc[Supported boards] | 40 | * xref:{devguide-docsroot}build-agl.html[Build an Automotive Grade Linux image] |
| 44 | + | 41 | + |
| 45 | Find out if your board is supported and learn about the minimum hardware requirements. | 42 | Learn how to use this layer as part of AGL. |
| 43 | + | ||
| 44 | * xref:{devguide-docsroot}add-ota-functonality-existing-yocto-project.html[Add OTA functionality to an existing Yocto project] | ||
| 45 | + | ||
| 46 | Learn how to add this layer to your own Yocto project. | ||
| 46 | + | 47 | + |
| 47 | * xref:{aktualizr-docsroot}build-configuration.adoc[SOTA-related variables in local.conf] | 48 | * xref:{devguide-docsroot}build-configuration.html[SOTA-related variables in local.conf] |
| 48 | + | 49 | + |
| 49 | Learn how to configure OTA-related functionality when building disk images. | 50 | Learn how to configure OTA-related functionality when building images, including how to install custom versions of aktualizr. |
| 50 | + | 51 | + |
| 51 | * xref:{aktualizr-docsroot}meta-updater-usage.adoc[Usage] | 52 | * xref:{devguide-docsroot}recommended-clientconfig.html[Recommended configuration] |
| 52 | + | 53 | + |
| 53 | Learn about the `garage-push` and `garage-sign` utilities, aktualizr configuration and service resource control, and OSTree. | 54 | Learn how to optimize your build for development or production. |
| 54 | + | 55 | + |
| 55 | * xref:{aktualizr-docsroot}meta-updater-dev-config.adoc[Development configuration] | 56 | * xref:{devguide-docsroot}client-provisioning-methods.html[Provisoning methods] |
| 56 | + | 57 | + |
| 57 | Learn how to configure logging, install custom versions of aktualizr, and override the version indicator for sofware updates. | 58 | Learn more about the methods for provisioning devices. For more detail, you may also want to read about how to xref:{devguide-docsroot}enable-device-cred-provisioning.html[enable device credential provisioning] or how to xref:{devguide-docsroot}simulate-device-cred-provtest.html[simulate it for testing]. |
| 58 | + | 59 | + |
| 59 | * xref:{aktualizr-docsroot}meta-updater-testing.adoc#_qa_with_oe_selftest[QA with oe-selftest] | 60 | * xref:{devguide-docsroot}meta-updater-usage.html[Advanced usage] |
| 60 | + | 61 | + |
| 61 | Learn how to use the `oe-selftest` framework for quality assurance. | 62 | Learn about the `garage-push` and `garage-sign` utilities, aktualizr configuration recipes, and service resource control. |
| 62 | + | 63 | + |
| 63 | * xref:{aktualizr-docsroot}meta-updater-testing.adoc#_aktualizr_test_suite_with_ptest[Aktualizr test suite with ptest] | 64 | * xref:{devguide-docsroot}meta-updater-testing.html[Testing with oe-selftest and ptest] |
| 64 | + | 65 | + |
| 65 | Learn how to enable Yocto's package test functionality and run parts of the aktualizr test suite. | 66 | Learn how to use the `oe-selftest` framework for quality assurance and how to run the aktualizr test suite via ptest. |
| 66 | + | 67 | + |
| 67 | * xref:{aktualizr-docsroot}meta-updater-provisioning-methods.adoc[Provisoning methods] | 68 | * xref:{devguide-docsroot}troubleshooting.html[Troubleshooting] |
| 68 | + | 69 | + |
| 69 | Learn how to enable different methods for provisioning devices. | 70 | Get help on common problems. |
| 70 | 71 | ||
| 71 | == License | 72 | == License |
| 72 | 73 | ||
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 795e01b..7ffe99d 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
| @@ -168,7 +168,8 @@ IMAGE_CMD_ostreecommit () { | |||
| 168 | --skip-if-unchanged \ | 168 | --skip-if-unchanged \ |
| 169 | --branch=${OSTREE_BRANCHNAME} \ | 169 | --branch=${OSTREE_BRANCHNAME} \ |
| 170 | --subject="${OSTREE_COMMIT_SUBJECT}" \ | 170 | --subject="${OSTREE_COMMIT_SUBJECT}" \ |
| 171 | --body="${OSTREE_COMMIT_BODY}" | 171 | --body="${OSTREE_COMMIT_BODY}" \ |
| 172 | --bind-ref="${OSTREE_BRANCHNAME}-${IMAGE_BASENAME}" | ||
| 172 | 173 | ||
| 173 | if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then | 174 | if [ "${OSTREE_UPDATE_SUMMARY}" = "1" ]; then |
| 174 | ostree --repo=${OSTREE_REPO} summary -u | 175 | ostree --repo=${OSTREE_REPO} summary -u |
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index 69f09fd..c901a70 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass | |||
| @@ -16,25 +16,55 @@ DEV_MATCH_DIRECTIVE_pn-networkd-dhcp-conf = "Driver=smsc95xx lan78xx" | |||
| 16 | IMAGE_INSTALL_append_sota = " virtual/network-configuration " | 16 | IMAGE_INSTALL_append_sota = " virtual/network-configuration " |
| 17 | 17 | ||
| 18 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" | 18 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" |
| 19 | UBOOT_ENTRYPOINT_sota ?= "0x00008000" | 19 | UBOOT_ENTRYPOINT_sota ?= "0x00080000" |
| 20 | 20 | ||
| 21 | IMAGE_FSTYPES_remove_sota = "rpi-sdimg" | 21 | IMAGE_FSTYPES_remove_sota = "rpi-sdimg" |
| 22 | OSTREE_BOOTLOADER ?= "u-boot" | 22 | OSTREE_BOOTLOADER ?= "u-boot" |
| 23 | 23 | ||
| 24 | def make_dtb_boot_files(d): | ||
| 25 | # Generate IMAGE_BOOT_FILES entries for device tree files listed in | ||
| 26 | # KERNEL_DEVICETREE. | ||
| 27 | # | ||
| 28 | # This function was taken from conf/machine/include/rpi-base.inc in | ||
| 29 | # meta-raspberrypi | ||
| 30 | alldtbs = d.getVar('KERNEL_DEVICETREE') | ||
| 31 | imgtyp = d.getVar('KERNEL_IMAGETYPE') | ||
| 32 | |||
| 33 | def transform(dtb): | ||
| 34 | base = os.path.basename(dtb) | ||
| 35 | if dtb.endswith('dtb'): | ||
| 36 | return base | ||
| 37 | elif dtb.endswith('dtbo'): | ||
| 38 | return '{};{}'.format(base, dtb) | ||
| 39 | |||
| 40 | return ' '.join([transform(dtb) for dtb in alldtbs.split(' ') if dtb]) | ||
| 41 | |||
| 42 | IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* \ | ||
| 43 | u-boot.bin;${SDIMG_KERNELIMAGE} \ | ||
| 44 | " | ||
| 45 | |||
| 24 | # OSTree puts its own boot.scr to bcm2835-bootfiles | 46 | # OSTree puts its own boot.scr to bcm2835-bootfiles |
| 25 | IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* u-boot.bin;${SDIMG_KERNELIMAGE}" | 47 | # raspberrypi4 needs dtb in /boot partition so that they can be read by the |
| 48 | # firmware | ||
| 49 | IMAGE_BOOT_FILES_append_sota_raspberrypi4 = "${@make_dtb_boot_files(d)}" | ||
| 26 | 50 | ||
| 27 | # Just the overlays that will be used should be listed | 51 | # Just the overlays that will be used should be listed |
| 28 | KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " | 52 | KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " |
| 29 | KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/rpi-ft5406.dtbo" | 53 | KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/rpi-ft5406.dtbo" |
| 30 | KERNEL_DEVICETREE_raspberrypi3-64_sota ?= " broadcom/bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/vc4-fkms-v3d.dtbo overlays/rpi-ft5406.dtbo" | 54 | KERNEL_DEVICETREE_raspberrypi3-64_sota ?= " broadcom/bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/vc4-fkms-v3d.dtbo overlays/rpi-ft5406.dtbo" |
| 55 | KERNEL_DEVICETREE_raspberrypi4_sota ?= " bcm2711-rpi-4-b.dtb overlays/vc4-fkms-v3d.dtbo overlays/uart0-rpi4.dtbo" | ||
| 56 | KERNEL_DEVICETREE_raspberrypi4-64_sota ?= " broadcom/bcm2711-rpi-4-b.dtb overlays/vc4-fkms-v3d.dtbo overlays/uart0-rpi4.dtbo" | ||
| 31 | 57 | ||
| 32 | SOTA_MAIN_DTB_raspberrypi2 ?= "bcm2709-rpi-2-b.dtb" | 58 | SOTA_MAIN_DTB_raspberrypi2 ?= "bcm2709-rpi-2-b.dtb" |
| 33 | SOTA_MAIN_DTB_raspberrypi3 ?= "bcm2710-rpi-3-b.dtb" | 59 | SOTA_MAIN_DTB_raspberrypi3 ?= "bcm2710-rpi-3-b.dtb" |
| 34 | SOTA_MAIN_DTB_raspberrypi3-64 ?= "broadcom_bcm2710-rpi-3-b.dtb" | 60 | SOTA_MAIN_DTB_raspberrypi3-64 ?= "broadcom_bcm2710-rpi-3-b.dtb" |
| 61 | SOTA_MAIN_DTB_raspberrypi4_sota ?= "bcm2711-rpi-4-b.dtb" | ||
| 62 | SOTA_MAIN_DTB_raspberrypi4-64_sota ?= "broadcom_bcm2711-rpi-4-b.dtb" | ||
| 35 | 63 | ||
| 36 | SOTA_DT_OVERLAYS_raspberrypi3 ?= "vc4-kms-v3d.dtbo rpi-ft5406.dtbo" | 64 | SOTA_DT_OVERLAYS_raspberrypi3 ?= "vc4-kms-v3d.dtbo rpi-ft5406.dtbo" |
| 37 | SOTA_DT_OVERLAYS_raspberrypi3-64 ?= "vc4-kms-v3d.dtbo vc4-fkms-v3d.dtbo rpi-ft5406.dtbo" | 65 | SOTA_DT_OVERLAYS_raspberrypi3-64 ?= "vc4-kms-v3d.dtbo vc4-fkms-v3d.dtbo rpi-ft5406.dtbo" |
| 66 | SOTA_DT_OVERLAYS_raspberrypi4 ?= "vc4-fkms-v3d.dtbo uart0-rpi4.dtbo" | ||
| 67 | SOTA_DT_OVERLAYS_raspberrypi4-64 ?= "vc4-fkms-v3d.dtbo uart0-rpi4.dtbo" | ||
| 38 | 68 | ||
| 39 | # Kernel args normally provided by RPi's internal bootloader. Non-updateable | 69 | # Kernel args normally provided by RPi's internal bootloader. Non-updateable |
| 40 | OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=614 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 " | 70 | OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=614 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 " |
diff --git a/conf/include/bblayers/sota_raspberrypi3-64.inc b/conf/include/bblayers/sota_raspberrypi3-64.inc index ea420ba..03f8f44 100644 --- a/conf/include/bblayers/sota_raspberrypi3-64.inc +++ b/conf/include/bblayers/sota_raspberrypi3-64.inc | |||
| @@ -1,2 +1,3 @@ | |||
| 1 | BBLAYERS += "${METADIR}/meta-openembedded/meta-python" | ||
| 1 | BBLAYERS += "${METADIR}/meta-updater-raspberrypi" | 2 | BBLAYERS += "${METADIR}/meta-updater-raspberrypi" |
| 2 | BBLAYERS += "${METADIR}/meta-raspberrypi" | 3 | BBLAYERS += "${METADIR}/meta-raspberrypi" |
diff --git a/conf/include/bblayers/sota_raspberrypi4-64.inc b/conf/include/bblayers/sota_raspberrypi4-64.inc new file mode 100644 index 0000000..7e320af --- /dev/null +++ b/conf/include/bblayers/sota_raspberrypi4-64.inc | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | BBLAYERS += "${METADIR}/meta-updater-raspberrypi" | ||
| 2 | BBLAYERS += "${METADIR}/meta-raspberrypi" | ||
| 3 | BBLAYERS += "${METADIR}/meta-openembedded/meta-networking" | ||
diff --git a/conf/include/bblayers/sota_raspberrypi4.inc b/conf/include/bblayers/sota_raspberrypi4.inc new file mode 100644 index 0000000..7e320af --- /dev/null +++ b/conf/include/bblayers/sota_raspberrypi4.inc | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | BBLAYERS += "${METADIR}/meta-updater-raspberrypi" | ||
| 2 | BBLAYERS += "${METADIR}/meta-raspberrypi" | ||
| 3 | BBLAYERS += "${METADIR}/meta-openembedded/meta-networking" | ||
diff --git a/conf/layer.conf b/conf/layer.conf index 627a1b8..39ea749 100644 --- a/conf/layer.conf +++ b/conf/layer.conf | |||
| @@ -9,5 +9,14 @@ BBFILE_COLLECTIONS += "sota" | |||
| 9 | BBFILE_PATTERN_sota = "^${LAYERDIR}/" | 9 | BBFILE_PATTERN_sota = "^${LAYERDIR}/" |
| 10 | BBFILE_PRIORITY_sota = "7" | 10 | BBFILE_PRIORITY_sota = "7" |
| 11 | 11 | ||
| 12 | LAYERDEPENDS_sota = "filesystems-layer" | 12 | LAYERDEPENDS_sota = "openembedded-layer" |
| 13 | LAYERDEPENDS_sota += "filesystems-layer" | ||
| 13 | LAYERSERIES_COMPAT_sota = "thud" | 14 | LAYERSERIES_COMPAT_sota = "thud" |
| 15 | |||
| 16 | SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS += " \ | ||
| 17 | aktualizr-device-prov->aktualizr \ | ||
| 18 | aktualizr-device-prov-hsm->aktualizr \ | ||
| 19 | aktualizr-shared-prov->aktualizr \ | ||
| 20 | aktualizr-shared-prov-creds->aktualizr \ | ||
| 21 | aktualizr-uboot-env-rollback->aktualizr \ | ||
| 22 | " | ||
diff --git a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb index b6076cd..394531e 100644 --- a/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb +++ b/recipes-connectivity/networkd-dhcp-conf/networkd-dhcp-conf.bb | |||
| @@ -4,7 +4,7 @@ interfaces through systemd-networkd" | |||
| 4 | LICENSE = "MPL-2.0" | 4 | LICENSE = "MPL-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" |
| 6 | 6 | ||
| 7 | inherit allarch systemd | 7 | inherit systemd |
| 8 | 8 | ||
| 9 | RPROVIDES_${PN} = "virtual/network-configuration" | 9 | RPROVIDES_${PN} = "virtual/network-configuration" |
| 10 | 10 | ||
diff --git a/recipes-sota/aktualizr/aktualizr-device-prov-creds.bb b/recipes-sota/aktualizr/aktualizr-device-prov-creds.bb deleted file mode 100644 index 6e02a50..0000000 --- a/recipes-sota/aktualizr/aktualizr-device-prov-creds.bb +++ /dev/null | |||
| @@ -1,60 +0,0 @@ | |||
| 1 | SUMMARY = "Credentials for device provisioning with fleet CA certificate" | ||
| 2 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
| 3 | SECTION = "base" | ||
| 4 | LICENSE = "MPL-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
| 6 | |||
| 7 | inherit allarch | ||
| 8 | |||
| 9 | # WARNING: it is NOT a production solution. The secure way to provision devices | ||
| 10 | # is to create certificate request directly on the device (either with HSM/TPM | ||
| 11 | # or with software) and then sign it with a CA stored on a disconnected machine. | ||
| 12 | |||
| 13 | DEPENDS = "aktualizr aktualizr-native" | ||
| 14 | ALLOW_EMPTY_${PN} = "1" | ||
| 15 | |||
| 16 | SRC_URI = " \ | ||
| 17 | file://ca.cnf \ | ||
| 18 | " | ||
| 19 | |||
| 20 | require credentials.inc | ||
| 21 | |||
| 22 | export SOTA_CACERT_PATH | ||
| 23 | export SOTA_CAKEY_PATH | ||
| 24 | |||
| 25 | do_install() { | ||
| 26 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | ||
| 27 | if [ -z ${SOTA_CACERT_PATH} ]; then | ||
| 28 | SOTA_CACERT_PATH=${DEPLOY_DIR_IMAGE}/CA/cacert.pem | ||
| 29 | SOTA_CAKEY_PATH=${DEPLOY_DIR_IMAGE}/CA/ca.private.pem | ||
| 30 | mkdir -p ${DEPLOY_DIR_IMAGE}/CA | ||
| 31 | bbwarn "SOTA_CACERT_PATH is not specified, use default one at ${SOTA_CACERT_PATH}" | ||
| 32 | |||
| 33 | if [ ! -f ${SOTA_CACERT_PATH} ]; then | ||
| 34 | bbwarn "${SOTA_CACERT_PATH} does not exist, generate a new CA" | ||
| 35 | SOTA_CACERT_DIR_PATH="$(dirname "${SOTA_CACERT_PATH}")" | ||
| 36 | openssl genrsa -out ${SOTA_CACERT_DIR_PATH}/ca.private.pem 4096 | ||
| 37 | openssl req -key ${SOTA_CACERT_DIR_PATH}/ca.private.pem -new -x509 -days 7300 -out ${SOTA_CACERT_PATH} -subj "/C=DE/ST=Berlin/O=Reis und Kichererbsen e.V/commonName=meta-updater" -batch -config ${WORKDIR}/ca.cnf -extensions cacert | ||
| 38 | bbwarn "${SOTA_CACERT_PATH} has been created, you'll need to upload it to the server" | ||
| 39 | fi | ||
| 40 | fi | ||
| 41 | |||
| 42 | if [ -z ${SOTA_CAKEY_PATH} ]; then | ||
| 43 | bbfatal "SOTA_CAKEY_PATH should be set when using device credential provisioning" | ||
| 44 | fi | ||
| 45 | |||
| 46 | install -m 0700 -d ${D}${localstatedir}/sota | ||
| 47 | aktualizr-cert-provider --credentials ${SOTA_PACKED_CREDENTIALS} \ | ||
| 48 | --fleet-ca ${SOTA_CACERT_PATH} \ | ||
| 49 | --fleet-ca-key ${SOTA_CAKEY_PATH} \ | ||
| 50 | --root-ca \ | ||
| 51 | --server-url \ | ||
| 52 | --local ${D} \ | ||
| 53 | --config ${STAGING_DIR_HOST}${libdir}/sota/sota-device-cred.toml | ||
| 54 | fi | ||
| 55 | } | ||
| 56 | |||
| 57 | FILES_${PN} = " \ | ||
| 58 | ${localstatedir}/sota/*" | ||
| 59 | |||
| 60 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-sota/aktualizr/aktualizr-device-prov-hsm.bb b/recipes-sota/aktualizr/aktualizr-device-prov-hsm.bb index c3cd593..4eadb77 100644 --- a/recipes-sota/aktualizr/aktualizr-device-prov-hsm.bb +++ b/recipes-sota/aktualizr/aktualizr-device-prov-hsm.bb | |||
| @@ -7,14 +7,16 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 | |||
| 7 | 7 | ||
| 8 | inherit allarch | 8 | inherit allarch |
| 9 | 9 | ||
| 10 | DEPENDS = "aktualizr aktualizr-native" | 10 | # We need to get the config files from the aktualizr-host-tools package built by |
| 11 | RDEPENDS_${PN}_append = "${@' aktualizr-device-prov-creds softhsm-testtoken' if d.getVar('SOTA_DEPLOY_CREDENTIALS') == '1' else ''}" | 11 | # the aktualizr (target) recipe. |
| 12 | DEPENDS = "aktualizr" | ||
| 12 | 13 | ||
| 13 | SRC_URI = "" | 14 | # If the config file from aktualizr used here is changed, you will need to bump |
| 15 | # the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! | ||
| 14 | PV = "1.0" | 16 | PV = "1.0" |
| 15 | PR = "6" | 17 | PR = "6" |
| 16 | 18 | ||
| 17 | require credentials.inc | 19 | SRC_URI = "" |
| 18 | 20 | ||
| 19 | do_install() { | 21 | do_install() { |
| 20 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 22 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
diff --git a/recipes-sota/aktualizr/aktualizr-device-prov.bb b/recipes-sota/aktualizr/aktualizr-device-prov.bb index d579532..55f398d 100644 --- a/recipes-sota/aktualizr/aktualizr-device-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-device-prov.bb | |||
| @@ -7,13 +7,16 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 | |||
| 7 | 7 | ||
| 8 | inherit allarch | 8 | inherit allarch |
| 9 | 9 | ||
| 10 | DEPENDS = "aktualizr aktualizr-native openssl-native" | 10 | # We need to get the config files from the aktualizr-host-tools package built by |
| 11 | RDEPENDS_${PN}_append = "${@' aktualizr-device-prov-creds' if d.getVar('SOTA_DEPLOY_CREDENTIALS') == '1' else ''}" | 11 | # the aktualizr (target) recipe. |
| 12 | DEPENDS = "aktualizr" | ||
| 12 | 13 | ||
| 14 | # If the config file from aktualizr used here is changed, you will need to bump | ||
| 15 | # the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! | ||
| 13 | PV = "1.0" | 16 | PV = "1.0" |
| 14 | PR = "1" | 17 | PR = "1" |
| 15 | 18 | ||
| 16 | require credentials.inc | 19 | SRC_URI = "" |
| 17 | 20 | ||
| 18 | do_install() { | 21 | do_install() { |
| 19 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 22 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
diff --git a/recipes-sota/aktualizr/aktualizr-hwid.bb b/recipes-sota/aktualizr/aktualizr-hwid.bb new file mode 100644 index 0000000..fd3e395 --- /dev/null +++ b/recipes-sota/aktualizr/aktualizr-hwid.bb | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | SUMMARY = "Aktualizr hwid configuration" | ||
| 2 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
| 3 | SECTION = "base" | ||
| 4 | LICENSE = "MPL-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
| 6 | |||
| 7 | # Because of the dependency on MACHINE. | ||
| 8 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 9 | |||
| 10 | SRC_URI = "" | ||
| 11 | |||
| 12 | do_install() { | ||
| 13 | install -m 0700 -d ${D}${libdir}/sota/conf.d | ||
| 14 | if [ -n "${SOTA_HARDWARE_ID}" ]; then | ||
| 15 | printf "[provision]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml | ||
| 16 | fi | ||
| 17 | } | ||
| 18 | |||
| 19 | FILES_${PN} = " \ | ||
| 20 | ${libdir}/sota/conf.d \ | ||
| 21 | ${libdir}/sota/conf.d/40-hardware-id.toml \ | ||
| 22 | " | ||
| 23 | |||
| 24 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
diff --git a/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb b/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb index 2701c07..9c6f0dd 100644 --- a/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb +++ b/recipes-sota/aktualizr/aktualizr-shared-prov-creds.bb | |||
| @@ -6,9 +6,16 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 | |||
| 6 | 6 | ||
| 7 | inherit allarch | 7 | inherit allarch |
| 8 | 8 | ||
| 9 | DEPENDS = "aktualizr-native zip-native" | 9 | DEPENDS = "zip-native" |
| 10 | ALLOW_EMPTY_${PN} = "1" | 10 | ALLOW_EMPTY_${PN} = "1" |
| 11 | 11 | ||
| 12 | # If the config file from aktualizr used here is changed, you will need to bump | ||
| 13 | # the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! | ||
| 14 | PV = "1.0" | ||
| 15 | PR = "1" | ||
| 16 | |||
| 17 | SRC_URI = "" | ||
| 18 | |||
| 12 | require credentials.inc | 19 | require credentials.inc |
| 13 | 20 | ||
| 14 | do_install() { | 21 | do_install() { |
diff --git a/recipes-sota/aktualizr/aktualizr-shared-prov.bb b/recipes-sota/aktualizr/aktualizr-shared-prov.bb index d3d6f16..2ee47a1 100644 --- a/recipes-sota/aktualizr/aktualizr-shared-prov.bb +++ b/recipes-sota/aktualizr/aktualizr-shared-prov.bb | |||
| @@ -7,15 +7,18 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 | |||
| 7 | 7 | ||
| 8 | inherit allarch | 8 | inherit allarch |
| 9 | 9 | ||
| 10 | DEPENDS = "aktualizr-native zip-native" | 10 | # We need to get the config files from the aktualizr-host-tools package built by |
| 11 | # the aktualizr (target) recipe. | ||
| 12 | DEPENDS = "aktualizr" | ||
| 11 | RDEPENDS_${PN}_append = "${@' aktualizr-shared-prov-creds' if d.getVar('SOTA_DEPLOY_CREDENTIALS') == '1' else ''}" | 13 | RDEPENDS_${PN}_append = "${@' aktualizr-shared-prov-creds' if d.getVar('SOTA_DEPLOY_CREDENTIALS') == '1' else ''}" |
| 14 | |||
| 15 | # If the config file from aktualizr used here is changed, you will need to bump | ||
| 16 | # the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! | ||
| 12 | PV = "1.0" | 17 | PV = "1.0" |
| 13 | PR = "6" | 18 | PR = "6" |
| 14 | 19 | ||
| 15 | SRC_URI = "" | 20 | SRC_URI = "" |
| 16 | 21 | ||
| 17 | require credentials.inc | ||
| 18 | |||
| 19 | do_install() { | 22 | do_install() { |
| 20 | if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then | 23 | if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then |
| 21 | bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS" | 24 | bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS" |
| @@ -31,7 +34,7 @@ do_install() { | |||
| 31 | fi | 34 | fi |
| 32 | 35 | ||
| 33 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 36 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 34 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota-shared-cred.toml \ | 37 | install -m 0644 ${STAGING_DIR_HOST}${libdir}/sota/sota-shared-cred.toml \ |
| 35 | ${D}${libdir}/sota/conf.d/20-sota-shared-cred.toml | 38 | ${D}${libdir}/sota/conf.d/20-sota-shared-cred.toml |
| 36 | } | 39 | } |
| 37 | 40 | ||
diff --git a/recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb b/recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb index 860f225..2895e5c 100644 --- a/recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb +++ b/recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb | |||
| @@ -6,14 +6,18 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 | |||
| 6 | 6 | ||
| 7 | inherit allarch | 7 | inherit allarch |
| 8 | 8 | ||
| 9 | DEPENDS = "aktualizr-native" | 9 | DEPENDS = "aktualizr" |
| 10 | RDEPENDS_${PN} = "aktualizr" | 10 | |
| 11 | # If the config file from aktualizr used here is changed, you will need to bump | ||
| 12 | # the version here because of SIGGEN_EXCLUDE_SAFE_RECIPE_DEPS! | ||
| 13 | PV = "1.0" | ||
| 14 | PR = "1" | ||
| 11 | 15 | ||
| 12 | SRC_URI = "" | 16 | SRC_URI = "" |
| 13 | 17 | ||
| 14 | do_install() { | 18 | do_install() { |
| 15 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 19 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 16 | install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota-uboot-env.toml ${D}${libdir}/sota/conf.d/30-rollback.toml | 20 | install -m 0644 ${STAGING_DIR_HOST}${libdir}/sota/sota-uboot-env.toml ${D}${libdir}/sota/conf.d/30-rollback.toml |
| 17 | } | 21 | } |
| 18 | 22 | ||
| 19 | FILES_${PN} = " \ | 23 | FILES_${PN} = " \ |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 17aa15a..0427c3c 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
| @@ -3,11 +3,11 @@ DESCRIPTION = "SOTA Client application written in C++" | |||
| 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
| 4 | SECTION = "base" | 4 | SECTION = "base" |
| 5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=815ca599c9df247a0c7f619bab123dad" |
| 7 | 7 | ||
| 8 | DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native" | 8 | DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native" |
| 9 | DEPENDS_append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' coreutils-native net-tools-native ostree-native aktualizr-native ', '', d)}" | 9 | DEPENDS_append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' coreutils-native net-tools-native ostree-native aktualizr-native ', '', d)}" |
| 10 | RDEPENDS_${PN}_class-target = "aktualizr-configs lshw" | 10 | RDEPENDS_${PN}_class-target = "aktualizr-configs aktualizr-hwid lshw" |
| 11 | RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}" | 11 | RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}" |
| 12 | 12 | ||
| 13 | RDEPENDS_${PN}-ptest += "bash cmake curl python3-misc python3-modules openssl-bin sqlite3 valgrind" | 13 | RDEPENDS_${PN}-ptest += "bash cmake curl python3-misc python3-modules openssl-bin sqlite3 valgrind" |
| @@ -15,23 +15,22 @@ RDEPENDS_${PN}-ptest += "bash cmake curl python3-misc python3-modules openssl-bi | |||
| 15 | PV = "1.0+git${SRCPV}" | 15 | PV = "1.0+git${SRCPV}" |
| 16 | PR = "7" | 16 | PR = "7" |
| 17 | 17 | ||
| 18 | GARAGE_SIGN_PV = "0.7.0-33-g214dfb1" | 18 | GARAGE_SIGN_PV = "0.7.0-49-g5ffd420" |
| 19 | 19 | ||
| 20 | SRC_URI = " \ | 20 | SRC_URI = " \ |
| 21 | gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ | 21 | gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH};name=aktualizr \ |
| 22 | file://run-ptest \ | 22 | file://run-ptest \ |
| 23 | file://aktualizr.service \ | 23 | file://aktualizr.service \ |
| 24 | file://aktualizr-secondary.service \ | 24 | file://aktualizr-secondary.service \ |
| 25 | file://aktualizr-serialcan.service \ | 25 | file://aktualizr-serialcan.service \ |
| 26 | file://10-resource-control.conf \ | 26 | file://10-resource-control.conf \ |
| 27 | ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \ | 27 | ${@ d.expand("https://ats-tuf-cli-releases.s3-eu-central-1.amazonaws.com/cli-${GARAGE_SIGN_PV}.tgz;unpack=0;name=garagesign") if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''} \ |
| 28 | " | 28 | " |
| 29 | 29 | ||
| 30 | # for garage-sign archive | 30 | SRC_URI[garagesign.md5sum] = "de0877ecb693fd48ec11052e51b0ff1a" |
| 31 | SRC_URI[md5sum] = "66ffe8dcd61d4c15646e1c4b7dde7401" | 31 | SRC_URI[garagesign.sha256sum] = "cf25759574c9c1206835daeaf6fc345f6db7b5ccdb95fb828c86d7451f78f0aa" |
| 32 | SRC_URI[sha256sum] = "7a7193ddf7e1a33ea60fbb20f98318a8bd78c325dab391d8c4ebd644a738abdc" | ||
| 33 | 32 | ||
| 34 | SRCREV = "3bb9fe91b4c614a79373beadc721272fcf7acce2" | 33 | SRCREV = "fa59e33208d3b1dc690a30ce8339b3b4162f8022" |
| 35 | BRANCH ?= "master" | 34 | BRANCH ?= "master" |
| 36 | 35 | ||
| 37 | S = "${WORKDIR}/git" | 36 | S = "${WORKDIR}/git" |
| @@ -46,11 +45,11 @@ SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" | |||
| 46 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | 45 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" |
| 47 | SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.service" | 46 | SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.service" |
| 48 | 47 | ||
| 49 | EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} ${@bb.utils.contains('PTEST_ENABLED', '1', '-DTESTSUITE_VALGRIND=on', '', d)}" | 48 | EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release ${@bb.utils.contains('PTEST_ENABLED', '1', '-DTESTSUITE_VALGRIND=on', '', d)}" |
| 50 | 49 | ||
| 51 | GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}" | 50 | GARAGE_SIGN_OPS = "${@ d.expand('-DGARAGE_SIGN_ARCHIVE=${WORKDIR}/cli-${GARAGE_SIGN_PV}.tgz') if d.getVar('GARAGE_SIGN_AUTOVERSION') != '1' else ''}" |
| 52 | 51 | ||
| 53 | PACKAGECONFIG ?= "ostree ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}" | 52 | PACKAGECONFIG ?= "ostree ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}" |
| 54 | PACKAGECONFIG_class-native = "sota-tools" | 53 | PACKAGECONFIG_class-native = "sota-tools" |
| 55 | PACKAGECONFIG[warning-as-error] = "-DWARNING_AS_ERROR=ON,-DWARNING_AS_ERROR=OFF," | 54 | PACKAGECONFIG[warning-as-error] = "-DWARNING_AS_ERROR=ON,-DWARNING_AS_ERROR=OFF," |
| 56 | PACKAGECONFIG[ostree] = "-DBUILD_OSTREE=ON,-DBUILD_OSTREE=OFF,ostree," | 55 | PACKAGECONFIG[ostree] = "-DBUILD_OSTREE=ON,-DBUILD_OSTREE=OFF,ostree," |
| @@ -70,6 +69,14 @@ RESOURCE_CPU_WEIGHT = "100" | |||
| 70 | RESOURCE_MEMORY_HIGH = "100M" | 69 | RESOURCE_MEMORY_HIGH = "100M" |
| 71 | RESOURCE_MEMORY_MAX = "80%" | 70 | RESOURCE_MEMORY_MAX = "80%" |
| 72 | 71 | ||
| 72 | do_configure_prepend() { | ||
| 73 | # CMake has trouble finding yocto's git when cross-compiling, let's do this step manually | ||
| 74 | cd ${S} | ||
| 75 | if [ ! -f VERSION ]; then | ||
| 76 | ./scripts/get_version.sh > VERSION | ||
| 77 | fi | ||
| 78 | } | ||
| 79 | |||
| 73 | do_compile_ptest() { | 80 | do_compile_ptest() { |
| 74 | cmake_runcmake_build --target build_tests "${PARALLEL_MAKE}" | 81 | cmake_runcmake_build --target build_tests "${PARALLEL_MAKE}" |
| 75 | } | 82 | } |
| @@ -102,10 +109,6 @@ do_install_append () { | |||
| 102 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 109 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 103 | install -m 0700 -d ${D}${sysconfdir}/sota/conf.d | 110 | install -m 0700 -d ${D}${sysconfdir}/sota/conf.d |
| 104 | 111 | ||
| 105 | if [ -n "${SOTA_HARDWARE_ID}" ]; then | ||
| 106 | printf "[provision]\nprimary_ecu_hardware_id = ${SOTA_HARDWARE_ID}\n" > ${D}${libdir}/sota/conf.d/40-hardware-id.toml | ||
| 107 | fi | ||
| 108 | |||
| 109 | install -m 0755 -d ${D}${systemd_unitdir}/system | 112 | install -m 0755 -d ${D}${systemd_unitdir}/system |
| 110 | aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)} | 113 | aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)} |
| 111 | install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service | 114 | install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service |
diff --git a/recipes-sota/config/aktualizr-virtualsec.bb b/recipes-sota/config/aktualizr-virtualsec.bb new file mode 100644 index 0000000..b7d55aa --- /dev/null +++ b/recipes-sota/config/aktualizr-virtualsec.bb | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | SUMMARY = "Example virtual secondary in aktualizr" | ||
| 2 | DESCRIPTION = "Creates an example virtual secondary to be used to update an arbitrary file on the primary" | ||
| 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | ||
| 4 | SECTION = "base" | ||
| 5 | LICENSE = "MPL-2.0" | ||
| 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | ||
| 7 | |||
| 8 | inherit allarch | ||
| 9 | |||
| 10 | SRC_URI = " \ | ||
| 11 | file://30-virtualsec.toml \ | ||
| 12 | file://virtualsec.json \ | ||
| 13 | " | ||
| 14 | |||
| 15 | do_install_append () { | ||
| 16 | install -m 0700 -d ${D}${libdir}/sota/conf.d | ||
| 17 | install -m 0644 ${WORKDIR}/30-virtualsec.toml ${D}${libdir}/sota/conf.d/30-virtualsec.toml | ||
| 18 | install -m 0644 ${WORKDIR}/virtualsec.json ${D}${libdir}/sota/virtualsec.json | ||
| 19 | } | ||
| 20 | |||
| 21 | FILES_${PN} = " \ | ||
| 22 | ${libdir}/sota/conf.d/30-virtualsec.toml \ | ||
| 23 | ${libdir}/sota/virtualsec.json \ | ||
| 24 | " | ||
| 25 | |||
| 26 | # vim:set ts=4 sw=4 sts=4 expandtab: | ||
| 27 | |||
diff --git a/recipes-sota/config/files/30-virtualsec.toml b/recipes-sota/config/files/30-virtualsec.toml new file mode 100644 index 0000000..987f692 --- /dev/null +++ b/recipes-sota/config/files/30-virtualsec.toml | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | [uptane] | ||
| 2 | secondary_config_file = "/usr/lib/sota/virtualsec.json" | ||
| 3 | |||
diff --git a/recipes-sota/config/files/virtualsec.json b/recipes-sota/config/files/virtualsec.json new file mode 100644 index 0000000..dcdcdba --- /dev/null +++ b/recipes-sota/config/files/virtualsec.json | |||
| @@ -0,0 +1,14 @@ | |||
| 1 | { | ||
| 2 | "virtual": [ | ||
| 3 | { | ||
| 4 | "partial_verifying": "false", | ||
| 5 | "ecu_hardware_id": "external-config", | ||
| 6 | "full_client_dir": "/var/sota/external-config", | ||
| 7 | "ecu_private_key": "sec.private", | ||
| 8 | "ecu_public_key": "sec.public", | ||
| 9 | "firmware_path": "/var/sota/external-config/config.txt", | ||
| 10 | "target_name_path": "/var/sota/external-config/target_name", | ||
| 11 | "metadata_path": "/var/sota/external-config/metadata" | ||
| 12 | } | ||
| 13 | ] | ||
| 14 | } | ||
diff --git a/recipes-test/demo-config/primary-config.bb b/recipes-test/demo-config/primary-config.bb index 27cb553..b1964e2 100644 --- a/recipes-test/demo-config/primary-config.bb +++ b/recipes-test/demo-config/primary-config.bb | |||
| @@ -4,6 +4,8 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 | |||
| 4 | 4 | ||
| 5 | require shared-conf.inc | 5 | require shared-conf.inc |
| 6 | 6 | ||
| 7 | inherit allarch | ||
| 8 | |||
| 7 | PRIMARY_SECONDARIES ?= "${SECONDARY_IP}:${SECONDARY_PORT}" | 9 | PRIMARY_SECONDARIES ?= "${SECONDARY_IP}:${SECONDARY_PORT}" |
| 8 | 10 | ||
| 9 | SRC_URI = "\ | 11 | SRC_URI = "\ |
diff --git a/recipes-test/demo-config/secondary-config.bb b/recipes-test/demo-config/secondary-config.bb index 9411646..ddbed89 100644 --- a/recipes-test/demo-config/secondary-config.bb +++ b/recipes-test/demo-config/secondary-config.bb | |||
| @@ -4,6 +4,9 @@ LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7 | |||
| 4 | 4 | ||
| 5 | require shared-conf.inc | 5 | require shared-conf.inc |
| 6 | 6 | ||
| 7 | # Because of the dependency on MACHINE. | ||
| 8 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 9 | |||
| 7 | SECONDARY_SERIAL_ID ?= "" | 10 | SECONDARY_SERIAL_ID ?= "" |
| 8 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" | 11 | SOTA_HARDWARE_ID ?= "${MACHINE}-sndry" |
| 9 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" | 12 | SECONDARY_HARDWARE_ID ?= "${SOTA_HARDWARE_ID}" |
| @@ -16,18 +19,18 @@ SRC_URI = "\ | |||
| 16 | 19 | ||
| 17 | do_install () { | 20 | do_install () { |
| 18 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 21 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 19 | install -m 0644 ${WORKDIR}/30-fake-pacman.toml ${D}/${libdir}/sota/conf.d/30-fake-pacman.toml | 22 | install -m 0644 ${WORKDIR}/30-fake-pacman.toml ${D}${libdir}/sota/conf.d/30-fake-pacman.toml |
| 20 | 23 | ||
| 21 | install -m 0644 ${WORKDIR}/35-network-config.toml ${D}/${libdir}/sota/conf.d/35-network-config.toml | 24 | install -m 0644 ${WORKDIR}/35-network-config.toml ${D}${libdir}/sota/conf.d/35-network-config.toml |
| 22 | sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \ | 25 | sed -i -e 's|@PORT@|${SECONDARY_PORT}|g' \ |
| 23 | -e 's|@PRIMARY_IP@|${PRIMARY_IP}|g' \ | 26 | -e 's|@PRIMARY_IP@|${PRIMARY_IP}|g' \ |
| 24 | -e 's|@PRIMARY_PORT@|${PRIMARY_PORT}|g' \ | 27 | -e 's|@PRIMARY_PORT@|${PRIMARY_PORT}|g' \ |
| 25 | ${D}/${libdir}/sota/conf.d/35-network-config.toml | 28 | ${D}${libdir}/sota/conf.d/35-network-config.toml |
| 26 | 29 | ||
| 27 | install -m 0644 ${WORKDIR}/45-id-config.toml ${D}/${libdir}/sota/conf.d/45-id-config.toml | 30 | install -m 0644 ${WORKDIR}/45-id-config.toml ${D}${libdir}/sota/conf.d/45-id-config.toml |
| 28 | sed -i -e 's|@SERIAL@|${SECONDARY_SERIAL_ID}|g' \ | 31 | sed -i -e 's|@SERIAL@|${SECONDARY_SERIAL_ID}|g' \ |
| 29 | -e 's|@HWID@|${SECONDARY_HARDWARE_ID}|g' \ | 32 | -e 's|@HWID@|${SECONDARY_HARDWARE_ID}|g' \ |
| 30 | ${D}/${libdir}/sota/conf.d/45-id-config.toml | 33 | ${D}${libdir}/sota/conf.d/45-id-config.toml |
| 31 | 34 | ||
| 32 | } | 35 | } |
| 33 | 36 | ||
diff --git a/recipes-test/demo-network-config/network-config.inc b/recipes-test/demo-network-config/network-config.inc index ed623d4..b023f51 100644 --- a/recipes-test/demo-network-config/network-config.inc +++ b/recipes-test/demo-network-config/network-config.inc | |||
| @@ -2,15 +2,18 @@ SRC_URI_append = "\ | |||
| 2 | file://26-${CONF_TYPE}-client.network \ | 2 | file://26-${CONF_TYPE}-client.network \ |
| 3 | " | 3 | " |
| 4 | 4 | ||
| 5 | # Because of the dependency on MACHINE. | ||
| 6 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
| 7 | |||
| 5 | SECONDARY_INTERFACE ?= "${@ 'eth0' if d.getVar('MACHINE') == 'raspberrypi3' else 'enp0s5'}" | 8 | SECONDARY_INTERFACE ?= "${@ 'eth0' if d.getVar('MACHINE') == 'raspberrypi3' else 'enp0s5'}" |
| 6 | 9 | ||
| 7 | do_install_append() { | 10 | do_install_append() { |
| 8 | bbnote "Network configuration type to be applied: ${CONF_TYPE}" | 11 | bbnote "Network configuration type to be applied: ${CONF_TYPE}" |
| 9 | install -d ${D}/usr/lib/systemd/network | 12 | install -d ${D}${libdir}/systemd/network |
| 10 | install -m 0644 ${WORKDIR}/26-${CONF_TYPE}-client.network ${D}/usr/lib/systemd/network/ | 13 | install -m 0644 ${WORKDIR}/26-${CONF_TYPE}-client.network ${D}${libdir}/systemd/network/ |
| 11 | sed -i -e 's|@ADDR@|${IP_ADDR}|g' \ | 14 | sed -i -e 's|@ADDR@|${IP_ADDR}|g' \ |
| 12 | -e 's|@IFNAME@|${SECONDARY_INTERFACE}|g' \ | 15 | -e 's|@IFNAME@|${SECONDARY_INTERFACE}|g' \ |
| 13 | ${D}/usr/lib/systemd/network/26-${CONF_TYPE}-client.network | 16 | ${D}${libdir}/systemd/network/26-${CONF_TYPE}-client.network |
| 14 | 17 | ||
| 15 | } | 18 | } |
| 16 | 19 | ||
diff --git a/recipes-test/demo-network-config/primary-network-config.bb b/recipes-test/demo-network-config/primary-network-config.bb index d840a95..544a5ec 100644 --- a/recipes-test/demo-network-config/primary-network-config.bb +++ b/recipes-test/demo-network-config/primary-network-config.bb | |||
| @@ -2,19 +2,17 @@ DESCRIPTION = "Sample network configuration for an Uptane Primary" | |||
| 2 | LICENSE = "MPL-2.0" | 2 | LICENSE = "MPL-2.0" |
| 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" |
| 4 | 4 | ||
| 5 | inherit allarch | ||
| 6 | |||
| 7 | SRC_URI = "\ | 5 | SRC_URI = "\ |
| 8 | file://27-dhcp-client-external.network \ | 6 | file://27-dhcp-client-external.network \ |
| 9 | " | 7 | " |
| 10 | 8 | ||
| 11 | FILES_${PN} = "/usr/lib/systemd/network" | 9 | FILES_${PN} = "${libdir}/systemd/network" |
| 12 | 10 | ||
| 13 | PR = "1" | 11 | PR = "1" |
| 14 | 12 | ||
| 15 | do_install() { | 13 | do_install() { |
| 16 | install -d ${D}/usr/lib/systemd/network | 14 | install -d ${D}${libdir}/systemd/network |
| 17 | install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ | 15 | install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/ |
| 18 | } | 16 | } |
| 19 | 17 | ||
| 20 | PRIMARY_IP ?= "10.0.3.1" | 18 | PRIMARY_IP ?= "10.0.3.1" |
diff --git a/recipes-test/demo-network-config/secondary-network-config.bb b/recipes-test/demo-network-config/secondary-network-config.bb index b1d70f1..ca83d53 100644 --- a/recipes-test/demo-network-config/secondary-network-config.bb +++ b/recipes-test/demo-network-config/secondary-network-config.bb | |||
| @@ -2,8 +2,6 @@ DESCRIPTION = "Sample network configuration for an Uptane Secondary" | |||
| 2 | LICENSE = "MPL-2.0" | 2 | LICENSE = "MPL-2.0" |
| 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" | 3 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad" |
| 4 | 4 | ||
| 5 | inherit allarch | ||
| 6 | |||
| 7 | # TODO: It configures the 'user' interface in NAT mode and provides an access to public Inet via it | 5 | # TODO: It configures the 'user' interface in NAT mode and provides an access to public Inet via it |
| 8 | # which is not desired for Secondary. It cannot be just removed since we get SSH access to Secondary | 6 | # which is not desired for Secondary. It cannot be just removed since we get SSH access to Secondary |
| 9 | # VM via this interface. So, the task is to configure the interface in such way that it does provide access | 7 | # VM via this interface. So, the task is to configure the interface in such way that it does provide access |
| @@ -12,13 +10,13 @@ SRC_URI = "\ | |||
| 12 | file://27-dhcp-client-external.network \ | 10 | file://27-dhcp-client-external.network \ |
| 13 | " | 11 | " |
| 14 | 12 | ||
| 15 | FILES_${PN} = "/usr/lib/systemd/network" | 13 | FILES_${PN} = "${libdir}/systemd/network" |
| 16 | 14 | ||
| 17 | PR = "1" | 15 | PR = "1" |
| 18 | 16 | ||
| 19 | do_install() { | 17 | do_install() { |
| 20 | install -d ${D}/usr/lib/systemd/network | 18 | install -d ${D}${libdir}/systemd/network |
| 21 | install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}/usr/lib/systemd/network/ | 19 | install -m 0644 ${WORKDIR}/27-dhcp-client-external.network ${D}${libdir}/systemd/network/ |
| 22 | } | 20 | } |
| 23 | 21 | ||
| 24 | SECONDARY_IP ?= "10.0.3.2" | 22 | SECONDARY_IP ?= "10.0.3.2" |
diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb index 27d1e3f..7db2c68 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb | |||
| @@ -14,7 +14,6 @@ IMAGE_INSTALL_remove = " \ | |||
| 14 | aktualizr-shared-prov \ | 14 | aktualizr-shared-prov \ |
| 15 | aktualizr-shared-prov-creds \ | 15 | aktualizr-shared-prov-creds \ |
| 16 | aktualizr-device-prov \ | 16 | aktualizr-device-prov \ |
| 17 | aktualizr-device-prov-creds \ | ||
| 18 | aktualizr-device-prov-hsm \ | 17 | aktualizr-device-prov-hsm \ |
| 19 | aktualizr-uboot-env-rollback \ | 18 | aktualizr-uboot-env-rollback \ |
| 20 | virtual/network-configuration \ | 19 | virtual/network-configuration \ |
diff --git a/scripts/ci/Jenkinsfile.bleeding b/scripts/ci/Jenkinsfile.bleeding deleted file mode 100644 index 6d340fd..0000000 --- a/scripts/ci/Jenkinsfile.bleeding +++ /dev/null | |||
| @@ -1,87 +0,0 @@ | |||
| 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 | // define these for docker image creation | ||
| 5 | node { | ||
| 6 | // might cause some problems: | ||
| 7 | // https://stackoverflow.com/questions/44805076/setting-build-args-for-dockerfile-agent-using-a-jenkins-declarative-pipeline | ||
| 8 | JENKINS_UID = sh(returnStdout: true, script: 'id -u').trim() | ||
| 9 | JENKINS_GID = sh(returnStdout: true, script: 'id -g').trim() | ||
| 10 | } | ||
| 11 | |||
| 12 | pipeline { | ||
| 13 | agent any | ||
| 14 | environment { | ||
| 15 | TEST_AKTUALIZR_REMOTE = 'aktualizr' | ||
| 16 | TEST_AKTUALIZR_DIR = 'aktualizr' | ||
| 17 | TEST_AKTUALIZR_BRANCH = 'master' | ||
| 18 | TEST_BITBAKE_COMMON_DIR = "/opt/jenkins/bitbake-common" | ||
| 19 | } | ||
| 20 | stages { | ||
| 21 | stage('checkout') { | ||
| 22 | steps { | ||
| 23 | |||
| 24 | checkout([$class: 'GitSCM', | ||
| 25 | userRemoteConfigs: [ | ||
| 26 | [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] | ||
| 27 | ], | ||
| 28 | branches: [[name: 'refs/heads/master']], | ||
| 29 | extensions: [ | ||
| 30 | [$class: 'DisableRemotePoll'], | ||
| 31 | [$class: 'PruneStaleBranch'], | ||
| 32 | [$class: 'RelativeTargetDirectory', | ||
| 33 | relativeTargetDir: 'aktualizr' | ||
| 34 | ] | ||
| 35 | ], | ||
| 36 | ]) | ||
| 37 | |||
| 38 | checkout([$class: 'RepoScm', | ||
| 39 | manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', | ||
| 40 | manifestBranch: null, | ||
| 41 | manifestFile: 'master.xml', | ||
| 42 | manifestGroup: null, | ||
| 43 | mirrorDir: null, | ||
| 44 | jobs: 0, | ||
| 45 | depth: 0, | ||
| 46 | localManifest: null, | ||
| 47 | destinationDir: 'updater-repo', | ||
| 48 | repoUrl: null, | ||
| 49 | currentBranch: false, | ||
| 50 | resetFirst: true, | ||
| 51 | quiet: false, | ||
| 52 | trace: false, | ||
| 53 | showAllChanges: false, | ||
| 54 | ]) | ||
| 55 | |||
| 56 | // ignore bitbake build directories in docker | ||
| 57 | sh 'echo \'build*\' > .dockerignore' | ||
| 58 | |||
| 59 | // override meta-updater commit with currently tested branch | ||
| 60 | sh ''' | ||
| 61 | META_UPDATER_COMMIT=$(git rev-parse HEAD) | ||
| 62 | cd updater-repo/meta-updater | ||
| 63 | git checkout $META_UPDATER_COMMIT | ||
| 64 | ''' | ||
| 65 | } | ||
| 66 | } | ||
| 67 | stage('build-core-image-minimal') { | ||
| 68 | agent { | ||
| 69 | dockerfile { | ||
| 70 | filename 'scripts/ci/Dockerfile.bitbake' | ||
| 71 | args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' | ||
| 72 | additionalBuildArgs "--build-arg uid=${JENKINS_UID} --build-arg gid=${JENKINS_GID}" | ||
| 73 | reuseNode true | ||
| 74 | } | ||
| 75 | } | ||
| 76 | environment { | ||
| 77 | TEST_AKTUALIZR_CREDENTIALS = credentials('garage-credentials') | ||
| 78 | } | ||
| 79 | steps { | ||
| 80 | sh 'scripts/ci/configure.sh' | ||
| 81 | |||
| 82 | sh 'scripts/ci/build.sh core-image-minimal' | ||
| 83 | } | ||
| 84 | } | ||
| 85 | } | ||
| 86 | } | ||
| 87 | // vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: | ||
diff --git a/scripts/ci/Jenkinsfile.bleeding-selftest b/scripts/ci/Jenkinsfile.bleeding-selftest deleted file mode 100644 index 8c2d1de..0000000 --- a/scripts/ci/Jenkinsfile.bleeding-selftest +++ /dev/null | |||
| @@ -1,91 +0,0 @@ | |||
| 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 | // define these for docker image creation | ||
| 5 | node { | ||
| 6 | // might cause some problems: | ||
| 7 | // https://stackoverflow.com/questions/44805076/setting-build-args-for-dockerfile-agent-using-a-jenkins-declarative-pipeline | ||
| 8 | JENKINS_UID = sh(returnStdout: true, script: 'id -u').trim() | ||
| 9 | JENKINS_GID = sh(returnStdout: true, script: 'id -g').trim() | ||
| 10 | } | ||
| 11 | |||
| 12 | pipeline { | ||
| 13 | agent { | ||
| 14 | node { label 'bitbake' } | ||
| 15 | } | ||
| 16 | environment { | ||
| 17 | TEST_AKTUALIZR_REMOTE = 'aktualizr' | ||
| 18 | TEST_AKTUALIZR_DIR = 'aktualizr' | ||
| 19 | TEST_AKTUALIZR_BRANCH = 'master' | ||
| 20 | TEST_BITBAKE_COMMON_DIR = "/opt/jenkins/bitbake-common" | ||
| 21 | } | ||
| 22 | stages { | ||
| 23 | stage('checkout') { | ||
| 24 | steps { | ||
| 25 | |||
| 26 | checkout([$class: 'GitSCM', | ||
| 27 | userRemoteConfigs: [ | ||
| 28 | [url: 'https://github.com/advancedtelematic/aktualizr', name: 'aktualizr'] | ||
| 29 | ], | ||
| 30 | branches: [[name: 'refs/heads/master']], | ||
| 31 | extensions: [ | ||
| 32 | [$class: 'DisableRemotePoll'], | ||
| 33 | [$class: 'PruneStaleBranch'], | ||
| 34 | [$class: 'RelativeTargetDirectory', | ||
| 35 | relativeTargetDir: 'aktualizr' | ||
| 36 | ] | ||
| 37 | ], | ||
| 38 | ]) | ||
| 39 | |||
| 40 | checkout([$class: 'RepoScm', | ||
| 41 | manifestRepositoryUrl: 'https://github.com/advancedtelematic/updater-repo', | ||
| 42 | manifestBranch: null, | ||
| 43 | manifestFile: 'master.xml', | ||
| 44 | manifestGroup: null, | ||
| 45 | mirrorDir: null, | ||
| 46 | jobs: 0, | ||
| 47 | depth: 0, | ||
| 48 | localManifest: null, | ||
| 49 | destinationDir: 'updater-repo', | ||
| 50 | repoUrl: null, | ||
| 51 | currentBranch: false, | ||
| 52 | resetFirst: true, | ||
| 53 | quiet: false, | ||
| 54 | trace: false, | ||
| 55 | showAllChanges: false, | ||
| 56 | ]) | ||
| 57 | |||
| 58 | // ignore bitbake build directories in docker | ||
| 59 | sh 'echo \'build*\' > .dockerignore' | ||
| 60 | |||
| 61 | // override meta-updater commit with currently tested branch | ||
| 62 | sh ''' | ||
| 63 | META_UPDATER_COMMIT=$(git rev-parse HEAD) | ||
| 64 | cd updater-repo/meta-updater | ||
| 65 | git checkout $META_UPDATER_COMMIT | ||
| 66 | ''' | ||
| 67 | } | ||
| 68 | } | ||
| 69 | stage('build-core-image-minimal+oe-selftest') { | ||
| 70 | agent { | ||
| 71 | dockerfile { | ||
| 72 | filename 'scripts/ci/Dockerfile.bitbake' | ||
| 73 | args '-v /opt/jenkins/bitbake-common:/opt/jenkins/bitbake-common' | ||
| 74 | additionalBuildArgs "--build-arg uid=${JENKINS_UID} --build-arg gid=${JENKINS_GID}" | ||
| 75 | reuseNode true | ||
| 76 | } | ||
| 77 | } | ||
| 78 | environment { | ||
| 79 | TEST_AKTUALIZR_CREDENTIALS = credentials('garage-credentials') | ||
| 80 | } | ||
| 81 | steps { | ||
| 82 | sh 'scripts/ci/configure.sh' | ||
| 83 | |||
| 84 | sh 'scripts/ci/build.sh core-image-minimal' | ||
| 85 | |||
| 86 | sh 'scripts/ci/oe-selftest.sh' | ||
| 87 | } | ||
| 88 | } | ||
| 89 | } | ||
| 90 | } | ||
| 91 | // vim: set ft=groovy tabstop=2 shiftwidth=2 expandtab: | ||
diff --git a/scripts/ci/README.adoc b/scripts/ci/README.adoc deleted file mode 100644 index 222982b..0000000 --- a/scripts/ci/README.adoc +++ /dev/null | |||
| @@ -1,14 +0,0 @@ | |||
| 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/find_aktualizr_dependencies.sh b/scripts/find_aktualizr_dependencies.sh index 493df80..fcb2f97 100755 --- a/scripts/find_aktualizr_dependencies.sh +++ b/scripts/find_aktualizr_dependencies.sh | |||
| @@ -13,7 +13,6 @@ ${parentdir}/find_dependencies.py aktualizr | |||
| 13 | ${parentdir}/find_dependencies.py aktualizr-shared-prov | 13 | ${parentdir}/find_dependencies.py aktualizr-shared-prov |
| 14 | ${parentdir}/find_dependencies.py aktualizr-shared-prov-creds | 14 | ${parentdir}/find_dependencies.py aktualizr-shared-prov-creds |
| 15 | ${parentdir}/find_dependencies.py aktualizr-device-prov | 15 | ${parentdir}/find_dependencies.py aktualizr-device-prov |
| 16 | ${parentdir}/find_dependencies.py aktualizr-device-prov-creds | ||
| 17 | ${parentdir}/find_dependencies.py aktualizr-device-prov-hsm | 16 | ${parentdir}/find_dependencies.py aktualizr-device-prov-hsm |
| 18 | ${parentdir}/find_dependencies.py aktualizr-auto-reboot | 17 | ${parentdir}/find_dependencies.py aktualizr-auto-reboot |
| 19 | ${parentdir}/find_dependencies.py aktualizr-disable-send-ip | 18 | ${parentdir}/find_dependencies.py aktualizr-disable-send-ip |
