summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
authorAnton Gerasimov <anton@advancedtelematic.com>2017-12-22 19:14:16 +0100
committerAnton Gerasimov <anton.gerasimov@openmailbox.org>2018-01-08 15:18:13 +0100
commit537de14d5018f9525964e7d4c64d736e9186c696 (patch)
treedde83617d1e109a978296f6a3ad508b26b5b4f65 /recipes-sota
parent2f5b892d318f9b22747aed4618d3f15728de9980 (diff)
downloadmeta-updater-537de14d5018f9525964e7d4c64d736e9186c696.tar.gz
Add support of ISO/TP legacy secondaries and serial CAN
Diffstat (limited to 'recipes-sota')
-rw-r--r--recipes-sota/aktualizr/aktualizr-auto-prov.bb10
-rw-r--r--recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb9
-rw-r--r--recipes-sota/aktualizr/aktualizr-implicit-prov.bb9
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb20
-rw-r--r--recipes-sota/aktualizr/files/aktualizr-serialcan.service15
5 files changed, 36 insertions, 27 deletions
diff --git a/recipes-sota/aktualizr/aktualizr-auto-prov.bb b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
index c97cbb8..2190512 100644
--- a/recipes-sota/aktualizr/aktualizr-auto-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-auto-prov.bb
@@ -1,4 +1,4 @@
1SUMMARY = "Aktualizr systemd service and configurations" 1SUMMARY = "Aktualizr configuration for autoprovisioning"
2DESCRIPTION = "Systemd service and configurations for autoprovisioning Aktualizr, the SOTA Client application written in C++" 2DESCRIPTION = "Systemd service and configurations for autoprovisioning Aktualizr, the SOTA Client application written in C++"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
@@ -11,13 +11,8 @@ PR = "6"
11 11
12SRC_URI = " \ 12SRC_URI = " \
13 file://LICENSE \ 13 file://LICENSE \
14 file://aktualizr.service \
15 " 14 "
16 15
17SYSTEMD_SERVICE_${PN} = "aktualizr.service"
18
19inherit systemd
20
21require environment.inc 16require environment.inc
22require credentials.inc 17require credentials.inc
23 18
@@ -49,12 +44,9 @@ do_install() {
49 zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip treehub.json 44 zip -d ${D}${localstatedir}/sota/sota_provisioning_credentials.zip treehub.json
50 fi 45 fi
51 fi 46 fi
52 install -d ${D}${systemd_unitdir}/system
53 install -m 0644 ${WORKDIR}/aktualizr.service ${D}${systemd_unitdir}/system/aktualizr.service
54} 47}
55 48
56FILES_${PN} = " \ 49FILES_${PN} = " \
57 ${systemd_unitdir}/system/aktualizr.service \
58 ${libdir}/sota/sota.toml \ 50 ${libdir}/sota/sota.toml \
59 ${localstatedir}/sota \ 51 ${localstatedir}/sota \
60 ${localstatedir}/sota/sota_provisioning_credentials.zip \ 52 ${localstatedir}/sota/sota_provisioning_credentials.zip \
diff --git a/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb b/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb
index 8779c67..1e893fa 100644
--- a/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb
@@ -1,4 +1,4 @@
1SUMMARY = "Aktualizr systemd service and configuration with HSM support" 1SUMMARY = "Aktualizr configuration with HSM support"
2DESCRIPTION = "Systemd service and configurations for Aktualizr, the SOTA Client application written in C++" 2DESCRIPTION = "Systemd service and configurations for Aktualizr, the SOTA Client application written in C++"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
@@ -10,28 +10,21 @@ RDEPENDS_${PN} = "aktualizr softhsm softhsm-testtoken"
10 10
11SRC_URI = " \ 11SRC_URI = " \
12 file://LICENSE \ 12 file://LICENSE \
13 file://aktualizr.service \
14 " 13 "
15PV = "1.0" 14PV = "1.0"
16PR = "6" 15PR = "6"
17 16
18SYSTEMD_SERVICE_${PN} = "aktualizr.service"
19
20inherit systemd
21 17
22require environment.inc 18require environment.inc
23require credentials.inc 19require credentials.inc
24 20
25do_install() { 21do_install() {
26 install -d ${D}${systemd_unitdir}/system
27 install -m 0644 ${WORKDIR}/aktualizr.service ${D}${systemd_unitdir}/system/aktualizr.service
28 install -d ${D}${libdir}/sota 22 install -d ${D}${libdir}/sota
29 aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} --no-root-ca \ 23 aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} --no-root-ca \
30 -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_test.toml -o ${D}${libdir}/sota/sota.toml -p ${D} 24 -i ${STAGING_DIR_NATIVE}${libdir}/sota/sota_hsm_test.toml -o ${D}${libdir}/sota/sota.toml -p ${D}
31} 25}
32 26
33FILES_${PN} = " \ 27FILES_${PN} = " \
34 ${systemd_unitdir}/system/aktualizr.service \
35 ${libdir}/sota/sota.toml \ 28 ${libdir}/sota/sota.toml \
36 " 29 "
37 30
diff --git a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
index 67bd2c2..b5bf420 100644
--- a/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
+++ b/recipes-sota/aktualizr/aktualizr-implicit-prov.bb
@@ -1,4 +1,4 @@
1SUMMARY = "Aktualizr systemd service and configurations" 1SUMMARY = "Aktualizr configuration for implicit provisioning"
2DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr, the SOTA Client application written in C++" 2DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr, the SOTA Client application written in C++"
3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" 3HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
4SECTION = "base" 4SECTION = "base"
@@ -11,19 +11,13 @@ PR = "1"
11 11
12SRC_URI = " \ 12SRC_URI = " \
13 file://LICENSE \ 13 file://LICENSE \
14 file://aktualizr.service \
15 " 14 "
16 15
17SYSTEMD_SERVICE_${PN} = "aktualizr.service"
18
19inherit systemd
20 16
21require environment.inc 17require environment.inc
22require credentials.inc 18require credentials.inc
23 19
24do_install() { 20do_install() {
25 install -d ${D}${systemd_unitdir}/system
26 install -m 0644 ${WORKDIR}/aktualizr.service ${D}${systemd_unitdir}/system/aktualizr.service
27 install -d ${D}${libdir}/sota 21 install -d ${D}${libdir}/sota
28 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then 22 if [ -n "${SOTA_PACKED_CREDENTIALS}" ]; then
29 aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \ 23 aktualizr_implicit_writer -c ${SOTA_PACKED_CREDENTIALS} \
@@ -32,7 +26,6 @@ do_install() {
32} 26}
33 27
34FILES_${PN} = " \ 28FILES_${PN} = " \
35 ${systemd_unitdir}/system/aktualizr.service \
36 ${libdir}/sota/sota.toml \ 29 ${libdir}/sota/sota.toml \
37 ${libdir}/sota/root.crt \ 30 ${libdir}/sota/root.crt \
38 " 31 "
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 3aed745..d2e5477 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -11,12 +11,15 @@ DEPENDS_append_class-native = "glib-2.0-native "
11 11
12RDEPENDS_${PN}_class-target = "lshw " 12RDEPENDS_${PN}_class-target = "lshw "
13RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)} " 13RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)} "
14RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} "
14 15
15PV = "1.0+git${SRCPV}" 16PV = "1.0+git${SRCPV}"
16PR = "7" 17PR = "7"
17 18
18SRC_URI = " \ 19SRC_URI = " \
19 git://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \ 20 gitsm://github.com/advancedtelematic/aktualizr;branch=${BRANCH} \
21 file://aktualizr.service \
22 file://aktualizr-serialcan.service \
20 " 23 "
21SRCREV = "6bd88e1de1f0216c0b411868af3a596d9974cd0c" 24SRCREV = "6bd88e1de1f0216c0b411868af3a596d9974cd0c"
22BRANCH ?= "master" 25BRANCH ?= "master"
@@ -25,6 +28,9 @@ S = "${WORKDIR}/git"
25 28
26inherit cmake 29inherit cmake
27 30
31inherit systemd
32SYSTEMD_SERVICE_${PN} = "aktualizr.service"
33
28BBCLASSEXTEND =+ "native" 34BBCLASSEXTEND =+ "native"
29 35
30EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} " 36EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} "
@@ -37,6 +43,11 @@ do_install_append () {
37do_install_append_class-target () { 43do_install_append_class-target () {
38 rm -f ${D}${bindir}/aktualizr_implicit_writer 44 rm -f ${D}${bindir}/aktualizr_implicit_writer
39 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', '', 'rm -f ${D}${bindir}/example-interface', d)} 45 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', '', 'rm -f ${D}${bindir}/example-interface', d)}
46 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-isotp-example', '', 'rm -f ${D}${bindir}/isotp-test-interface', d)}
47
48 install -d ${D}${systemd_unitdir}/system
49 aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)}
50 install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service
40} 51}
41do_install_append_class-native () { 52do_install_append_class-native () {
42 rm -f ${D}${bindir}/aktualizr 53 rm -f ${D}${bindir}/aktualizr
@@ -46,13 +57,18 @@ do_install_append_class-native () {
46 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml 57 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
47 install -m 0644 ${S}/config/sota_hsm_test.toml ${D}/${libdir}/sota/sota_hsm_test.toml 58 install -m 0644 ${S}/config/sota_hsm_test.toml ${D}/${libdir}/sota/sota_hsm_test.toml
48 install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml 59 install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml
60
61 install -m 0755 ${B}/src/sota_tools/garage-sign-prefix/src/garage-sign/bin/* ${D}${bindir}
62 install -m 0644 ${B}/src/sota_tools/garage-sign-prefix/src/garage-sign/lib/* ${D}${libdir}
49} 63}
50 64
51FILES_${PN}_class-target = " \ 65FILES_${PN}_class-target = " \
52 ${bindir}/aktualizr \ 66 ${bindir}/aktualizr \
53 ${bindir}/aktualizr-info \ 67 ${bindir}/aktualizr-info \
68 ${systemd_unitdir}/system/aktualizr.service \
54 " 69 "
55FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', '${bindir}/example-interface', '', d)} " 70FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', ' ${bindir}/example-interface', '', d)} "
71FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-isotp-example', ' ${bindir}/isotp-test-interface', '', d)} "
56FILES_${PN}_class-native = " \ 72FILES_${PN}_class-native = " \
57 ${bindir}/aktualizr_implicit_writer \ 73 ${bindir}/aktualizr_implicit_writer \
58 ${bindir}/garage-deploy \ 74 ${bindir}/garage-deploy \
diff --git a/recipes-sota/aktualizr/files/aktualizr-serialcan.service b/recipes-sota/aktualizr/files/aktualizr-serialcan.service
new file mode 100644
index 0000000..b42f348
--- /dev/null
+++ b/recipes-sota/aktualizr/files/aktualizr-serialcan.service
@@ -0,0 +1,15 @@
1[Unit]
2Description=Aktualizr SOTA Client
3Wants=network-online.target slcand@ttyACM0.service
4After=network.target network-online.target slcand@ttyACM0.service
5
6Requires=network-online.target
7
8[Service]
9RestartSec=10
10Restart=always
11EnvironmentFile=/usr/lib/sota/sota.env
12ExecStart=/bin/sh -c "(ip addr | grep can0) && /usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS"
13
14[Install]
15WantedBy=multi-user.target