summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
authorPhil Wise <phil@advancedtelematic.com>2018-03-14 11:44:26 +0100
committerPhil Wise <phil@advancedtelematic.com>2018-03-14 16:00:09 +0100
commitbbce1809a921e627678947e9585ea15223b181d9 (patch)
treec30b514d0ef05e5e1c915140bb0efa07f9b7057c /recipes-sota
parentf1fd04ac20d778bed88727571359b4cf39e481c1 (diff)
downloadmeta-updater-bbce1809a921e627678947e9585ea15223b181d9.tar.gz
Add secondary-image to meta-updater
This required splitting the aktualizr package into several components, in order to be able to either install the primary 'aktualzr' or the secondary 'aktualizr-secondary'.
Diffstat (limited to 'recipes-sota')
-rw-r--r--recipes-sota/aktualizr/aktualizr_git.bb42
1 files changed, 24 insertions, 18 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 4c4e975..ad06339 100644
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -20,7 +20,7 @@ SRC_URI = " \
20 file://aktualizr.service \ 20 file://aktualizr.service \
21 file://aktualizr-serialcan.service \ 21 file://aktualizr-serialcan.service \
22 " 22 "
23SRCREV = "1a6432175b9fb7326173e8db35d326cc1a1011a1" 23SRCREV = "dca6271f4ec06eb2272cc99b4b9cf76a9805f18d"
24BRANCH ?= "master" 24BRANCH ?= "master"
25 25
26S = "${WORKDIR}/git" 26S = "${WORKDIR}/git"
@@ -34,27 +34,19 @@ BBCLASSEXTEND =+ "native"
34 34
35EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} " 35EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF -DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} "
36EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON -DBUILD_ISOTP=ON ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " 36EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON -DBUILD_ISOTP=ON ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} "
37EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON -DBUILD_OSTREE=OFF " 37EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON -DBUILD_OSTREE=OFF -DBUILD_SYSTEMD=OFF "
38 38
39do_install_append () { 39do_install_append () {
40 rm -fr ${D}${libdir}/systemd 40 rm -fr ${D}${libdir}/systemd
41 rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package
41} 42}
42do_install_append_class-target () { 43do_install_append_class-target () {
43 rm -f ${D}${bindir}/aktualizr_cert_provider
44 rm -f ${D}${bindir}/aktualizr_implicit_writer
45 rm -f ${D}${libdir}/sota/sota.toml
46 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', '', 'rm -f ${D}${bindir}/example-interface', d)}
47 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-isotp-example', '', 'rm -f ${D}${bindir}/isotp-test-interface', d)}
48
49 install -d ${D}${systemd_unitdir}/system 44 install -d ${D}${systemd_unitdir}/system
50 aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)} 45 aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)}
51 install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service 46 install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service
52} 47}
53 48
54do_install_append_class-native () { 49do_install_append_class-native () {
55 rm -f ${D}${bindir}/aktualizr
56 rm -f ${D}${bindir}/aktualizr-info
57 rm -f ${D}${bindir}/example-interface
58 install -d ${D}${libdir}/sota 50 install -d ${D}${libdir}/sota
59 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml 51 install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml
60 install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml 52 install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml
@@ -65,23 +57,37 @@ do_install_append_class-native () {
65 install -m 0644 ${B}/src/sota_tools/garage-sign-prefix/src/garage-sign/lib/* ${D}${libdir} 57 install -m 0644 ${B}/src/sota_tools/garage-sign-prefix/src/garage-sign/lib/* ${D}${libdir}
66} 58}
67 59
68FILES_${PN}_append = " \ 60PACKAGES =+ " ${PN}-common ${PN}-examples ${PN}-host-tools ${PN}-secondary "
69 ${libdir}/sota \
70 "
71 61
72FILES_${PN}_class-target = " \ 62FILES_${PN} = " \
73 ${bindir}/aktualizr \ 63 ${bindir}/aktualizr \
74 ${bindir}/aktualizr-info \ 64 ${bindir}/aktualizr-info \
75 ${systemd_unitdir}/system/aktualizr.service \ 65 ${systemd_unitdir}/system/aktualizr.service \
76 " 66 "
77 67
78FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-example', ' ${bindir}/example-interface', '', d)} " 68FILES_${PN}-common = " \
79FILES_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'secondary-isotp-example', ' ${bindir}/isotp-test-interface', '', d)} " 69 ${libdir}/sota/schemas \
80FILES_${PN}_class-native = " \ 70 "
71
72FILES_${PN}-examples = " \
73 ${libdir}/sota/demo_secondary.json \
74 ${bindir}/example-interface \
75 ${bindir}/isotp-test-interface \
76 "
77
78FILES_${PN}-host-tools = " \
81 ${bindir}/aktualizr_cert_provider \ 79 ${bindir}/aktualizr_cert_provider \
82 ${bindir}/aktualizr_implicit_writer \ 80 ${bindir}/aktualizr_implicit_writer \
83 ${bindir}/garage-deploy \ 81 ${bindir}/garage-deploy \
84 ${bindir}/garage-push \ 82 ${bindir}/garage-push \
85 " 83 "
86 84
85FILES_${PN}-secondary = " \
86 ${bindir}/aktualizr-secondary \
87 "
88
89# Both primary and secondary need the SQL Schemas
90RDEPENDS_${PN}_class-target =+ "${PN}-common"
91RDEPENDS_${PN}-secondary_class-target =+ "${PN}-common"
92
87# vim:set ts=4 sw=4 sts=4 expandtab: 93# vim:set ts=4 sw=4 sts=4 expandtab: