summaryrefslogtreecommitdiffstats
path: root/recipes-sota/aktualizr/aktualizr_git.bb
diff options
context:
space:
mode:
authorPatrick Vacek <patrickvacek@gmail.com>2019-02-12 09:10:53 +0100
committerGitHub <noreply@github.com>2019-02-12 09:10:53 +0100
commit62e26ec467116d25a1d5a887b7b43ae1144a7446 (patch)
treead418cca071795717834046f8a1b072d3bd620e4 /recipes-sota/aktualizr/aktualizr_git.bb
parent395080beaf1ba980278eb2e7ed025d08146404ce (diff)
parentbe03a70d934a6946647c8df8209477c19b6632ed (diff)
downloadmeta-updater-62e26ec467116d25a1d5a887b7b43ae1144a7446.tar.gz
Merge pull request #473 from liuming50/thud-aktualizr-pkgconfig
Thud aktualizr pkgconfig
Diffstat (limited to 'recipes-sota/aktualizr/aktualizr_git.bb')
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb96
1 files changed, 44 insertions, 52 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index eb65ae0..fbc1bca 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -5,16 +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
8DEPENDS = "boost curl openssl libarchive libsodium asn1c-native sqlite3 " 8require garage-sign-version.inc
9DEPENDS_append_class-target = "ostree ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)} "
10DEPENDS_append_class-native = "glib-2.0-native "
11
12RDEPENDS_${PN}_class-target = "lshw "
13RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} "
14RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'ubootenv', ' u-boot-fw-utils aktualizr-uboot-env-rollback', '', d)} "
15 9
16RDEPENDS_${PN}_append_class-target = " ${PN}-tools " 10DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native"
17RDEPENDS_${PN}-secondary_append_class-target = " ${PN}-tools " 11RDEPENDS_${PN}_class-target = "aktualizr-check-discovery aktualizr-configs lshw"
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)}"
18 14
19PV = "1.0+git${SRCPV}" 15PV = "1.0+git${SRCPV}"
20PR = "7" 16PR = "7"
@@ -32,29 +28,28 @@ BRANCH ?= "master"
32 28
33S = "${WORKDIR}/git" 29S = "${WORKDIR}/git"
34 30
35inherit cmake 31inherit pkgconfig cmake systemd
36
37inherit systemd
38 32
39SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" 33SYSTEMD_PACKAGES = "${PN} ${PN}-secondary"
40SYSTEMD_SERVICE_${PN} = "aktualizr.service" 34SYSTEMD_SERVICE_${PN} = "aktualizr.service"
41SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket" 35SYSTEMD_SERVICE_${PN}-secondary = "aktualizr-secondary.socket"
42 36
43BBCLASSEXTEND =+ "native" 37EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV}"
44 38
45require garage-sign-version.inc 39GARAGE_SIGN_OPS = "${@ '-DGARAGE_SIGN_VERSION=%s' % d.getVar('GARAGE_SIGN_VERSION') if d.getVar('GARAGE_SIGN_VERSION') is not None else ''} \
40 ${@ '-DGARAGE_SIGN_SHA256=%s' % d.getVar('GARAGE_SIGN_SHA256') if d.getVar('GARAGE_SIGN_SHA256') is not None else ''} \
41 "
46 42
47EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF \ 43PACKAGECONFIG ?= "ostree ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}"
48 -DCMAKE_BUILD_TYPE=Release \ 44PACKAGECONFIG_class-native = "sota-tools"
49 -DAKTUALIZR_VERSION=${PV} \ 45PACKAGECONFIG[warning-as-error] = "-DWARNING_AS_ERROR=ON,-DWARNING_AS_ERROR=OFF,"
50 -DBUILD_LOAD_TESTS=OFF" 46PACKAGECONFIG[ostree] = "-DBUILD_OSTREE=ON,-DBUILD_OSTREE=OFF,ostree,"
51EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ 47PACKAGECONFIG[hsm] = "-DBUILD_P11=ON,-DBUILD_P11=OFF,libp11,"
52 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " 48PACKAGECONFIG[sota-tools] = "-DBUILD_SOTA_TOOLS=ON ${GARAGE_SIGN_OPS},-DBUILD_SOTA_TOOLS=OFF,glib-2.0,"
53EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ 49PACKAGECONFIG[systemd] = "-DBUILD_SYSTEMD=ON,-DBUILD_SYSTEMD=OFF,systemd,"
54 -DBUILD_OSTREE=OFF \ 50PACKAGECONFIG[load-tests] = "-DBUILD_LOAD_TESTS=ON,-DBUILD_LOAD_TESTS=OFF,"
55 -DBUILD_SYSTEMD=OFF \ 51PACKAGECONFIG[serialcan] = ",,,slcand-start"
56 -DGARAGE_SIGN_VERSION=${GARAGE_SIGN_VERSION} \ 52PACKAGECONFIG[ubootenv] = ",,,u-boot-fw-utils aktualizr-uboot-env-rollback"
57 -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}"
58 53
59do_install_append () { 54do_install_append () {
60 install -d ${D}${libdir}/sota 55 install -d ${D}${libdir}/sota
@@ -84,49 +79,45 @@ do_install_append () {
84 fi 79 fi
85 fi 80 fi
86 81
87}
88
89do_install_append_class-target () {
90 install -m 0755 -d ${D}${systemd_unitdir}/system 82 install -m 0755 -d ${D}${systemd_unitdir}/system
91 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)}
92 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
93} 90}
94 91
95do_install_append_class-native () { 92PACKAGESPLITFUNCS_prepend = "split_hosttools_packages "
96 install -m 0755 ${B}/src/sota_tools/garage-sign/bin/* ${D}${bindir} 93
97 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)
98} 100}
99 101
100PACKAGES =+ " ${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"
101 107
102FILES_${PN} = " \ 108FILES_${PN} = " \
103 ${bindir}/aktualizr \ 109 ${bindir}/aktualizr \
104 ${bindir}/aktualizr-info \ 110 ${bindir}/aktualizr-info \
105 ${bindir}/aktualizr-check-discovery \
106 ${systemd_unitdir}/system/aktualizr.service \ 111 ${systemd_unitdir}/system/aktualizr.service \
107 ${libdir}/sota/conf.d \
108 ${sysconfdir}/sota/conf.d \
109 ${sysconfdir}/sota/ecus/* \
110 " 112 "
111 113
112FILES_${PN}-examples = " \ 114FILES_${PN}-configs = " \
113 ${bindir}/hmi-stub \ 115 ${sysconfdir}/sota/* \
116 ${libdir}/sota/* \
114 " 117 "
115 118
116FILES_${PN}-host-tools = " \ 119FILES_${PN}-examples = " \
117 ${bindir}/aktualizr-repo \ 120 ${bindir}/hmi-stub \
118 ${bindir}/aktualizr-cert-provider \
119 ${bindir}/garage-deploy \
120 ${bindir}/garage-push \
121 ${libdir}/sota/sota_autoprov.toml \
122 ${libdir}/sota/sota_autoprov_primary.toml \
123 ${libdir}/sota/sota_hsm_prov.toml \
124 ${libdir}/sota/sota_implicit_prov_ca.toml \
125 ${libdir}/sota/sota_uboot_env.toml \
126 "
127
128FILES_${PN}-tools = " \
129 ${bindir}/aktualizr-check-discovery \
130 " 121 "
131 122
132FILES_${PN}-secondary = " \ 123FILES_${PN}-secondary = " \
@@ -135,5 +126,6 @@ FILES_${PN}-secondary = " \
135 ${systemd_unitdir}/system/aktualizr-secondary.socket \ 126 ${systemd_unitdir}/system/aktualizr-secondary.socket \
136 ${systemd_unitdir}/system/aktualizr-secondary.service \ 127 ${systemd_unitdir}/system/aktualizr-secondary.service \
137 " 128 "
129BBCLASSEXTEND = "native"
138 130
139# vim:set ts=4 sw=4 sts=4 expandtab: 131# vim:set ts=4 sw=4 sts=4 expandtab: