summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMing Liu <liu.ming50@gmail.com>2019-01-31 17:08:45 +0100
committerPeter Liu <peter.liu@se.atlascopco.com>2019-02-06 21:26:42 +0100
commit3217e9205c85d91be6a4e2ea13f7a30d4343f69f (patch)
tree5db23401a2c22f0b0d80e4ac7df40faf9390b25c
parent6f086f7c7ccb743003e583b0dbf65ee7f2f54eae (diff)
downloadmeta-updater-3217e9205c85d91be6a4e2ea13f7a30d4343f69f.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>
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb44
1 files changed, 20 insertions, 24 deletions
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index b392de0..8bd65da 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,17 +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}"
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 ''} \
51EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ 42 "
52 ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " 43
53EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ 44PACKAGECONFIG ?= "ostree ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}"
54 -DBUILD_OSTREE=OFF \ 45PACKAGECONFIG_class-native = "sota-tools"
55 -DBUILD_SYSTEMD=OFF \ 46PACKAGECONFIG[warning-as-error] = "-DWARNING_AS_ERROR=ON,-DWARNING_AS_ERROR=OFF,"
56 -DGARAGE_SIGN_VERSION=${GARAGE_SIGN_VERSION} \ 47PACKAGECONFIG[ostree] = "-DBUILD_OSTREE=ON,-DBUILD_OSTREE=OFF,ostree,"
57 -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}" 48PACKAGECONFIG[hsm] = "-DBUILD_P11=ON,-DBUILD_P11=OFF,libp11,"
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"
58 54
59do_install_append () { 55do_install_append () {
60 install -d ${D}${libdir}/sota 56 install -d ${D}${libdir}/sota