summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Gerasimov <anton.gerasimov@here.com>2018-06-01 13:03:21 +0200
committerLaurent Bonnans <laurent.bonnans@here.com>2018-09-18 14:54:23 +0200
commitc035200bda65f96880cb1663a5841faeb4470861 (patch)
tree4203ff93260f7bcf85656ec5567614fcc33d7f08
parentae02ae957a6e094b822d747b3a001a3a8c8845ed (diff)
downloadmeta-updater-c035200bda65f96880cb1663a5841faeb4470861.tar.gz
Add support for rollback on Raspberry Pi
-rw-r--r--classes/sota_raspberrypi.bbclass2
-rw-r--r--recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb23
-rwxr-xr-xrecipes-sota/aktualizr/aktualizr_git.bb4
-rw-r--r--recipes-sota/aktualizr/files/aktualizr.service4
4 files changed, 30 insertions, 3 deletions
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass
index 9b6a5aa..600f9e9 100644
--- a/classes/sota_raspberrypi.bbclass
+++ b/classes/sota_raspberrypi.bbclass
@@ -20,3 +20,5 @@ KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3
20 20
21# Kernel args normally provided by RPi's internal bootloader. Non-updateable 21# Kernel args normally provided by RPi's internal bootloader. Non-updateable
22OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 " 22OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 "
23
24SOTA_CLIENT_FEATURES_append = " ubootenv"
diff --git a/recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb b/recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb
new file mode 100644
index 0000000..c9753e4
--- /dev/null
+++ b/recipes-sota/aktualizr/aktualizr-uboot-env-rollback.bb
@@ -0,0 +1,23 @@
1SUMMARY = "Aktualizr configuration snippet to enable uboot bootcount function"
2HOMEPAGE = "https://github.com/advancedtelematic/aktualizr"
3SECTION = "base"
4LICENSE = "MPL-2.0"
5LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=9741c346eef56131163e13b9db1241b3"
6DEPENDS = "aktualizr-native"
7RDEPENDS_${PN} = "aktualizr"
8
9SRC_URI = " \
10 file://LICENSE \
11 "
12
13do_install() {
14 install -m 0700 -d ${D}${libdir}/sota/conf.d
15 install -m 0644 ${STAGING_DIR_NATIVE}${libdir}/sota/sota_uboot_env.toml ${D}${libdir}/sota/conf.d/30-rollback.toml
16}
17
18FILES_${PN} = " \
19 ${libdir}/sota/conf.d \
20 ${libdir}/sota/conf.d/30-rollback.toml \
21 "
22
23# vim:set ts=4 sw=4 sts=4 expandtab:
diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb
index 9112546..b9d5f9c 100755
--- a/recipes-sota/aktualizr/aktualizr_git.bb
+++ b/recipes-sota/aktualizr/aktualizr_git.bb
@@ -12,6 +12,8 @@ DEPENDS_append_class-native = "glib-2.0-native "
12RDEPENDS_${PN}_class-target = "lshw " 12RDEPENDS_${PN}_class-target = "lshw "
13RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', ' slcand-start', '', d)} " 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', 'hsm', ' softhsm softhsm-testtoken', '', d)}" 14RDEPENDS_${PN}_append_class-target = "${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'hsm', ' softhsm softhsm-testtoken', '', d)}"
15RDEPENDS_${PN}_append_class-target = " ${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'u-boot-fw-utils', '')}"
16RDEPENDS_${PN}_append_class-target = " ${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'ubootenv', ' aktualizr-uboot-env-rollback', '', d)} "
15 17
16RDEPENDS_${PN}_append_class-target = " ${PN}-tools " 18RDEPENDS_${PN}_append_class-target = " ${PN}-tools "
17RDEPENDS_${PN}-secondary_append_class-target = " ${PN}-tools " 19RDEPENDS_${PN}-secondary_append_class-target = " ${PN}-tools "
@@ -66,6 +68,7 @@ do_install_append () {
66 install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml 68 install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml
67 install -m 0644 ${S}/config/sota_implicit_prov_ca.toml ${D}/${libdir}/sota/sota_implicit_prov_ca.toml 69 install -m 0644 ${S}/config/sota_implicit_prov_ca.toml ${D}/${libdir}/sota/sota_implicit_prov_ca.toml
68 install -m 0644 ${S}/config/sota_secondary.toml ${D}/${libdir}/sota/sota_secondary.toml 70 install -m 0644 ${S}/config/sota_secondary.toml ${D}/${libdir}/sota/sota_secondary.toml
71 install -m 0644 ${S}/config/sota_uboot_env.toml ${D}/${libdir}/sota/sota_uboot_env.toml
69 install -d ${D}${systemd_unitdir}/system 72 install -d ${D}${systemd_unitdir}/system
70 install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket 73 install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket
71 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service 74 install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service
@@ -113,6 +116,7 @@ FILES_${PN}-host-tools = " \
113 ${libdir}/sota/sota_hsm_prov.toml \ 116 ${libdir}/sota/sota_hsm_prov.toml \
114 ${libdir}/sota/sota_implicit_prov.toml \ 117 ${libdir}/sota/sota_implicit_prov.toml \
115 ${libdir}/sota/sota_implicit_prov_ca.toml \ 118 ${libdir}/sota/sota_implicit_prov_ca.toml \
119 ${libdir}/sota/sota_uboot_env.toml \
116 " 120 "
117 121
118FILES_${PN}-tools = " \ 122FILES_${PN}-tools = " \
diff --git a/recipes-sota/aktualizr/files/aktualizr.service b/recipes-sota/aktualizr/files/aktualizr.service
index 1c2e1df..6de4474 100644
--- a/recipes-sota/aktualizr/files/aktualizr.service
+++ b/recipes-sota/aktualizr/files/aktualizr.service
@@ -1,8 +1,6 @@
1[Unit] 1[Unit]
2Description=Aktualizr SOTA Client 2Description=Aktualizr SOTA Client
3Wants=network-online.target 3After=network.target
4After=network.target network-online.target
5Requires=network-online.target
6 4
7[Service] 5[Service]
8RestartSec=10 6RestartSec=10