diff options
| author | cajun-rat <phil@advancedtelematic.com> | 2018-05-14 10:45:32 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-14 10:45:32 +0200 |
| commit | 41c2df71f443047ea6d6adb988f17eb493f10f89 (patch) | |
| tree | c6e681aa053b527ec8ab4a27e3d219d38779ecc3 | |
| parent | 1a78a5e84fc466718ce996cf59954b2e5ccb05b0 (diff) | |
| parent | a2cdaee8502a8b1abe71ca6294af60628bc65a2b (diff) | |
| download | meta-updater-41c2df71f443047ea6d6adb988f17eb493f10f89.tar.gz | |
Merge pull request #296 from advancedtelematic/feat/backport-from-master
Feat/backport from master
| -rw-r--r-- | classes/image_types_ostree.bbclass | 13 | ||||
| -rw-r--r-- | classes/image_types_ota.bbclass | 2 | ||||
| -rw-r--r-- | classes/sota.bbclass | 5 | ||||
| -rwxr-xr-x[-rw-r--r--] | recipes-sota/aktualizr/aktualizr_git.bb | 10 |
4 files changed, 22 insertions, 8 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index dc14e4a..9e3bc6f 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
| @@ -1,7 +1,5 @@ | |||
| 1 | # OSTree deployment | 1 | # OSTree deployment |
| 2 | 2 | ||
| 3 | inherit image | ||
| 4 | |||
| 5 | do_image_ostree[depends] += "ostree-native:do_populate_sysroot \ | 3 | do_image_ostree[depends] += "ostree-native:do_populate_sysroot \ |
| 6 | openssl-native:do_populate_sysroot \ | 4 | openssl-native:do_populate_sysroot \ |
| 7 | coreutils-native:do_populate_sysroot \ | 5 | coreutils-native:do_populate_sysroot \ |
| @@ -203,6 +201,12 @@ IMAGE_CMD_garagesign () { | |||
| 203 | 201 | ||
| 204 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 202 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) |
| 205 | 203 | ||
| 204 | # Use OSTree target hash as version if none was provided by the user | ||
| 205 | target_version=${ostree_target_hash} | ||
| 206 | if [ -n "${GARAGE_TARGET_VERSION}" ]; then | ||
| 207 | target_version=${GARAGE_TARGET_VERSION} | ||
| 208 | fi | ||
| 209 | |||
| 206 | # Push may fail due to race condition when multiple build machines try to push simultaneously | 210 | # Push may fail due to race condition when multiple build machines try to push simultaneously |
| 207 | # in which case targets.json should be pulled again and the whole procedure repeated | 211 | # in which case targets.json should be pulled again and the whole procedure repeated |
| 208 | push_success=0 | 212 | push_success=0 |
| @@ -213,9 +217,9 @@ IMAGE_CMD_garagesign () { | |||
| 213 | --home-dir ${GARAGE_SIGN_REPO} \ | 217 | --home-dir ${GARAGE_SIGN_REPO} \ |
| 214 | --name ${GARAGE_TARGET_NAME} \ | 218 | --name ${GARAGE_TARGET_NAME} \ |
| 215 | --format OSTREE \ | 219 | --format OSTREE \ |
| 216 | --version ${ostree_target_hash} \ | 220 | --version ${target_version} \ |
| 217 | --length 0 \ | 221 | --length 0 \ |
| 218 | --url "https://example.com/" \ | 222 | --url "${GARAGE_TARGET_URL}" \ |
| 219 | --sha256 ${ostree_target_hash} \ | 223 | --sha256 ${ostree_target_hash} \ |
| 220 | --hardwareids ${MACHINE} | 224 | --hardwareids ${MACHINE} |
| 221 | garage-sign targets sign --repo tufrepo \ | 225 | garage-sign targets sign --repo tufrepo \ |
| @@ -231,6 +235,7 @@ IMAGE_CMD_garagesign () { | |||
| 231 | bbwarn "Push to garage repository has failed, retrying" | 235 | bbwarn "Push to garage repository has failed, retrying" |
| 232 | fi | 236 | fi |
| 233 | done | 237 | done |
| 238 | rm -rf ${GARAGE_SIGN_REPO} | ||
| 234 | 239 | ||
| 235 | if [ "$push_success" -ne "1" ]; then | 240 | if [ "$push_success" -ne "1" ]; then |
| 236 | bberror "Couldn't push to garage repository" | 241 | bberror "Couldn't push to garage repository" |
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 36e7059..17fe4e8 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | # boot scripts, kernel and initramfs images | 7 | # boot scripts, kernel and initramfs images |
| 8 | # | 8 | # |
| 9 | 9 | ||
| 10 | inherit image | ||
| 11 | |||
| 12 | OSTREE_BOOTLOADER ??= 'u-boot' | 10 | OSTREE_BOOTLOADER ??= 'u-boot' |
| 13 | 11 | ||
| 14 | do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \ | 12 | do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \ |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index bbb9ac9..1e765f0 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
| @@ -31,10 +31,11 @@ OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" | |||
| 31 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" | 31 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" |
| 32 | GARAGE_SIGN_KEYNAME ?= "garage-key" | 32 | GARAGE_SIGN_KEYNAME ?= "garage-key" |
| 33 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" | 33 | GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" |
| 34 | GARAGE_TARGET_VERSION ?= "" | ||
| 35 | GARAGE_TARGET_URL ?= "https://example.com/" | ||
| 34 | 36 | ||
| 35 | SOTA_MACHINE ??="none" | 37 | SOTA_MACHINE ??="none" |
| 36 | SOTA_MACHINE_raspberrypi2 ?= "raspberrypi" | 38 | SOTA_MACHINE_rpi ?= "raspberrypi" |
| 37 | SOTA_MACHINE_raspberrypi3 ?= "raspberrypi" | ||
| 38 | SOTA_MACHINE_porter ?= "porter" | 39 | SOTA_MACHINE_porter ?= "porter" |
| 39 | SOTA_MACHINE_m3ulcb = "m3ulcb" | 40 | SOTA_MACHINE_m3ulcb = "m3ulcb" |
| 40 | SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" | 41 | SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index c146268..95c36fa 100644..100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
| @@ -56,6 +56,11 @@ do_install_append () { | |||
| 56 | rm -fr ${D}${libdir}/systemd | 56 | rm -fr ${D}${libdir}/systemd |
| 57 | rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package | 57 | rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package |
| 58 | install -m 0700 -d ${D}${libdir}/sota/conf.d | 58 | install -m 0700 -d ${D}${libdir}/sota/conf.d |
| 59 | install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml | ||
| 60 | install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml | ||
| 61 | install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml | ||
| 62 | install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml | ||
| 63 | install -m 0644 ${S}/config/sota_implicit_prov_ca.toml ${D}/${libdir}/sota/sota_implicit_prov_ca.toml | ||
| 59 | install -m 0644 ${S}/config/sota_secondary.toml ${D}/${libdir}/sota/sota_secondary.toml | 64 | install -m 0644 ${S}/config/sota_secondary.toml ${D}/${libdir}/sota/sota_secondary.toml |
| 60 | install -d ${D}${systemd_unitdir}/system | 65 | install -d ${D}${systemd_unitdir}/system |
| 61 | install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket | 66 | install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket |
| @@ -106,6 +111,11 @@ FILES_${PN}-host-tools = " \ | |||
| 106 | ${bindir}/aktualizr_implicit_writer \ | 111 | ${bindir}/aktualizr_implicit_writer \ |
| 107 | ${bindir}/garage-deploy \ | 112 | ${bindir}/garage-deploy \ |
| 108 | ${bindir}/garage-push \ | 113 | ${bindir}/garage-push \ |
| 114 | ${libdir}/sota/sota_autoprov.toml \ | ||
| 115 | ${libdir}/sota/sota_autoprov_primary.toml \ | ||
| 116 | ${libdir}/sota/sota_hsm_prov.toml \ | ||
| 117 | ${libdir}/sota/sota_implicit_prov.toml \ | ||
| 118 | ${libdir}/sota/sota_implicit_prov_ca.toml \ | ||
| 109 | " | 119 | " |
| 110 | 120 | ||
| 111 | FILES_${PN}-secondary = " \ | 121 | FILES_${PN}-secondary = " \ |
