summaryrefslogtreecommitdiffstats
path: root/meta-iot/recipes-web/the-thing-system/steward-init.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-iot/recipes-web/the-thing-system/steward-init.bb')
-rw-r--r--meta-iot/recipes-web/the-thing-system/steward-init.bb40
1 files changed, 40 insertions, 0 deletions
diff --git a/meta-iot/recipes-web/the-thing-system/steward-init.bb b/meta-iot/recipes-web/the-thing-system/steward-init.bb
new file mode 100644
index 0000000..3f58251
--- /dev/null
+++ b/meta-iot/recipes-web/the-thing-system/steward-init.bb
@@ -0,0 +1,40 @@
1SUMMARY = "Initialization service for TheThingSystem steward"
2DESCRIPTION = "Initializes TheThingSystem steward services."
3
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://LICENSE.steward-init;md5=2fe93140f8c4e56b56fbcd64730767a4"
6
7SRC_URI = "\
8 file://steward-init-settings.sh \
9 file://steward-init.service.in \
10 file://LICENSE.steward-init \
11"
12
13S = "${WORKDIR}"
14PR = "r2"
15
16THE_THING_SYSTEM ?= "/opt/TheThingSystem"
17
18inherit systemd
19SYSTEMD_PACKAGES = "${PN}"
20SYSTEMD_SERVICE_${PN} = "steward-init.service"
21
22FILES_${PN} = "\
23 ${THE_THING_SYSTEM}/steward/* \
24 ${sysconfdir}/TheThingSystem/* \
25"
26
27do_install() {
28 install -d ${D}${THE_THING_SYSTEM}/steward
29 install -d ${D}${systemd_unitdir}/system
30 install -m 0755 ${WORKDIR}/steward-init-settings.sh ${D}${THE_THING_SYSTEM}/steward
31
32 sed 's,@the_thing_system_dir@,${THE_THING_SYSTEM},g' < ${WORKDIR}/steward-init.service.in \
33 > ${D}${systemd_unitdir}/system/steward-init.service
34
35 install -d ${D}/etc/TheThingSystem
36 echo "# Configuration options for TheThingSystem/steward" > ${D}/etc/TheThingSystem/config
37 echo "# Generated `date`" >> ${D}/etc/TheThingSystem/config
38 echo "THE_THING_SYSTEM=${THE_THING_SYSTEM}" >> ${D}/etc/TheThingSystem/config
39 echo "NODE_PATH=${THE_THING_SYSTEM}/steward" >> ${D}/etc/TheThingSystem/config
40}