summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Smirnov <evgenii.smirnov@here.com>2019-10-23 17:34:19 +0200
committerMykhaylo Sul <ext-mykhaylo.sul@here.com>2019-11-05 10:08:36 +0100
commiteccef5c18bdcaf4f6c439428d03004c4cd359460 (patch)
tree0df7299ae752dfba957dc0fac6c68128734d1ff2
parent4ae9917bf2475c118e8015ec7a2ce10bd01a0124 (diff)
downloadmeta-updater-eccef5c18bdcaf4f6c439428d03004c4cd359460.tar.gz
Indicate an OSTree boot on start
Signed-off-by: Mykhaylo Sul <ext-mykhaylo.sul@here.com>
-rw-r--r--classes/sota.bbclass2
-rwxr-xr-xrecipes-sota/ostree/files/touch-ostree21
-rw-r--r--recipes-sota/ostree/ostree-booted_1.0.bb15
3 files changed, 37 insertions, 1 deletions
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 5b06397..ecf08ae 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -21,7 +21,7 @@ python () {
21 d.setVar("SOTA_CLIENT_PROV", "aktualizr-device-prov-hsm") 21 d.setVar("SOTA_CLIENT_PROV", "aktualizr-device-prov-hsm")
22} 22}
23 23
24IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV}" 24IMAGE_INSTALL_append_sota = " ostree os-release ${SOTA_CLIENT} ${SOTA_CLIENT_PROV} ostree-booted"
25IMAGE_CLASSES += " image_types_ostree image_types_ota" 25IMAGE_CLASSES += " image_types_ostree image_types_ota"
26 26
27IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}" 27IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush garagesign garagecheck ota-ext4 wic', ' ', d)}"
diff --git a/recipes-sota/ostree/files/touch-ostree b/recipes-sota/ostree/files/touch-ostree
new file mode 100755
index 0000000..28cb672
--- /dev/null
+++ b/recipes-sota/ostree/files/touch-ostree
@@ -0,0 +1,21 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: touch-ostree
4# Required-Start: $network $remote_fs
5# Required-Stop: $network $remote_fs
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Indicate OSTree boot
9### END INIT INFO
10
11case "$1" in
12 start)
13 touch /run/ostree-booted
14 ;;
15 stop)
16 ;;
17 *)
18 echo "Usage: /etc/init.d/touch-ostree {start|stop}"
19 exit 1
20 ;;
21esac
diff --git a/recipes-sota/ostree/ostree-booted_1.0.bb b/recipes-sota/ostree/ostree-booted_1.0.bb
new file mode 100644
index 0000000..d74cf24
--- /dev/null
+++ b/recipes-sota/ostree/ostree-booted_1.0.bb
@@ -0,0 +1,15 @@
1SUMMARY = "Indicate an OSTree boot"
2DESCRIPTION = "Indicate an OSTree boot"
3LICENSE = "MPL-2.0"
4LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
5SRC_URI = "file://touch-ostree"
6
7inherit allarch update-rc.d
8
9INITSCRIPT_NAME = "touch-ostree"
10INITSCRIPT_PARAMS = "start 8 2 3 4 5 . stop 20 0 1 6 ."
11
12do_install() {
13 install -d ${D}${sysconfdir}/init.d
14 install -m 0755 ${WORKDIR}/touch-ostree ${D}${sysconfdir}/init.d/touch-ostree
15}