summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2019-02-03 13:26:08 +0100
committerPeter Liu <peter.liu@se.atlascopco.com>2019-02-06 21:34:52 +0100
commit3ec96cf82e396b4e826f46164f6da8bd2072b0b8 (patch)
treeaad56747576466c1e1c4e9fc3a9a013e6c786934 /recipes-sota
parent98236905719b044c731d34a15d8636908b6e624c (diff)
downloadmeta-updater-3ec96cf82e396b4e826f46164f6da8bd2072b0b8.tar.gz
aktualizr: introduce PACKAGECONFIG
There are several flaws in current aktualizr recipe: - It builds with 'BUILD_SYSTEMD=ON' by default but does not set DEPENDS to systemd, this is not leading to compilation errors so far because systemd is deployed into recipe sysroot by ostree if 'systemd' exists in DISTRO_FEATURES, but in other cases, it will cause compilation errors. - GARAGE_SIGN_SHA256 is being passed to EXTRA_OECMAKE even it's not set anythere, this will lead a wrong GARAGE_SIGN_SHA256_ARG to be set in cmake files. - pkgconfig is being called in aktualizr CMakeFile, so it needs inherit pkgconfig.bbclass To fix the above flaws, meanwhile to keep the code cleaner, we introduce PACKAGECONFIG to handle the configurations. Signed-off-by: Ming Liu <liu.ming50@gmail.com>
Diffstat (limited to 'recipes-sota')
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb45
1 files changed, 20 insertions, 25 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index de190c4..f6f6b1f 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -5,16 +5,9 @@ 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 " 8DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native"
9DEPENDS_append_class-target = "ostree ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)} " 9RDEPENDS_${PN}_class-target = "${PN}-tools lshw"
10DEPENDS_append_class-native = "glib-2.0-native " 10RDEPENDS_${PN}-secondary_class-target = "${PN}-tools"
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
16RDEPENDS_${PN}_append_class-target = " ${PN}-tools "
17RDEPENDS_${PN}-secondary_append_class-target = " ${PN}-tools "
18 11
19PV = "1.0+git${SRCPV}" 12PV = "1.0+git${SRCPV}"
20PR = "7" 13PR = "7"
@@ -32,9 +25,7 @@ BRANCH ?= "master"
32 25
33S = "${WORKDIR}/git" 26S = "${WORKDIR}/git"
34 27
35inherit cmake 28inherit pkgconfig cmake systemd
36
37inherit systemd
38 29
39SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" 30SYSTEMD_PACKAGES = "${PN} ${PN}-secondary"
40SYSTEMD_SERVICE_${PN} = "aktualizr.service" 31SYSTEMD_SERVICE_${PN} = "aktualizr.service"
@@ -44,18 +35,22 @@ BBCLASSEXTEND =+ "native"
44 35
45require garage-sign-version.inc 36require garage-sign-version.inc
46 37
47EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF \ 38EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} -Dgtest_disable_pthreads=ON"
48 -DCMAKE_BUILD_TYPE=Release \ 39
49 -DAKTUALIZR_VERSION=${PV} \ 40GARAGE_SIGN_OPS = "${@ '-DGARAGE_SIGN_VERSION=%s' % d.getVar('GARAGE_SIGN_VERSION') if d.getVar('GARAGE_SIGN_VERSION') is not None else ''} \
50 -DBUILD_LOAD_TESTS=OFF \ 41 ${@ '-DGARAGE_SIGN_SHA256=%s' % d.getVar('GARAGE_SIGN_SHA256') if d.getVar('GARAGE_SIGN_SHA256') is not None else ''} \
51 -Dgtest_disable_pthreads=ON" 42 "
52EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ 43
53 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " 44PACKAGECONFIG ?= "ostree ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}"
54EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ 45PACKAGECONFIG_class-native = "sota-tools"
55 -DBUILD_OSTREE=OFF \ 46PACKAGECONFIG[warning-as-error] = "-DWARNING_AS_ERROR=ON,-DWARNING_AS_ERROR=OFF,"
56 -DBUILD_SYSTEMD=OFF \ 47PACKAGECONFIG[ostree] = "-DBUILD_OSTREE=ON,-DBUILD_OSTREE=OFF,ostree,"
57 -DGARAGE_SIGN_VERSION=${GARAGE_SIGN_VERSION} \ 48PACKAGECONFIG[hsm] = "-DBUILD_P11=ON,-DBUILD_P11=OFF,libp11,"
58 -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}" 49PACKAGECONFIG[sota-tools] = "-DBUILD_SOTA_TOOLS=ON ${GARAGE_SIGN_OPS},-DBUILD_SOTA_TOOLS=OFF,glib-2.0,"
50PACKAGECONFIG[systemd] = "-DBUILD_SYSTEMD=ON,-DBUILD_SYSTEMD=OFF,systemd,"
51PACKAGECONFIG[load-tests] = "-DBUILD_LOAD_TESTS=ON,-DBUILD_LOAD_TESTS=OFF,"
52PACKAGECONFIG[serialcan] = ",,,slcand-start"
53PACKAGECONFIG[ubootenv] = ",,,u-boot-fw-utils aktualizr-uboot-env-rollback"
59 54
60do_install_append () { 55do_install_append () {
61 install -d ${D}${libdir}/sota 56 install -d ${D}${libdir}/sota