diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 6a1b33e..8c9f262 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -133,9 +133,11 @@ IMAGE_CMD_ostree () { | |||
133 | 133 | ||
134 | # deploy SOTA credentials | 134 | # deploy SOTA credentials |
135 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 135 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
136 | cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip | 136 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then |
137 | # Device should not be able to push data to treehub | 137 | cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip |
138 | zip -d var/sota/sota_provisioning_credentials.zip treehub.json | 138 | # Device should not be able to push data to treehub |
139 | zip -d var/sota/sota_provisioning_credentials.zip treehub.json | ||
140 | fi | ||
139 | fi | 141 | fi |
140 | 142 | ||
141 | if [ -n "${SOTA_SECONDARY_ECUS}" ]; then | 143 | if [ -n "${SOTA_SECONDARY_ECUS}" ]; then |
@@ -183,10 +185,17 @@ IMAGE_CMD_ostree () { | |||
183 | IMAGE_TYPEDEP_ostreepush = "ostree" | 185 | IMAGE_TYPEDEP_ostreepush = "ostree" |
184 | IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot" | 186 | IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot" |
185 | IMAGE_CMD_ostreepush () { | 187 | IMAGE_CMD_ostreepush () { |
188 | # Print warnings if credetials are not set or if the file has not been found. | ||
186 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 189 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
187 | garage-push --repo=${OSTREE_REPO} \ | 190 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then |
188 | --ref=${OSTREE_BRANCHNAME} \ | 191 | garage-push --repo=${OSTREE_REPO} \ |
189 | --credentials=${SOTA_PACKED_CREDENTIALS} \ | 192 | --ref=${OSTREE_BRANCHNAME} \ |
190 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt | 193 | --credentials=${SOTA_PACKED_CREDENTIALS} \ |
194 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt | ||
195 | else | ||
196 | bbwarn "SOTA_PACKED_CREDENTIALS file does not exist." | ||
197 | fi | ||
198 | else | ||
199 | bbwarn "SOTA_PACKED_CREDENTIALS not set. Please add SOTA_PACKED_CREDENTIALS." | ||
191 | fi | 200 | fi |
192 | } | 201 | } |