diff options
author | Patrick Vacek <patrickvacek@gmail.com> | 2017-10-05 14:18:06 +0200 |
---|---|---|
committer | Patrick Vacek <patrickvacek@gmail.com> | 2017-10-05 15:05:00 +0200 |
commit | 098f69acc074d1905cb3e9aa6374fec427a63df7 (patch) | |
tree | 4727b2811be48cc7ba5412ced15f88ea3165802f /classes | |
parent | 672706273326597ed942b9a8d05e9ca315cc6130 (diff) | |
download | meta-updater-098f69acc074d1905cb3e9aa6374fec427a63df7.tar.gz |
Move provisioning out of ostree bbclass into autoprov recipe.
Also remove implicit-prov from DISTRO_FEATURES. Just specify
SOTA_CLIENT_PROV directly.
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image_types_ostree.bbclass | 49 | ||||
-rw-r--r-- | classes/sota.bbclass | 2 |
2 files changed, 2 insertions, 49 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 26be7bf..adcafe3 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -4,11 +4,9 @@ inherit image | |||
4 | 4 | ||
5 | IMAGE_DEPENDS_ostree = "ostree-native:do_populate_sysroot \ | 5 | IMAGE_DEPENDS_ostree = "ostree-native:do_populate_sysroot \ |
6 | openssl-native:do_populate_sysroot \ | 6 | openssl-native:do_populate_sysroot \ |
7 | zip-native:do_populate_sysroot \ | ||
8 | coreutils-native:do_populate_sysroot \ | 7 | coreutils-native:do_populate_sysroot \ |
9 | virtual/kernel:do_deploy \ | 8 | virtual/kernel:do_deploy \ |
10 | ${OSTREE_INITRAMFS_IMAGE}:do_image_complete \ | 9 | ${OSTREE_INITRAMFS_IMAGE}:do_image_complete" |
11 | unzip-native" | ||
12 | 10 | ||
13 | export OSTREE_REPO | 11 | export OSTREE_REPO |
14 | export OSTREE_BRANCHNAME | 12 | export OSTREE_BRANCHNAME |
@@ -20,8 +18,6 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" | |||
20 | 18 | ||
21 | export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" | 19 | export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" |
22 | 20 | ||
23 | SOTA_IMPLICIT_PROV = "${@bb.utils.contains('DISTRO_FEATURES', 'implicit-prov', 'true', '', d)}" | ||
24 | |||
25 | IMAGE_CMD_ostree () { | 21 | IMAGE_CMD_ostree () { |
26 | if [ -z "$OSTREE_REPO" ]; then | 22 | if [ -z "$OSTREE_REPO" ]; then |
27 | bbfatal "OSTREE_REPO should be set in your local.conf" | 23 | bbfatal "OSTREE_REPO should be set in your local.conf" |
@@ -120,53 +116,10 @@ IMAGE_CMD_ostree () { | |||
120 | ln -sf var/roothome root | 116 | ln -sf var/roothome root |
121 | fi | 117 | fi |
122 | 118 | ||
123 | mkdir -p var/sota | ||
124 | |||
125 | if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then | ||
126 | bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS" | ||
127 | fi | ||
128 | if [ -n "${SOTA_AUTOPROVISION_URL}" ]; then | ||
129 | bbwarn "SOTA_AUTOPROVISION_URL is ignored. Please use SOTA_PACKED_CREDENTIALS" | ||
130 | fi | ||
131 | if [ -n "${SOTA_AUTOPROVISION_URL_FILE}" ]; then | ||
132 | bbwarn "SOTA_AUTOPROVISION_URL_FILE is ignored. Please use SOTA_PACKED_CREDENTIALS" | ||
133 | fi | ||
134 | if [ -n "${OSTREE_PUSH_CREDENTIALS}" ]; then | ||
135 | bbwarn "OSTREE_PUSH_CREDENTIALS is ignored. Please use SOTA_PACKED_CREDENTIALS" | ||
136 | fi | ||
137 | |||
138 | # deploy SOTA credentials | ||
139 | if [ -n "${SOTA_PACKED_CREDENTIALS}" -a -z "${SOTA_IMPLICIT_PROV}" ]; then | ||
140 | if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then | ||
141 | cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip | ||
142 | # Device should not be able to push data to treehub | ||
143 | zip -d var/sota/sota_provisioning_credentials.zip treehub.json | ||
144 | fi | ||
145 | fi | ||
146 | |||
147 | if [ -n "${SOTA_SECONDARY_ECUS}" ]; then | 119 | if [ -n "${SOTA_SECONDARY_ECUS}" ]; then |
148 | cp ${SOTA_SECONDARY_ECUS} var/sota/ecus | 120 | cp ${SOTA_SECONDARY_ECUS} var/sota/ecus |
149 | fi | 121 | fi |
150 | 122 | ||
151 | # Deploy client certificate and key. | ||
152 | if [ -n "${SOTA_CLIENT_CERTIFICATE}" ]; then | ||
153 | if [ -e ${SOTA_CLIENT_CERTIFICATE} ]; then | ||
154 | mkdir -p var/sota/token | ||
155 | cp ${SOTA_CLIENT_CERTIFICATE} var/sota/token/ | ||
156 | fi | ||
157 | fi | ||
158 | if [ -n "${SOTA_CLIENT_KEY}" ]; then | ||
159 | if [ -e ${SOTA_CLIENT_KEY} ]; then | ||
160 | mkdir -p var/sota/token | ||
161 | cp ${SOTA_CLIENT_KEY} var/sota/token/ | ||
162 | fi | ||
163 | fi | ||
164 | if [ -n "${SOTA_ROOT_CA}" ]; then | ||
165 | if [ -e ${SOTA_ROOT_CA} ]; then | ||
166 | cp ${SOTA_ROOT_CA} var/sota/ | ||
167 | fi | ||
168 | fi | ||
169 | |||
170 | # Creating boot directories is required for "ostree admin deploy" | 123 | # Creating boot directories is required for "ostree admin deploy" |
171 | 124 | ||
172 | mkdir -p boot/loader.0 | 125 | mkdir -p boot/loader.0 |
diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 357fefd..d3b66e0 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass | |||
@@ -6,7 +6,7 @@ python __anonymous() { | |||
6 | OVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" | 6 | OVERRIDES .= "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ':sota', '', d)}" |
7 | 7 | ||
8 | SOTA_CLIENT ??= "aktualizr" | 8 | SOTA_CLIENT ??= "aktualizr" |
9 | SOTA_CLIENT_PROV ??= "${@bb.utils.contains('DISTRO_FEATURES', 'implicit-prov', 'aktualizr-implicit-prov', 'aktualizr-auto-prov', d)}" | 9 | SOTA_CLIENT_PROV ??= "aktualizr-auto-prov" |
10 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" | 10 | IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" |
11 | IMAGE_CLASSES += " image_types_ostree image_types_ota" | 11 | IMAGE_CLASSES += " image_types_ostree image_types_ota" |
12 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush otaimg wic', ' ', d)}" | 12 | IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush otaimg wic', ' ', d)}" |