diff options
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-auto-prov.bb | 10 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-hsm-test-prov.bb | 9 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr-implicit-prov.bb | 9 | ||||
-rw-r--r-- | recipes-sota/aktualizr/aktualizr_git.bb | 20 | ||||
-rw-r--r-- | recipes-sota/aktualizr/files/aktualizr-serialcan.service | 15 | ||||
-rw-r--r-- | recipes-support/slcand-start/files/slcand@.service | 8 | ||||
-rw-r--r-- | recipes-support/slcand-start/slcand-start.bb | 21 |
7 files changed, 65 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 @@ | |||
1 | SUMMARY = "Aktualizr systemd service and configurations" | 1 | SUMMARY = "Aktualizr configuration for autoprovisioning" |
2 | DESCRIPTION = "Systemd service and configurations for autoprovisioning Aktualizr, the SOTA Client application written in C++" | 2 | DESCRIPTION = "Systemd service and configurations for autoprovisioning Aktualizr, the SOTA Client application written in C++" |
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
4 | SECTION = "base" | 4 | SECTION = "base" |
@@ -11,13 +11,8 @@ PR = "6" | |||
11 | 11 | ||
12 | SRC_URI = " \ | 12 | SRC_URI = " \ |
13 | file://LICENSE \ | 13 | file://LICENSE \ |
14 | file://aktualizr.service \ | ||
15 | " | 14 | " |
16 | 15 | ||
17 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | ||
18 | |||
19 | inherit systemd | ||
20 | |||
21 | require environment.inc | 16 | require environment.inc |
22 | require credentials.inc | 17 | require 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 | ||
56 | FILES_${PN} = " \ | 49 | FILES_${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 @@ | |||
1 | SUMMARY = "Aktualizr systemd service and configuration with HSM support" | 1 | SUMMARY = "Aktualizr configuration with HSM support" |
2 | DESCRIPTION = "Systemd service and configurations for Aktualizr, the SOTA Client application written in C++" | 2 | DESCRIPTION = "Systemd service and configurations for Aktualizr, the SOTA Client application written in C++" |
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
4 | SECTION = "base" | 4 | SECTION = "base" |
@@ -10,28 +10,21 @@ RDEPENDS_${PN} = "aktualizr softhsm softhsm-testtoken" | |||
10 | 10 | ||
11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
12 | file://LICENSE \ | 12 | file://LICENSE \ |
13 | file://aktualizr.service \ | ||
14 | " | 13 | " |
15 | PV = "1.0" | 14 | PV = "1.0" |
16 | PR = "6" | 15 | PR = "6" |
17 | 16 | ||
18 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | ||
19 | |||
20 | inherit systemd | ||
21 | 17 | ||
22 | require environment.inc | 18 | require environment.inc |
23 | require credentials.inc | 19 | require credentials.inc |
24 | 20 | ||
25 | do_install() { | 21 | do_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 | ||
33 | FILES_${PN} = " \ | 27 | FILES_${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 @@ | |||
1 | SUMMARY = "Aktualizr systemd service and configurations" | 1 | SUMMARY = "Aktualizr configuration for implicit provisioning" |
2 | DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr, the SOTA Client application written in C++" | 2 | DESCRIPTION = "Systemd service and configurations for implicitly provisioning Aktualizr, the SOTA Client application written in C++" |
3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" | 3 | HOMEPAGE = "https://github.com/advancedtelematic/aktualizr" |
4 | SECTION = "base" | 4 | SECTION = "base" |
@@ -11,19 +11,13 @@ PR = "1" | |||
11 | 11 | ||
12 | SRC_URI = " \ | 12 | SRC_URI = " \ |
13 | file://LICENSE \ | 13 | file://LICENSE \ |
14 | file://aktualizr.service \ | ||
15 | " | 14 | " |
16 | 15 | ||
17 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | ||
18 | |||
19 | inherit systemd | ||
20 | 16 | ||
21 | require environment.inc | 17 | require environment.inc |
22 | require credentials.inc | 18 | require credentials.inc |
23 | 19 | ||
24 | do_install() { | 20 | do_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 | ||
34 | FILES_${PN} = " \ | 28 | FILES_${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 | ||
12 | RDEPENDS_${PN}_class-target = "lshw " | 12 | RDEPENDS_${PN}_class-target = "lshw " |
13 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)} " | 13 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' engine-pkcs11', '', d)} " |
14 | RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " | ||
14 | 15 | ||
15 | PV = "1.0+git${SRCPV}" | 16 | PV = "1.0+git${SRCPV}" |
16 | PR = "7" | 17 | PR = "7" |
17 | 18 | ||
18 | SRC_URI = " \ | 19 | SRC_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 | " |
21 | SRCREV = "6bd88e1de1f0216c0b411868af3a596d9974cd0c" | 24 | SRCREV = "6bd88e1de1f0216c0b411868af3a596d9974cd0c" |
22 | BRANCH ?= "master" | 25 | BRANCH ?= "master" |
@@ -25,6 +28,9 @@ S = "${WORKDIR}/git" | |||
25 | 28 | ||
26 | inherit cmake | 29 | inherit cmake |
27 | 30 | ||
31 | inherit systemd | ||
32 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | ||
33 | |||
28 | BBCLASSEXTEND =+ "native" | 34 | BBCLASSEXTEND =+ "native" |
29 | 35 | ||
30 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} " | 36 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} " |
@@ -37,6 +43,11 @@ do_install_append () { | |||
37 | do_install_append_class-target () { | 43 | do_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 | } |
41 | do_install_append_class-native () { | 52 | do_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 | ||
51 | FILES_${PN}_class-target = " \ | 65 | FILES_${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 | " |
55 | FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', '${bindir}/example-interface', '', d)} " | 70 | FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', ' ${bindir}/example-interface', '', d)} " |
71 | FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-isotp-example', ' ${bindir}/isotp-test-interface', '', d)} " | ||
56 | FILES_${PN}_class-native = " \ | 72 | FILES_${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] | ||
2 | Description=Aktualizr SOTA Client | ||
3 | Wants=network-online.target slcand@ttyACM0.service | ||
4 | After=network.target network-online.target slcand@ttyACM0.service | ||
5 | |||
6 | Requires=network-online.target | ||
7 | |||
8 | [Service] | ||
9 | RestartSec=10 | ||
10 | Restart=always | ||
11 | EnvironmentFile=/usr/lib/sota/sota.env | ||
12 | ExecStart=/bin/sh -c "(ip addr | grep can0) && /usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS" | ||
13 | |||
14 | [Install] | ||
15 | WantedBy=multi-user.target | ||
diff --git a/recipes-support/slcand-start/files/slcand@.service b/recipes-support/slcand-start/files/slcand@.service new file mode 100644 index 0000000..c539568 --- /dev/null +++ b/recipes-support/slcand-start/files/slcand@.service | |||
@@ -0,0 +1,8 @@ | |||
1 | [Unit] | ||
2 | Description=Serial CAN daemon (can-utils) | ||
3 | |||
4 | [Service] | ||
5 | Type=forking | ||
6 | ExecStart=/usr/bin/slcand -o -c -s4 %I can0 | ||
7 | ExecStartPost=/bin/sh -c '/bin/sleep 3; /sbin/ip link set can0 up' | ||
8 | |||
diff --git a/recipes-support/slcand-start/slcand-start.bb b/recipes-support/slcand-start/slcand-start.bb new file mode 100644 index 0000000..dfefaea --- /dev/null +++ b/recipes-support/slcand-start/slcand-start.bb | |||
@@ -0,0 +1,21 @@ | |||
1 | SUMMARY = "Mock smartcard for aktualizr" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690 \ | ||
4 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
5 | |||
6 | |||
7 | inherit systemd | ||
8 | |||
9 | RDEPENDS_${PN} = "can-utils" | ||
10 | |||
11 | SRC_URI = "file://slcand@.service" | ||
12 | |||
13 | SYSTEMD_SERVICE_${PN} = "slcand@.service" | ||
14 | |||
15 | do_install() { | ||
16 | install -d ${D}${systemd_unitdir}/system | ||
17 | install -m 0644 ${WORKDIR}/slcand@.service ${D}${systemd_unitdir}/system/slcand@.service | ||
18 | } | ||
19 | |||
20 | FILES_${PN} = "${systemd_unitdir}/system/createtoken.service" | ||
21 | |||