summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2019-02-03 13:12:29 +0100
committerPeter Liu <peter.liu@se.atlascopco.com>2019-02-06 21:27:11 +0100
commit7ec1ffc436e8725e40e1853d084054b554929041 (patch)
treeea1baac6841f9770c92c89ec8ccc6a0e61349b5a /recipes-sota
parent3217e9205c85d91be6a4e2ea13f7a30d4343f69f (diff)
downloadmeta-updater-7ec1ffc436e8725e40e1853d084054b554929041.tar.gz
aktualizr: split binaries to their own packages
This patch mainly aims to fix the following issues: - ${libdir}/sota/conf.d is being put into aktualizr package, but ${libdir}/sota/*.toml is being put into aktualizr-host-tools, this does not make sense, if a end user only install aktualizr-host-tools to a target, he will miss the config files in ${libdir}/sota/conf.d. - A user should be able to install garage-deploy garage-push to a board if he wants to do that by choosing building aktualizr with sota-tools, but now it's not in that case, garage-deploy garage-push are only available for native. - It's not necessary to distinguish native/target when installing systemd services, they will be dropped by sstate from native sysroot any way. - It would be better that all binaries to be put into their own packages, so a end user can choose to install a package only with one binary, rather than having to install the entire aktualizr-host-tools. Introduce per-binary based packages for host tools, and gather all config files to aktualizr-configs, it will be depended by binary packages and main aktualizr package. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Diffstat (limited to 'recipes-sota')
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb61
1 files changed, 29 insertions, 32 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 8bd65da..fbc1bca 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -5,9 +5,12 @@ SECTION = "base"
5LICENSE = "MPL-2.0" 5LICENSE = "MPL-2.0"
6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" 6LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
7 7
8require garage-sign-version.inc
9
8DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native" 10DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native"
9RDEPENDS_${PN}_class-target = "${PN}-tools lshw" 11RDEPENDS_${PN}_class-target = "aktualizr-check-discovery aktualizr-configs lshw"
10RDEPENDS_${PN}-secondary_class-target = "${PN}-tools" 12RDEPENDS_${PN}-secondary = "aktualizr-check-discovery"
13RDEPENDS_${PN}-host-tools = "aktualizr aktualizr-repo aktualizr-cert-provider ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'garage-deploy garage-push', '', d)}"
11 14
12PV = "1.0+git${SRCPV}" 15PV = "1.0+git${SRCPV}"
13PR = "7" 16PR = "7"
@@ -31,10 +34,6 @@ SYSTEMD_PACKAGES = "${PN} ${PN}-secondary"
31SYSTEMD_SERVICE_${PN} = "aktualizr.service" 34SYSTEMD_SERVICE_${PN} = "aktualizr.service"
32SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket" 35SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket"
33 36
34BBCLASSEXTEND =+ "native"
35
36require garage-sign-version.inc
37
38EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV}" 37EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV}"
39 38
40GARAGE_SIGN_OPS = "${@ '-DGARAGE_SIGN_VERSION=%s' % d.getVar('GARAGE_SIGN_VERSION') if d.getVar('GARAGE_SIGN_VERSION') is not None else ''} \ 39GARAGE_SIGN_OPS = "${@ '-DGARAGE_SIGN_VERSION=%s' % d.getVar('GARAGE_SIGN_VERSION') if d.getVar('GARAGE_SIGN_VERSION') is not None else ''} \
@@ -80,48 +79,45 @@ do_install_append () {
80 fi 79 fi
81 fi 80 fi
82 81
83}
84
85do_install_append_class-target () {
86 install -m 0755 -d ${D}${systemd_unitdir}/system 82 install -m 0755 -d ${D}${systemd_unitdir}/system
87 aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)} 83 aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)}
88 install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service 84 install -m 0644 ${aktualizr_service} ${D}${systemd_unitdir}/system/aktualizr.service
85
86 if ${@bb.utils.contains('PACKAGECONFIG', 'sota-tools', 'true', 'false', d)}; then
87 install -m 0755 ${B}/src/sota_tools/garage-sign/bin/* ${D}${bindir}
88 install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir}
89 fi
89} 90}
90 91
91do_install_append_class-native () { 92PACKAGESPLITFUNCS_prepend = "split_hosttools_packages "
92 install -m 0755 ${B}/src/sota_tools/garage-sign/bin/* ${D}${bindir} 93
93 install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir} 94python split_hosttools_packages () {
95 bindir = d.getVar('bindir')
96
97 # Split all binaries to their own packages except aktualizr-info,
98 # aktualizr-info should stay in main package aktualizr.
99 do_split_packages(d, bindir, r'^((?!(aktualizr-info)).*)$', '%s', 'Aktualizr tool - %s', extra_depends='aktualizr-configs', prepend=False)
94} 100}
95 101
96PACKAGES =+ " ${PN}-examples ${PN}-host-tools ${PN}-tools ${PN}-secondary " 102PACKAGES_DYNAMIC = "^aktualizr-.* ^garage-.*"
103
104PACKAGES =+ "${PN}-examples ${PN}-secondary ${PN}-configs ${PN}-host-tools"
105
106ALLOW_EMPTY_${PN}-host-tools = "1"
97 107
98FILES_${PN} = " \ 108FILES_${PN} = " \
99 ${bindir}/aktualizr \ 109 ${bindir}/aktualizr \
100 ${bindir}/aktualizr-info \ 110 ${bindir}/aktualizr-info \
101 ${systemd_unitdir}/system/aktualizr.service \ 111 ${systemd_unitdir}/system/aktualizr.service \
102 ${libdir}/sota/conf.d \
103 ${sysconfdir}/sota/conf.d \
104 ${sysconfdir}/sota/ecus/* \
105 " 112 "
106 113
107FILES_${PN}-examples = " \ 114FILES_${PN}-configs = " \
108 ${bindir}/hmi-stub \ 115 ${sysconfdir}/sota/* \
116 ${libdir}/sota/* \
109 " 117 "
110 118
111FILES_${PN}-host-tools = " \ 119FILES_${PN}-examples = " \
112 ${bindir}/aktualizr-repo \ 120 ${bindir}/hmi-stub \
113 ${bindir}/aktualizr-cert-provider \
114 ${bindir}/garage-deploy \
115 ${bindir}/garage-push \
116 ${libdir}/sota/sota_autoprov.toml \
117 ${libdir}/sota/sota_autoprov_primary.toml \
118 ${libdir}/sota/sota_hsm_prov.toml \
119 ${libdir}/sota/sota_implicit_prov_ca.toml \
120 ${libdir}/sota/sota_uboot_env.toml \
121 "
122
123FILES_${PN}-tools = " \
124 ${bindir}/aktualizr-check-discovery \
125 " 121 "
126 122
127FILES_${PN}-secondary = " \ 123FILES_${PN}-secondary = " \
@@ -130,5 +126,6 @@ FILES_${PN}-secondary = " \
130 ${systemd_unitdir}/system/aktualizr-secondary.socket \ 126 ${systemd_unitdir}/system/aktualizr-secondary.socket \
131 ${systemd_unitdir}/system/aktualizr-secondary.service \ 127 ${systemd_unitdir}/system/aktualizr-secondary.service \
132 " 128 "
129BBCLASSEXTEND = "native"
133 130
134# vim:set ts=4 sw=4 sts=4 expandtab: 131# vim:set ts=4 sw=4 sts=4 expandtab: