summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcajun-rat <p@beta16.co.uk>2017-08-25 09:47:22 +0200
committerGitHub <noreply@github.com>2017-08-25 09:47:22 +0200
commit6ed33bdca45adfcc7150a8083b888ff7df011d08 (patch)
treea98b095c60251d583f760da105b689a76e24b7f0
parentf9432682932fe6fcca59289e40bfca5ceacb137c (diff)
parentcc8585e7864ce3731fa3db9bad2c748f7f25a6ca (diff)
downloadmeta-updater-6ed33bdca45adfcc7150a8083b888ff7df011d08.tar.gz
Merge pull request #133 from advancedtelematic/merge-morty-changes-forward
Merge morty changes forward to pyro
-rw-r--r--README.adoc2
-rw-r--r--classes/image_types_ostree.bbclass83
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb6
-rw-r--r--recipes-sota/aktualizr/files/aktualizr-autoprovision.service3
-rw-r--r--recipes-sota/aktualizr/files/sota_autoprov.toml8
-rw-r--r--recipes-sota/rvi-sota-client/files/sota-client-autoprovision.service1
-rw-r--r--recipes-sota/rvi-sota-client/files/sota-installer.service12
-rw-r--r--recipes-sota/rvi-sota-client/rvi-sota-client.inc145
-rw-r--r--recipes-sota/rvi-sota-client/rvi-sota-client_git.bb177
-rw-r--r--recipes-sota/rvi-sota-client/sota-installer_git.bb25
-rw-r--r--recipes-sota/rvi-sota-client/sota-launcher_git.bb15
-rw-r--r--recipes-sota/sota-tools/sota-tools_git.bb4
-rwxr-xr-xscripts/envsetup.sh10
13 files changed, 265 insertions, 226 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
118SOTA 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: 118SOTA 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....
121garage-push --repo=/path/to/ostree-repo --ref=mybranch --credentials=/path/to/credentials.json 121garage-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 a62ec84..110f88d 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -4,6 +4,7 @@ inherit image
4 4
5IMAGE_DEPENDS_ostree = "ostree-native:do_populate_sysroot \ 5IMAGE_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 \
7 virtual/kernel:do_deploy \ 8 virtual/kernel:do_deploy \
8 ${OSTREE_INITRAMFS_IMAGE}:do_image_complete \ 9 ${OSTREE_INITRAMFS_IMAGE}:do_image_complete \
9 unzip-native" 10 unzip-native"
@@ -18,36 +19,6 @@ OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
18 19
19export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" 20export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}"
20 21
21python () {
22 if d.getVar("SOTA_PACKED_CREDENTIALS", True):
23 if d.getVar("SOTA_AUTOPROVISION_CREDENTIALS", True):
24 bb.warn("SOTA_AUTOPROVISION_CREDENTIALS are overriden by those in SOTA_PACKED_CREDENTIALS")
25 if d.getVar("SOTA_AUTOPROVISION_URL", True):
26 bb.warn("SOTA_AUTOPROVISION_URL is overriden by the one in SOTA_PACKED_CREDENTIALS")
27
28 if d.getVar("SOTA_AUTOPROVISION_URL_FILE", True):
29 bb.warn("SOTA_AUTOPROVISION_URL_FILE is overriden by the one in SOTA_PACKED_CREDENTIALS")
30
31 if d.getVar("OSTREE_PUSH_CREDENTIALS", True):
32 bb.warn("OSTREE_PUSH_CREDENTIALS are overriden by those in SOTA_PACKED_CREDENTIALS")
33
34 d.setVar("SOTA_AUTOPROVISION_CREDENTIALS", "%s/sota_credentials/autoprov_credentials.p12" % d.getVar("DEPLOY_DIR_IMAGE", True))
35 d.setVar("SOTA_AUTOPROVISION_URL_FILE", "%s/sota_credentials/autoprov.url" % d.getVar("DEPLOY_DIR_IMAGE", True))
36 d.setVar("OSTREE_PUSH_CREDENTIALS", "%s/sota_credentials/treehub.json" % d.getVar("DEPLOY_DIR_IMAGE", True))
37}
38
39IMAGE_DEPENDS_ostreecredunpack = "unzip-native:do_populate_sysroot"
40
41IMAGE_CMD_ostreecredunpack () {
42 if [ ${SOTA_PACKED_CREDENTIALS} ]; then
43 rm -rf ${DEPLOY_DIR_IMAGE}/sota_credentials
44
45 unzip ${SOTA_PACKED_CREDENTIALS} -d ${DEPLOY_DIR_IMAGE}/sota_credentials
46 fi
47}
48
49IMAGE_TYPEDEP_ostree = "ostreecredunpack"
50
51IMAGE_CMD_ostree () { 22IMAGE_CMD_ostree () {
52 if [ -z "$OSTREE_REPO" ]; then 23 if [ -z "$OSTREE_REPO" ]; then
53 bbfatal "OSTREE_REPO should be set in your local.conf" 24 bbfatal "OSTREE_REPO should be set in your local.conf"
@@ -146,22 +117,33 @@ IMAGE_CMD_ostree () {
146 ln -sf var/roothome root 117 ln -sf var/roothome root
147 fi 118 fi
148 119
149 # deploy SOTA credentials 120 mkdir -p var/sota
150 if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then
151 EXPDATE=`openssl pkcs12 -in ${SOTA_AUTOPROVISION_CREDENTIALS} -password "pass:" -nodes 2>/dev/null | openssl x509 -noout -enddate | cut -f2 -d "="`
152 121
153 if [ `date +%s` -ge `date -d "${EXPDATE}" +%s` ]; then 122 if [ -n "${SOTA_AUTOPROVISION_CREDENTIALS}" ]; then
154 bberror "Certificate ${SOTA_AUTOPROVISION_CREDENTIALS} has expired on ${EXPDATE}" 123 bbwarn "SOTA_AUTOPROVISION_CREDENTIALS are ignored. Please use SOTA_PACKED_CREDENTIALS"
155 fi 124 fi
125 if [ -n "${SOTA_AUTOPROVISION_URL}" ]; then
126 bbwarn "SOTA_AUTOPROVISION_URL is ignored. Please use SOTA_PACKED_CREDENTIALS"
127 fi
128 if [ -n "${SOTA_AUTOPROVISION_URL_FILE}" ]; then
129 bbwarn "SOTA_AUTOPROVISION_URL_FILE is ignored. Please use SOTA_PACKED_CREDENTIALS"
130 fi
131 if [ -n "${OSTREE_PUSH_CREDENTIALS}" ]; then
132 bbwarn "OSTREE_PUSH_CREDENTIALS is ignored. Please use SOTA_PACKED_CREDENTIALS"
133 fi
156 134
157 mkdir -p var/sota 135 # deploy SOTA credentials
158 cp ${SOTA_AUTOPROVISION_CREDENTIALS} var/sota/sota_provisioning_credentials.p12 136 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
159 if [ -n "${SOTA_AUTOPROVISION_URL_FILE}" ]; then 137 if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then
160 export SOTA_AUTOPROVISION_URL=`cat ${SOTA_AUTOPROVISION_URL_FILE}` 138 cp ${SOTA_PACKED_CREDENTIALS} var/sota/sota_provisioning_credentials.zip
161 fi 139 # Device should not be able to push data to treehub
162 echo "SOTA_GATEWAY_URI=${SOTA_AUTOPROVISION_URL}" > var/sota/sota_provisioning_url.env 140 zip -d var/sota/sota_provisioning_credentials.zip treehub.json
141 fi
163 fi 142 fi
164 143
144 if [ -n "${SOTA_SECONDARY_ECUS}" ]; then
145 cp ${SOTA_SECONDARY_ECUS} var/sota/ecus
146 fi
165 147
166 # Creating boot directories is required for "ostree admin deploy" 148 # Creating boot directories is required for "ostree admin deploy"
167 149
@@ -204,10 +186,17 @@ IMAGE_CMD_ostree () {
204IMAGE_TYPEDEP_ostreepush = "ostree" 186IMAGE_TYPEDEP_ostreepush = "ostree"
205IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot" 187IMAGE_DEPENDS_ostreepush = "sota-tools-native:do_populate_sysroot"
206IMAGE_CMD_ostreepush () { 188IMAGE_CMD_ostreepush () {
207 if [ -n "${OSTREE_PUSH_CREDENTIALS}" ]; then 189 # Print warnings if credetials are not set or if the file has not been found.
208 garage-push --repo=${OSTREE_REPO} \ 190 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
209 --ref=${OSTREE_BRANCHNAME} \ 191 if [ -e ${SOTA_PACKED_CREDENTIALS} ]; then
210 --credentials=${OSTREE_PUSH_CREDENTIALS} \ 192 garage-push --repo=${OSTREE_REPO} \
211 --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt 193 --ref=${OSTREE_BRANCHNAME} \
194 --credentials=${SOTA_PACKED_CREDENTIALS} \
195 --cacert=${STAGING_ETCDIR_NATIVE}/ssl/certs/ca-certificates.crt
196 else
197 bbwarn "SOTA_PACKED_CREDENTIALS file does not exist."
198 fi
199 else
200 bbwarn "SOTA_PACKED_CREDENTIALS not set. Please add SOTA_PACKED_CREDENTIALS."
212 fi 201 fi
213} 202}
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 "
16SRCREV = "c24f1fc9b600113cf9f2d3d7215e406cbbb70ac4" 16SRCREV = "1004efa3f86cef90c012b34620992b5762b741e3"
17PV = "1.0+git${SRCPV}" 17PV = "1.0+git${SRCPV}"
18PR = "6"
18 19
19S = "${WORKDIR}/git" 20S = "${WORKDIR}/git"
20SYSTEMD_SERVICE_${PN} = "aktualizr.service" 21SYSTEMD_SERVICE_${PN} = "aktualizr.service"
@@ -23,11 +24,10 @@ inherit cmake systemd
23 24
24EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}" 25EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF -DBUILD_OSTREE=ON -DAKTUALIZR_VERSION=${PV}"
25 26
26export SOTA_AUTOPROVISION_CREDENTIALS
27export SOTA_PACKED_CREDENTIALS 27export SOTA_PACKED_CREDENTIALS
28 28
29do_install_append() { 29do_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]
8RestartSec=10 8RestartSec=10
9Restart=always 9Restart=always
10EnvironmentFile=/var/sota/sota_provisioning_url.env 10ExecStart=/usr/bin/aktualizr --disable-keyid-validation --config /usr/lib/sota/sota.toml
11ExecStart=/usr/bin/aktualizr --disable-keyid-validation --tls-server ${SOTA_GATEWAY_URI} --config /usr/lib/sota/sota.toml
12 11
13[Install] 12[Install]
14WantedBy=multi-user.target 13WantedBy=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]
2packages_dir = "/tmp/packages_dir"
3certificates_directory = "/var/sota"
4system_info = "system_info.sh"
5
6[tls] 1[tls]
2certificates_directory = "/var/sota/"
7ca_file = "root.crt" 3ca_file = "root.crt"
8client_certificate = "client.pem" 4client_certificate = "client.pem"
9pkey_file = "pkey.pem" 5pkey_file = "pkey.pem"
@@ -14,5 +10,5 @@ private_key_path = "ecukey.der"
14public_key_path = "ecukey.pub" 10public_key_path = "ecukey.pub"
15 11
16[provision] 12[provision]
17p12_path = "sota_provisioning_credentials.p12" 13provision_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]
7Type=oneshot 7Type=oneshot
8WorkingDirectory=/var/sota 8WorkingDirectory=/var/sota
9EnvironmentFile=/var/sota/sota_provisioning_url.env
10Environment=SOTA_CERT_DIR=/var/sota 9Environment=SOTA_CERT_DIR=/var/sota
11ExecStart=/usr/bin/sota_provision.sh sota_provisioning_credentials 10ExecStart=/usr/bin/sota_provision.sh sota_provisioning_credentials
12RemainAfterExit=true 11RemainAfterExit=true
diff --git a/recipes-sota/rvi-sota-client/files/sota-installer.service b/recipes-sota/rvi-sota-client/files/sota-installer.service
new file mode 100644
index 0000000..a4fd99e
--- /dev/null
+++ b/recipes-sota/rvi-sota-client/files/sota-installer.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=SOTA Secondary ECU Installer
3Requires=network-online.target
4After=network-online.target
5
6[Service]
7RestartSec=10
8Restart=always
9ExecStart=/usr/bin/sota-installer --level debug --oneshot --config /var/sota/installer.toml
10
11[Install]
12WantedBy=multi-user.target
diff --git a/recipes-sota/rvi-sota-client/rvi-sota-client.inc b/recipes-sota/rvi-sota-client/rvi-sota-client.inc
new file mode 100644
index 0000000..6718bab
--- /dev/null
+++ b/recipes-sota/rvi-sota-client/rvi-sota-client.inc
@@ -0,0 +1,145 @@
1inherit cargo systemd
2
3DESCRIPTION = "rvi-sota-client recipe"
4HOMEPAGE = "https://github.com/advancedtelematic/rvi_sota_client"
5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=65d26fcc2f35ea6a181ac777e42db1ea"
7
8BBCLASSEXTEND = "native"
9
10S = "${WORKDIR}/git"
11
12SRC_URI[index.md5sum] = "6a635e8a081b4d4ba4cebffd721c2d7d"
13SRC_URI[index.sha256sum] = "1913c41d4b8de89a931b6f9e418f83e70a083e12e6c247e8510ee932571ebae2"
14
15# also update PV and SRC_URI crates when updating SRCREV
16SRCREV = "d41540a54ee7bba20835b337f3a477d5f1386c76"
17
18PR = "1"
19
20# generate with: `make package-version`
21PV = "0.2.33-76-gd41540a"
22
23# generate with: `make yocto-version`
24SRC_URI = " \
25git://github.com/advancedtelematic/rvi_sota_client \
26file://sota-client-autoprovision.service \
27file://sota-client-ostree.service \
28file://sota-client-uptane.service \
29file://sota-installer.service \
30crate://crates.io/advapi32-sys/0.2.0 \
31crate://crates.io/aho-corasick/0.6.3 \
32crate://crates.io/ansi_term/0.9.0 \
33crate://crates.io/antidote/1.0.0 \
34crate://crates.io/atty/0.2.2 \
35crate://crates.io/backtrace/0.3.2 \
36crate://crates.io/backtrace-sys/0.1.11 \
37crate://crates.io/base64/0.5.2 \
38crate://crates.io/bit-set/0.4.0 \
39crate://crates.io/bit-vec/0.4.4 \
40crate://crates.io/bitflags/0.9.1 \
41crate://crates.io/byteorder/1.1.0 \
42crate://crates.io/bytes/0.4.4 \
43crate://crates.io/cfg-if/0.1.2 \
44crate://crates.io/chan/0.1.19 \
45crate://crates.io/chan-signal/0.2.0 \
46crate://crates.io/chrono/0.4.0 \
47crate://crates.io/clap/2.25.0 \
48crate://crates.io/core-foundation/0.2.3 \
49crate://crates.io/core-foundation-sys/0.2.3 \
50crate://crates.io/crossbeam/0.2.10 \
51crate://crates.io/crypt32-sys/0.2.0 \
52crate://crates.io/dbghelp-sys/0.2.0 \
53crate://crates.io/dbus/0.5.3 \
54crate://crates.io/dtoa/0.4.1 \
55crate://crates.io/env_logger/0.4.3 \
56crate://crates.io/error-chain/0.10.0 \
57crate://crates.io/filetime/0.1.10 \
58crate://crates.io/foreign-types/0.2.0 \
59crate://crates.io/gcc/0.3.51 \
60crate://crates.io/getopts/0.2.14 \
61crate://crates.io/hex/0.2.0 \
62crate://crates.io/httparse/1.2.3 \
63crate://crates.io/hyper/0.10.12 \
64crate://crates.io/hyper-native-tls/0.2.4 \
65crate://crates.io/idna/0.1.4 \
66crate://crates.io/iovec/0.1.0 \
67crate://crates.io/itoa/0.3.1 \
68crate://crates.io/kernel32-sys/0.2.2 \
69crate://crates.io/language-tags/0.2.2 \
70crate://crates.io/lazy_static/0.2.8 \
71crate://crates.io/libc/0.2.26 \
72crate://crates.io/libflate/0.1.5 \
73crate://crates.io/log/0.3.8 \
74crate://crates.io/maplit/0.1.4 \
75crate://crates.io/matches/0.1.6 \
76crate://crates.io/memchr/1.0.1 \
77crate://crates.io/metadeps/1.1.2 \
78crate://crates.io/mime/0.2.6 \
79crate://crates.io/native-tls/0.1.4 \
80crate://crates.io/net2/0.2.29 \
81crate://crates.io/num/0.1.40 \
82crate://crates.io/num-integer/0.1.35 \
83crate://crates.io/num-iter/0.1.34 \
84crate://crates.io/num-traits/0.1.40 \
85crate://crates.io/num_cpus/1.6.2 \
86crate://crates.io/openssl/0.9.14 \
87crate://crates.io/openssl-sys/0.9.14 \
88crate://crates.io/pem/0.4.0 \
89crate://crates.io/percent-encoding/1.0.0 \
90crate://crates.io/pkg-config/0.3.9 \
91crate://crates.io/quote/0.3.15 \
92crate://crates.io/rand/0.3.15 \
93crate://crates.io/redox_syscall/0.1.26 \
94crate://crates.io/regex/0.2.2 \
95crate://crates.io/regex-syntax/0.4.1 \
96crate://crates.io/reqwest/0.6.2 \
97crate://crates.io/ring/0.7.1 \
98crate://crates.io/rust-crypto/0.2.36 \
99crate://crates.io/rustc-demangle/0.1.4 \
100crate://crates.io/rustc-serialize/0.3.24 \
101crate://crates.io/schannel/0.1.7 \
102crate://crates.io/secur32-sys/0.2.0 \
103crate://crates.io/security-framework/0.1.14 \
104crate://crates.io/security-framework-sys/0.1.14 \
105crate://crates.io/serde/1.0.10 \
106crate://crates.io/serde_derive/1.0.10 \
107crate://crates.io/serde_derive_internals/0.15.1 \
108crate://crates.io/serde_json/1.0.2 \
109crate://crates.io/serde_urlencoded/0.5.1 \
110crate://crates.io/sha1/0.2.0 \
111crate://crates.io/strsim/0.6.0 \
112crate://crates.io/syn/0.11.11 \
113crate://crates.io/synom/0.11.3 \
114crate://crates.io/tar/0.4.13 \
115crate://crates.io/tempdir/0.3.5 \
116crate://crates.io/term_size/0.3.0 \
117crate://crates.io/textwrap/0.6.0 \
118crate://crates.io/thread_local/0.3.4 \
119crate://crates.io/time/0.1.38 \
120crate://crates.io/toml/0.2.1 \
121crate://crates.io/toml/0.4.2 \
122crate://crates.io/traitobject/0.1.0 \
123crate://crates.io/tungstenite/0.2.4 \
124crate://crates.io/typeable/0.1.2 \
125crate://crates.io/unicase/1.4.2 \
126crate://crates.io/unicode-bidi/0.3.3 \
127crate://crates.io/unicode-normalization/0.1.5 \
128crate://crates.io/unicode-segmentation/1.1.0 \
129crate://crates.io/unicode-width/0.1.4 \
130crate://crates.io/unicode-xid/0.0.4 \
131crate://crates.io/unix_socket/0.5.0 \
132crate://crates.io/unreachable/1.0.0 \
133crate://crates.io/untrusted/0.3.2 \
134crate://crates.io/url/1.5.1 \
135crate://crates.io/utf-8/0.7.1 \
136crate://crates.io/utf8-ranges/1.0.0 \
137crate://crates.io/uuid/0.5.1 \
138crate://crates.io/vec_map/0.8.0 \
139crate://crates.io/version_check/0.1.3 \
140crate://crates.io/void/1.0.2 \
141crate://crates.io/winapi/0.2.8 \
142crate://crates.io/winapi-build/0.1.1 \
143crate://crates.io/ws2_32-sys/0.2.1 \
144crate://crates.io/xattr/0.1.11 \
145"
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 753488a..e286598 100644
--- a/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
+++ b/recipes-sota/rvi-sota-client/rvi-sota-client_git.bb
@@ -1,25 +1,7 @@
1DESCRIPTION = "sota-client rust recipe" 1require rvi-sota-client.inc
2HOMEPAGE = "https://github.com/advancedtelematic/rvi_sota_client"
3 2
4LICENSE = "MPL-2.0"
5LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=65d26fcc2f35ea6a181ac777e42db1ea"
6 3
7inherit cargo systemd 4SYSTEMD_SERVICE_${PN} = "sota-client.service sota-client-autoprovision.service"
8
9S = "${WORKDIR}/git"
10
11# When changing this, don't forget to:
12# 1) Update PV
13# 2) Check that Cargo.lock hasn't changed with git diff old..new Cargo.lock
14SRCREV = "b6cf6957203fc406b3723d046f1b705e1bd08d7d"
15
16# Generate with:
17# git describe --tags | cut -b2-
18# or from the rvi_sota_client repo:
19# make package-version
20PV = "0.2.33-41-gb6cf695"
21
22BBCLASSEXTEND = "native"
23 5
24FILES_${PN} = " \ 6FILES_${PN} = " \
25/lib64 \ 7/lib64 \
@@ -32,151 +14,20 @@ ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/so
32${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota-client-autoprovision.service', '', d)} \ 14${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota-client-autoprovision.service', '', d)} \
33" 15"
34 16
35
36# list of dependencies can be generated from Cargo.lock by running
37# cat Cargo.lock | sed -e '1,/metadata/ d' Cargo.lock | awk '{print "crate://crates.io/"$2 "/" $3" \\"}'
38SRC_URI = " \
39crate://crates.io/advapi32-sys/0.2.0 \
40crate://crates.io/aho-corasick/0.6.3 \
41crate://crates.io/ansi_term/0.9.0 \
42crate://crates.io/antidote/1.0.0 \
43crate://crates.io/atty/0.2.2 \
44crate://crates.io/backtrace/0.3.2 \
45crate://crates.io/backtrace-sys/0.1.11 \
46crate://crates.io/base64/0.5.2 \
47crate://crates.io/bit-set/0.4.0 \
48crate://crates.io/bit-vec/0.4.4 \
49crate://crates.io/bitflags/0.9.1 \
50crate://crates.io/byteorder/1.0.0 \
51crate://crates.io/bytes/0.4.4 \
52crate://crates.io/cfg-if/0.1.2 \
53crate://crates.io/chan/0.1.19 \
54crate://crates.io/chan-signal/0.2.0 \
55crate://crates.io/chrono/0.4.0 \
56crate://crates.io/clap/2.25.0 \
57crate://crates.io/core-foundation/0.2.3 \
58crate://crates.io/core-foundation-sys/0.2.3 \
59crate://crates.io/crossbeam/0.2.10 \
60crate://crates.io/crypt32-sys/0.2.0 \
61crate://crates.io/dbghelp-sys/0.2.0 \
62crate://crates.io/dbus/0.5.3 \
63crate://crates.io/dtoa/0.4.1 \
64crate://crates.io/env_logger/0.4.3 \
65crate://crates.io/error-chain/0.10.0 \
66crate://crates.io/filetime/0.1.10 \
67crate://crates.io/foreign-types/0.2.0 \
68crate://crates.io/gcc/0.3.51 \
69crate://crates.io/getopts/0.2.14 \
70crate://crates.io/hex/0.2.0 \
71crate://crates.io/httparse/1.2.3 \
72crate://crates.io/hyper/0.10.12 \
73crate://crates.io/hyper-native-tls/0.2.4 \
74crate://crates.io/idna/0.1.2 \
75crate://crates.io/iovec/0.1.0 \
76crate://crates.io/itoa/0.3.1 \
77crate://crates.io/kernel32-sys/0.2.2 \
78crate://crates.io/language-tags/0.2.2 \
79crate://crates.io/lazy_static/0.2.8 \
80crate://crates.io/libc/0.2.24 \
81crate://crates.io/libflate/0.1.9 \
82crate://crates.io/log/0.3.8 \
83crate://crates.io/maplit/0.1.4 \
84crate://crates.io/matches/0.1.6 \
85crate://crates.io/memchr/1.0.1 \
86crate://crates.io/metadeps/1.1.2 \
87crate://crates.io/mime/0.2.6 \
88crate://crates.io/native-tls/0.1.4 \
89crate://crates.io/net2/0.2.29 \
90crate://crates.io/num/0.1.39 \
91crate://crates.io/num-integer/0.1.34 \
92crate://crates.io/num-iter/0.1.33 \
93crate://crates.io/num-traits/0.1.39 \
94crate://crates.io/num_cpus/1.6.2 \
95crate://crates.io/openssl/0.9.14 \
96crate://crates.io/openssl-sys/0.9.14 \
97crate://crates.io/pem/0.4.0 \
98crate://crates.io/percent-encoding/1.0.0 \
99crate://crates.io/pkg-config/0.3.9 \
100crate://crates.io/quote/0.3.15 \
101crate://crates.io/rand/0.3.15 \
102crate://crates.io/redox_syscall/0.1.21 \
103crate://crates.io/regex/0.2.2 \
104crate://crates.io/regex-syntax/0.4.1 \
105crate://crates.io/reqwest/0.6.2 \
106crate://crates.io/ring/0.7.1 \
107crate://crates.io/rust-crypto/0.2.36 \
108crate://crates.io/rustc-demangle/0.1.4 \
109crate://crates.io/rustc-serialize/0.3.24 \
110crate://crates.io/schannel/0.1.7 \
111crate://crates.io/secur32-sys/0.2.0 \
112crate://crates.io/security-framework/0.1.14 \
113crate://crates.io/security-framework-sys/0.1.14 \
114crate://crates.io/serde/1.0.9 \
115crate://crates.io/serde_derive/1.0.9 \
116crate://crates.io/serde_derive_internals/0.15.1 \
117crate://crates.io/serde_json/1.0.2 \
118crate://crates.io/serde_urlencoded/0.5.1 \
119crate://crates.io/sha1/0.2.0 \
120crate://crates.io/strsim/0.6.0 \
121crate://crates.io/syn/0.11.11 \
122crate://crates.io/synom/0.11.3 \
123crate://crates.io/tar/0.4.13 \
124crate://crates.io/tempdir/0.3.5 \
125crate://crates.io/term_size/0.3.0 \
126crate://crates.io/textwrap/0.6.0 \
127crate://crates.io/thread_local/0.3.4 \
128crate://crates.io/time/0.1.37 \
129crate://crates.io/toml/0.2.1 \
130crate://crates.io/toml/0.4.2 \
131crate://crates.io/traitobject/0.1.0 \
132crate://crates.io/tungstenite/0.2.4 \
133crate://crates.io/typeable/0.1.2 \
134crate://crates.io/unicase/1.4.2 \
135crate://crates.io/unicode-bidi/0.3.3 \
136crate://crates.io/unicode-normalization/0.1.5 \
137crate://crates.io/unicode-segmentation/1.1.0 \
138crate://crates.io/unicode-width/0.1.4 \
139crate://crates.io/unicode-xid/0.0.4 \
140crate://crates.io/unix_socket/0.5.0 \
141crate://crates.io/unreachable/1.0.0 \
142crate://crates.io/untrusted/0.3.2 \
143crate://crates.io/url/1.5.1 \
144crate://crates.io/utf-8/0.7.1 \
145crate://crates.io/utf8-ranges/1.0.0 \
146crate://crates.io/uuid/0.5.1 \
147crate://crates.io/vec_map/0.8.0 \
148crate://crates.io/version_check/0.1.2 \
149crate://crates.io/void/1.0.2 \
150crate://crates.io/winapi/0.2.8 \
151crate://crates.io/winapi-build/0.1.1 \
152crate://crates.io/ws2_32-sys/0.2.1 \
153crate://crates.io/xattr/0.1.11 \
154git://github.com/advancedtelematic/rvi_sota_client \
155file://sota-client-autoprovision.service \
156file://sota-client-ostree.service \
157file://sota-client-uptane.service \
158"
159
160SRC_URI[index.md5sum] = "6a635e8a081b4d4ba4cebffd721c2d7d"
161SRC_URI[index.sha256sum] = "1913c41d4b8de89a931b6f9e418f83e70a083e12e6c247e8510ee932571ebae2"
162
163SYSTEMD_SERVICE_${PN} = "sota-client.service sota-client-autoprovision.service"
164
165DEPENDS += " openssl openssl-native dbus " 17DEPENDS += " openssl openssl-native dbus "
166RDEPENDS_${PN} = " libcrypto \ 18RDEPENDS_${PN} = " \
167 libssl \ 19bash \
168 bash \ 20curl \
169 lshw \ 21libcrypto \
170 jq \ 22libssl \
171 curl \ 23lshw \
172 python \ 24jq \
173 python-json \ 25python-petname \
174 python-petname \ 26sota-launcher \
175 " 27zip \
28"
176 29
177export SOTA_PACKED_CREDENTIALS 30export SOTA_PACKED_CREDENTIALS
178export SOTA_AUTOPROVISION_CREDENTIALS
179export SOTA_AUTOPROVISION_URL
180 31
181do_compile_prepend() { 32do_compile_prepend() {
182 export SOTA_VERSION=$(make sota-version) 33 export SOTA_VERSION=$(make sota-version)
@@ -198,7 +49,7 @@ do_install() {
198 49
199 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 50 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
200 install -d ${D}/${systemd_unitdir}/system 51 install -d ${D}/${systemd_unitdir}/system
201 if [ -n "$SOTA_AUTOPROVISION_CREDENTIALS" -o -n "$SOTA_PACKED_CREDENTIALS" ]; then 52 if [ -n "$SOTA_PACKED_CREDENTIALS" ]; then
202 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
203 else 54 else
204 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
diff --git a/recipes-sota/rvi-sota-client/sota-installer_git.bb b/recipes-sota/rvi-sota-client/sota-installer_git.bb
new file mode 100644
index 0000000..09f6e5d
--- /dev/null
+++ b/recipes-sota/rvi-sota-client/sota-installer_git.bb
@@ -0,0 +1,25 @@
1require rvi-sota-client.inc
2
3
4SYSTEMD_SERVICE_${PN} = "sota-installer.service"
5
6DEPENDS += " rvi-sota-client "
7
8FILES_${PN} = " \
9${bindir}/sota-installer \
10${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/sota-installer.service', '', d)} \
11"
12
13do_compile_prepend() {
14 cd sota-installer
15}
16
17do_install() {
18 install -d ${D}${bindir}
19 install -m 0755 target/${TARGET_SYS}/release/sota-installer ${D}${bindir}
20
21 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
22 install -d ${D}/${systemd_unitdir}/system
23 install -m 0644 ${WORKDIR}/sota-installer.service ${D}/${systemd_unitdir}/system/sota-installer.service
24 fi
25}
diff --git a/recipes-sota/rvi-sota-client/sota-launcher_git.bb b/recipes-sota/rvi-sota-client/sota-launcher_git.bb
new file mode 100644
index 0000000..e9874e7
--- /dev/null
+++ b/recipes-sota/rvi-sota-client/sota-launcher_git.bb
@@ -0,0 +1,15 @@
1require rvi-sota-client.inc
2
3
4DEPENDS += " rvi-sota-client "
5FILES_${PN} = "${bindir}/sota-launcher"
6
7
8do_compile_prepend() {
9 cd sota-launcher
10}
11
12do_install() {
13 install -d ${D}${bindir}
14 install -m 0755 target/${TARGET_SYS}/release/sota-launcher ${D}${bindir}
15}
diff --git a/recipes-sota/sota-tools/sota-tools_git.bb b/recipes-sota/sota-tools/sota-tools_git.bb
index 326ff20..5403d9a 100644
--- a/recipes-sota/sota-tools/sota-tools_git.bb
+++ b/recipes-sota/sota-tools/sota-tools_git.bb
@@ -6,11 +6,11 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=65d26fcc2f35ea6a181ac777e42db1ea"
6S = "${WORKDIR}/git" 6S = "${WORKDIR}/git"
7 7
8SRC_URI = "gitsm://github.com/advancedtelematic/sota-tools.git;branch=master" 8SRC_URI = "gitsm://github.com/advancedtelematic/sota-tools.git;branch=master"
9SRCREV = "4d7f22f50ab43be5bee61ad3e96cd9db4ef3a372" 9SRCREV = "216cb84db98e9b0f8c6c1c407f480c5dd0b3cf62"
10 10
11inherit cmake 11inherit cmake
12 12
13DEPENDS = "boost glib-2.0 curl" 13DEPENDS = "boost glib-2.0 curl libarchive"
14 14
15BBCLASSEXTEND = "native" 15BBCLASSEXTEND = "native"
16 16
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh
index ff78681..260b048 100755
--- a/scripts/envsetup.sh
+++ b/scripts/envsetup.sh
@@ -24,7 +24,15 @@ fi
24METADIR="${SOURCEDIR}/../.." 24METADIR="${SOURCEDIR}/../.."
25 25
26if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then 26if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then
27 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" 27 if [ -z "$TEMPLATECONF" ] && [ -d ${METADIR}/meta-updater-${MACHINE}/conf ]; then
28 # Use the template configurations for the specified machine
29 TEMPLATECONF=${METADIR}/meta-updater-${MACHINE}/conf
30 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR"
31 unset TEMPLATECONF
32 else
33 # Use the default configurations or TEMPLATECONF set by the user
34 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR"
35 fi
28 echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf 36 echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf
29 cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf 37 cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf
30 cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf 38 cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf