diff options
author | Ming Liu <liu.ming50@gmail.com> | 2019-02-03 13:26:08 +0100 |
---|---|---|
committer | Peter Liu <peter.liu@se.atlascopco.com> | 2019-02-06 21:34:52 +0100 |
commit | 3ec96cf82e396b4e826f46164f6da8bd2072b0b8 (patch) | |
tree | aad56747576466c1e1c4e9fc3a9a013e6c786934 /recipes-sota | |
parent | 98236905719b044c731d34a15d8636908b6e624c (diff) | |
download | meta-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-x | recipes-sota/aktualizr/aktualizr_git.bb | 45 |
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" | |||
5 | LICENSE = "MPL-2.0" | 5 | LICENSE = "MPL-2.0" |
6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" | 6 | LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=9741c346eef56131163e13b9db1241b3" |
7 | 7 | ||
8 | DEPENDS = "boost curl openssl libarchive libsodium asn1c-native sqlite3 " | 8 | DEPENDS = "boost curl openssl libarchive libsodium sqlite3 asn1c-native" |
9 | DEPENDS_append_class-target = "ostree ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' libp11', '', d)} " | 9 | RDEPENDS_${PN}_class-target = "${PN}-tools lshw" |
10 | DEPENDS_append_class-native = "glib-2.0-native " | 10 | RDEPENDS_${PN}-secondary_class-target = "${PN}-tools" |
11 | |||
12 | RDEPENDS_${PN}_class-target = "lshw " | ||
13 | RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " | ||
14 | RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'ubootenv', ' u-boot-fw-utils aktualizr-uboot-env-rollback', '', d)} " | ||
15 | |||
16 | RDEPENDS_${PN}_append_class-target = " ${PN}-tools " | ||
17 | RDEPENDS_${PN}-secondary_append_class-target = " ${PN}-tools " | ||
18 | 11 | ||
19 | PV = "1.0+git${SRCPV}" | 12 | PV = "1.0+git${SRCPV}" |
20 | PR = "7" | 13 | PR = "7" |
@@ -32,9 +25,7 @@ BRANCH ?= "master" | |||
32 | 25 | ||
33 | S = "${WORKDIR}/git" | 26 | S = "${WORKDIR}/git" |
34 | 27 | ||
35 | inherit cmake | 28 | inherit pkgconfig cmake systemd |
36 | |||
37 | inherit systemd | ||
38 | 29 | ||
39 | SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" | 30 | SYSTEMD_PACKAGES = "${PN} ${PN}-secondary" |
40 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" | 31 | SYSTEMD_SERVICE_${PN} = "aktualizr.service" |
@@ -44,18 +35,22 @@ BBCLASSEXTEND =+ "native" | |||
44 | 35 | ||
45 | require garage-sign-version.inc | 36 | require garage-sign-version.inc |
46 | 37 | ||
47 | EXTRA_OECMAKE = "-DWARNING_AS_ERROR=OFF \ | 38 | EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release -DAKTUALIZR_VERSION=${PV} -Dgtest_disable_pthreads=ON" |
48 | -DCMAKE_BUILD_TYPE=Release \ | 39 | |
49 | -DAKTUALIZR_VERSION=${PV} \ | 40 | GARAGE_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 | " |
52 | EXTRA_OECMAKE_append_class-target = " -DBUILD_OSTREE=ON \ | 43 | |
53 | ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', '-DBUILD_P11=ON', '', d)} " | 44 | PACKAGECONFIG ?= "ostree ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} ${@bb.utils.filter('SOTA_CLIENT_FEATURES', 'hsm serialcan ubootenv', d)}" |
54 | EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ | 45 | PACKAGECONFIG_class-native = "sota-tools" |
55 | -DBUILD_OSTREE=OFF \ | 46 | PACKAGECONFIG[warning-as-error] = "-DWARNING_AS_ERROR=ON,-DWARNING_AS_ERROR=OFF," |
56 | -DBUILD_SYSTEMD=OFF \ | 47 | PACKAGECONFIG[ostree] = "-DBUILD_OSTREE=ON,-DBUILD_OSTREE=OFF,ostree," |
57 | -DGARAGE_SIGN_VERSION=${GARAGE_SIGN_VERSION} \ | 48 | PACKAGECONFIG[hsm] = "-DBUILD_P11=ON,-DBUILD_P11=OFF,libp11," |
58 | -DGARAGE_SIGN_SHA256=${GARAGE_SIGN_SHA256}" | 49 | PACKAGECONFIG[sota-tools] = "-DBUILD_SOTA_TOOLS=ON ${GARAGE_SIGN_OPS},-DBUILD_SOTA_TOOLS=OFF,glib-2.0," |
50 | PACKAGECONFIG[systemd] = "-DBUILD_SYSTEMD=ON,-DBUILD_SYSTEMD=OFF,systemd," | ||
51 | PACKAGECONFIG[load-tests] = "-DBUILD_LOAD_TESTS=ON,-DBUILD_LOAD_TESTS=OFF," | ||
52 | PACKAGECONFIG[serialcan] = ",,,slcand-start" | ||
53 | PACKAGECONFIG[ubootenv] = ",,,u-boot-fw-utils aktualizr-uboot-env-rollback" | ||
59 | 54 | ||
60 | do_install_append () { | 55 | do_install_append () { |
61 | install -d ${D}${libdir}/sota | 56 | install -d ${D}${libdir}/sota |