diff options
author | OYTIS <tossel@gmail.com> | 2017-08-10 11:37:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-10 11:37:09 +0200 |
commit | cae622f61dae32ba5d4e96678e173afbe3637f9f (patch) | |
tree | 70c72493a81bc9a15d0433b85bc81b8bee613271 | |
parent | 34d5f757a86a7e8e1db3e19f2fb33e90e3f33584 (diff) | |
parent | e59b7e959695a31b109b873e7de420cf947e22b8 (diff) | |
download | meta-updater-cae622f61dae32ba5d4e96678e173afbe3637f9f.tar.gz |
Merge pull request #110 from advancedtelematic/bugfix/PRO-3484/avoid-build-unzip
Bugfix/pro 3484/avoid build unzip
-rw-r--r-- | README.adoc | 2 | ||||
-rw-r--r-- | classes/image_types_ostree.bbclass | 59 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr_git.bb | 6 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/aktualizr-autoprovision.service | 3 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/sota_autoprov.toml | 8 | ||||
-rw-r--r-- | recipes-sota/rvi-sota-client/files/sota-client-autoprovision.service | 1 | ||||
-rw-r--r-- | recipes-sota/rvi-sota-client/rvi-sota-client.inc | 5 | ||||
-rw-r--r-- | recipes-sota/rvi-sota-client/rvi-sota-client_git.bb | 5 |
8 files changed, 28 insertions, 61 deletions
diff --git a/README.adoc b/README.adoc index d625780..9615f65 100644 --- a/README.adoc +++ b/README.adoc | |||
@@ -115,7 +115,7 @@ ostree admin deploy --os=agl agl-snapshot:agl-ota | |||
115 | 115 | ||
116 | === SOTA tools | 116 | === SOTA tools |
117 | 117 | ||
118 | SOTA tools now contains only one tool, garage-push that lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with http://www.atsgarage.com/[ATS Garage]. garage-push is used as follws: | 118 | SOTA tools currently contains only one tool, garage-push, which lets you push the changes in OSTree repository generated by bitbake process. It communicates with an http server capable of querying files with HEAD requests and uploading them with POST requests. In particular, this can be used with http://www.atsgarage.com/[ATS Garage]. garage-push is used as follows: |
119 | 119 | ||
120 | .... | 120 | .... |
121 | garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.json | 121 | garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.json |
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index ac7cb60..d01cb9f 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
@@ -17,36 +17,6 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" | |||
17 | 17 | ||
18 | export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" | 18 | export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" |
19 | 19 | ||
20 | python () { | ||
21 | if d.getVar("SOTA_PACKED_CREDENTIALS", True): | ||
22 | if d.getVar("SOTA_AUTOPROVISION_CREDENTIALS", True): | ||
23 | bb.warn("SOTA_AUTOPROVISION_CREDENTIALS are overriden by those in SOTA_PACKED_CREDENTIALS") | ||
24 | if d.getVar("SOTA_AUTOPROVISION_URL", True): | ||
25 | bb.warn("SOTA_AUTOPROVISION_URL is overriden by the one in SOTA_PACKED_CREDENTIALS") | ||
26 | |||
27 | if d.getVar("SOTA_AUTOPROVISION_URL_FILE", True): | ||
28 | bb.warn("SOTA_AUTOPROVISION_URL_FILE is overriden by the one in SOTA_PACKED_CREDENTIALS") | ||
29 | |||
30 | if d.getVar("OSTREE_PUSH_CREDENTIALS", True): | ||
31 | bb.warn("OSTREE_PUSH_CREDENTIALS are overriden by those in SOTA_PACKED_CREDENTIALS") | ||
32 | |||
33 | d.setVar("SOTA_AUTOPROVISION_CREDENTIALS", "%s/sota_credentials/autoprov_credentials.p12" % d.getVar("DEPLOY_DIR_IMAGE", True)) | ||
34 | d.setVar("SOTA_AUTOPROVISION_URL_FILE", "%s/sota_credentials/autoprov.url" % d.getVar("DEPLOY_DIR_IMAGE", True)) | ||
35 | d.setVar("OSTREE_PUSH_CREDENTIALS", "%s/sota_credentials/treehub.json" % d.getVar("DEPLOY_DIR_IMAGE", True)) | ||
36 | } | ||
37 | |||
38 | IMAGE_DEPENDS_ostreecredunpack = "unzip-native:do_populate_sysroot" | ||
39 | |||
40 | IMAGE_CMD_ostreecredunpack () { | ||
41 | if [ ${SOTA_PACKED_CREDENTIALS} ]; then | ||
42 | rm -rf ${DEPLOY_DIR_IMAGE}/sota_credentials | ||
43 | |||
44 | unzip ${SOTA_PACKED_CREDENTIALS} -d ${DEPLOY_DIR_IMAGE}/sota_credentials | ||
45 | fi | ||
46 | } | ||
47 | |||
48 | IMAGE_TYPEDEP_ostree = "ostreecredunpack" | ||
49 | |||
50 | IMAGE_CMD_ostree () { | 20 | IMAGE_CMD_ostree () { |
51 | if [ -z "$OSTREE_REPO" ]; then | 21 | if [ -z "$OSTREE_REPO" ]; then |
52 | bbfatal "OSTREE_REPO should be set in your local.conf" | 22 | bbfatal "OSTREE_REPO should be set in your local.conf" |
@@ -145,21 +115,24 @@ IMAGE_CMD_ostree () { | |||
145 | ln -sf var/roothome root | 115 | ln -sf var/roothome root |
146 | fi | 116 | fi |
147 | 117 | ||
148 | # deploy SOTA credentials | ||
149 | mkdir -p var/sota | 118 | mkdir -p var/sota |
150 | 119 | ||
151 | if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then | 120 | if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then |
152 | EXPDATE=`openssl pkcs12 -in ${SOTA_AUTOPROVISION_CREDENTIALS} -password "pass:" -nodes 2>/dev/null | openssl x509 -noout -enddate | cut -f2 -d "="` | 121 | bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS" |
153 | 122 | fi | |
154 | if [ `date +%s` -ge `date -d "${EXPDATE}" +%s` ]; then | 123 | if [ -n "${SOTA_AUTOPROVISION_URL}" ]; then |
155 | bberror "Certificate ${SOTA_AUTOPROVISION_CREDENTIALS} has expired on ${EXPDATE}" | 124 | bbwarn "SOTA_AUTOPROVISION_URL is ignored. Please use SOTA_PACKED_CREDENTIALS" |
156 | fi | 125 | fi |
126 | if [ -n "${SOTA_AUTOPROVISION_URL_FILE}" ]; then | ||
127 | bbwarn "SOTA_AUTOPROVISION_URL_FILE is ignored. Please use SOTA_PACKED_CREDENTIALS" | ||
128 | fi | ||
129 | if [ -n "${OSTREE_PUSH_CREDENTIALS}" ]; then | ||
130 | bbwarn "OSTREE_PUSH_CREDENTIALS is ignored. Please use SOTA_PACKED_CREDENTIALS" | ||
131 | fi | ||
157 | 132 | ||
158 | cp ${SOTA_AUTOPROVISION_CREDENTIALS} var/sota/sota_provisioning_credentials.p12 | 133 | # deploy SOTA credentials |
159 | if [ -n "${SOTA_AUTOPROVISION_URL_FILE}" ]; then | 134 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
160 | export SOTA_AUTOPROVISION_URL=`cat ${SOTA_AUTOPROVISION_URL_FILE}` | 135 | cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip |
161 | fi | ||
162 | echo "SOTA_GATEWAY_URI=${SOTA_AUTOPROVISION_URL}" > var/sota/sota_provisioning_url.env | ||
163 | fi | 136 | fi |
164 | 137 | ||
165 | if [ -n "${SOTA_SECONDARY_ECUS}" ]; then | 138 | if [ -n "${SOTA_SECONDARY_ECUS}" ]; then |
@@ -207,10 +180,10 @@ IMAGE_CMD_ostree () { | |||
207 | IMAGE_TYPEDEP_ostreepush = "ostree" | 180 | IMAGE_TYPEDEP_ostreepush = "ostree" |
208 | IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot" | 181 | IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot" |
209 | IMAGE_CMD_ostreepush () { | 182 | IMAGE_CMD_ostreepush () { |
210 | if [ -n "${OSTREE_PUSH_CREDENTIALS}" ]; then | 183 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
211 | garage-push --repo=${OSTREE_REPO} \ | 184 | garage-push --repo=${OSTREE_REPO} \ |
212 | --ref=${OSTREE_BRANCHNAME} \ | 185 | --ref=${OSTREE_BRANCHNAME} \ |
213 | --credentials=${OSTREE_PUSH_CREDENTIALS} \ | 186 | --credentials=${SOTA_PACKED_CREDENTIALS} \ |
214 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt | 187 | --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt |
215 | fi | 188 | fi |
216 | } | 189 | } |
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 359c9fb..8bc580d 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb | |||
@@ -13,8 +13,9 @@ SRC_URI = " \ | |||
13 | file://aktualizr-autoprovision.service \ | 13 | file://aktualizr-autoprovision.service \ |
14 | file://sota_autoprov.toml \ | 14 | file://sota_autoprov.toml \ |
15 | " | 15 | " |
16 | SRCREV = "c24f1fc9b600113cf9f2d3d7215e406cbbb70ac4" | 16 | SRCREV = "1004efa3f86cef90c012b34620992b5762b741e3" |
17 | PV = "1.0+git${SRCPV}" | 17 | PV = "1.0+git${SRCPV}" |
18 | PR = "6" | ||
18 | 19 | ||
19 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
20 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | 21 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" |
@@ -23,11 +24,10 @@ inherit cmake systemd | |||
23 | 24 | ||
24 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}" | 25 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}" |
25 | 26 | ||
26 | export SOTA_AUTOPROVISION_CREDENTIALS | ||
27 | export SOTA_PACKED_CREDENTIALS | 27 | export SOTA_PACKED_CREDENTIALS |
28 | 28 | ||
29 | do_install_append() { | 29 | do_install_append() { |
30 | if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" -o -n "${SOTA_PACKED_CREDENTIALS}" ]; then | 30 | if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then |
31 | install -d ${D}/${systemd_unitdir}/system | 31 | install -d ${D}/${systemd_unitdir}/system |
32 | install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service | 32 | install -m 0644 ${WORKDIR}/aktualizr-autoprovision.service ${D}/${systemd_unitdir}/system/aktualizr.service |
33 | install -d ${D}/usr/lib/sota | 33 | install -d ${D}/usr/lib/sota |
diff --git a/recipes-sota/aktualizr/files/aktualizr-autoprovision.service b/recipes-sota/aktualizr/files/aktualizr-autoprovision.service index fd0ab09..4a595f0 100644 --- a/recipes-sota/aktualizr/files/aktualizr-autoprovision.service +++ b/recipes-sota/aktualizr/files/aktualizr-autoprovision.service | |||
@@ -7,8 +7,7 @@ Requires=network-online.target | |||
7 | [Service] | 7 | [Service] |
8 | RestartSec=10 | 8 | RestartSec=10 |
9 | Restart=always | 9 | Restart=always |
10 | EnvironmentFile=/var/sota/sota_provisioning_url.env | 10 | ExecStart=/usr/bin/aktualizr --disable-keyid-validation --config /usr/lib/sota/sota.toml |
11 | ExecStart=/usr/bin/aktualizr --disable-keyid-validation --tls-server ${SOTA_GATEWAY_URI} --config /usr/lib/sota/sota.toml | ||
12 | 11 | ||
13 | [Install] | 12 | [Install] |
14 | WantedBy=multi-user.target | 13 | WantedBy=multi-user.target |
diff --git a/recipes-sota/aktualizr/files/sota_autoprov.toml b/recipes-sota/aktualizr/files/sota_autoprov.toml index 8799553..9fbb093 100644 --- a/recipes-sota/aktualizr/files/sota_autoprov.toml +++ b/recipes-sota/aktualizr/files/sota_autoprov.toml | |||
@@ -1,9 +1,5 @@ | |||
1 | [device] | ||
2 | packages_dir = "/tmp/packages_dir" | ||
3 | certificates_directory = "/var/sota" | ||
4 | system_info = "system_info.sh" | ||
5 | |||
6 | [tls] | 1 | [tls] |
2 | certificates_directory = "/var/sota/" | ||
7 | ca_file = "root.crt" | 3 | ca_file = "root.crt" |
8 | client_certificate = "client.pem" | 4 | client_certificate = "client.pem" |
9 | pkey_file = "pkey.pem" | 5 | pkey_file = "pkey.pem" |
@@ -14,5 +10,5 @@ private_key_path = "ecukey.der" | |||
14 | public_key_path = "ecukey.pub" | 10 | public_key_path = "ecukey.pub" |
15 | 11 | ||
16 | [provision] | 12 | [provision] |
17 | p12_path = "sota_provisioning_credentials.p12" | 13 | provision_path = "/var/sota/sota_provisioning_credentials.zip" |
18 | 14 | ||
diff --git a/recipes-sota/rvi-sota-client/files/sota-client-autoprovision.service b/recipes-sota/rvi-sota-client/files/sota-client-autoprovision.service index 0431455..11b1354 100644 --- a/recipes-sota/rvi-sota-client/files/sota-client-autoprovision.service +++ b/recipes-sota/rvi-sota-client/files/sota-client-autoprovision.service | |||
@@ -6,7 +6,6 @@ After=network-online.target | |||
6 | [Service] | 6 | [Service] |
7 | Type=oneshot | 7 | Type=oneshot |
8 | WorkingDirectory=/var/sota | 8 | WorkingDirectory=/var/sota |
9 | EnvironmentFile=/var/sota/sota_provisioning_url.env | ||
10 | Environment=SOTA_CERT_DIR=/var/sota | 9 | Environment=SOTA_CERT_DIR=/var/sota |
11 | ExecStart=/usr/bin/sota_provision.sh sota_provisioning_credentials | 10 | ExecStart=/usr/bin/sota_provision.sh sota_provisioning_credentials |
12 | RemainAfterExit=true | 11 | RemainAfterExit=true |
diff --git a/recipes-sota/rvi-sota-client/rvi-sota-client.inc b/recipes-sota/rvi-sota-client/rvi-sota-client.inc index 2a27c9a..00709af 100644 --- a/recipes-sota/rvi-sota-client/rvi-sota-client.inc +++ b/recipes-sota/rvi-sota-client/rvi-sota-client.inc | |||
@@ -13,10 +13,11 @@ SRC_URI[index.md5sum] = "6a635e8a081b4d4ba4cebffd721c2d7d" | |||
13 | SRC_URI[index.sha256sum] = "1913c41d4b8de89a931b6f9e418f83e70a083e12e6c247e8510ee932571ebae2" | 13 | SRC_URI[index.sha256sum] = "1913c41d4b8de89a931b6f9e418f83e70a083e12e6c247e8510ee932571ebae2" |
14 | 14 | ||
15 | # also update PV and SRC_URI crates when updating SRCREV | 15 | # also update PV and SRC_URI crates when updating SRCREV |
16 | SRCREV = "b9170dfd92981505c77f8f6e51d477eb1ec57071" | 16 | SRCREV = "5b335cd46c5848d8012ef03f06b50a63fdac4f7c" |
17 | PR = "1" | ||
17 | 18 | ||
18 | # generate with: `make package-version` | 19 | # generate with: `make package-version` |
19 | PV = "0.2.33-61-gb9170df" | 20 | PV = "0.2.33-66-g5b335cd" |
20 | 21 | ||
21 | # generate with: `make yocto-version` | 22 | # generate with: `make yocto-version` |
22 | SRC_URI = " \ | 23 | SRC_URI = " \ |
diff --git a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb index 7ce3ab5..e286598 100644 --- a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb +++ b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb | |||
@@ -24,11 +24,10 @@ lshw \ | |||
24 | jq \ | 24 | jq \ |
25 | python-petname \ | 25 | python-petname \ |
26 | sota-launcher \ | 26 | sota-launcher \ |
27 | zip \ | ||
27 | " | 28 | " |
28 | 29 | ||
29 | export SOTA_PACKED_CREDENTIALS | 30 | export SOTA_PACKED_CREDENTIALS |
30 | export SOTA_AUTOPROVISION_CREDENTIALS | ||
31 | export SOTA_AUTOPROVISION_URL | ||
32 | 31 | ||
33 | do_compile_prepend() { | 32 | do_compile_prepend() { |
34 | export SOTA_VERSION=$(make sota-version) | 33 | export SOTA_VERSION=$(make sota-version) |
@@ -50,7 +49,7 @@ do_install() { | |||
50 | 49 | ||
51 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 50 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
52 | install -d ${D}/${systemd_unitdir}/system | 51 | install -d ${D}/${systemd_unitdir}/system |
53 | if [ -n "$SOTA_AUTOPROVISION_CREDENTIALS" -o -n "$SOTA_PACKED_CREDENTIALS" ]; then | 52 | if [ -n "$SOTA_PACKED_CREDENTIALS" ]; then |
54 | install -m 0644 ${WORKDIR}/sota-client-uptane.service ${D}/${systemd_unitdir}/system/sota-client.service | 53 | install -m 0644 ${WORKDIR}/sota-client-uptane.service ${D}/${systemd_unitdir}/system/sota-client.service |
55 | else | 54 | else |
56 | install -m 0644 ${WORKDIR}/sota-client-ostree.service ${D}/${systemd_unitdir}/system/sota-client.service | 55 | install -m 0644 ${WORKDIR}/sota-client-ostree.service ${D}/${systemd_unitdir}/system/sota-client.service |