summaryrefslogtreecommitdiffstats
path: root/recipes-sota
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-sota')
-rw-r--r--recipes-sota/sota-credentials/sota-credentials.bb27
1 files changed, 27 insertions, 0 deletions
diff --git a/recipes-sota/sota-credentials/sota-credentials.bb b/recipes-sota/sota-credentials/sota-credentials.bb
new file mode 100644
index 0000000..f523f21
--- /dev/null
+++ b/recipes-sota/sota-credentials/sota-credentials.bb
@@ -0,0 +1,27 @@
1SUMMARY = "Deploy SOTA credentials on the defice"
2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5FILES_${PN} += "${sysconfdir}/sota.toml"
6
7ALLOW_EMPTY_${PN} = "1"
8
9export SOTA_CREDENTIALS
10
11do_install() {
12 if [ -n "$SOTA_CREDENTIALS" ]; then
13 if [ -f "$SOTA_CREDENTIALS" ]; then
14 EXT=`basename $SOTA_CREDENTIALS | cut -d'.' -f2`
15 if [ "$EXT" != "toml" ]; then
16 bbwarn "File\'s extension is not \'toml\', make sure you have the correct file"
17 fi
18
19 install -d ${D}${sysconfdir}
20 cat $SOTA_CREDENTIALS | sed 's/^package_manager = .*$/package_manager = "ostree"/' > ${D}${sysconfdir}/sota.toml
21 chmod 644 ${D}${sysconfdir}/sota.toml
22 else
23 bberror "File $SOTA_CREDENTIALS does not exist"
24 fi
25 fi
26}
27