summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonan Le Martret <ronan.lemartret@iot.bzh>2017-02-15 16:54:11 +0100
committerRonan Le Martret <ronan.lemartret@iot.bzh>2017-02-17 11:26:10 +0100
commite402d67b4314d4989ffb7bcbc882f785cbdf6f2b (patch)
treedfbf0c71fb15d4f7ec184ee9c6f758dcda700c18
parent812bc8ab9490e2418dedcf3a868a0ef9393ab01f (diff)
Add afm-install used to install wgt at first boot
* afm-install can install wgt app like afm-util but use dbus "system" session instead of "user". #/usr/bin/afm-install install /usr/AGL/apps/$file.wgt Change-Id: Id7361350257347a8db32f539b3bdeb3f2d8f554c Signed-off-by: Ronan Le Martret <ronan.lemartret@iot.bzh>
-rwxr-xr-xmeta-app-framework/recipes-core/af-main/af-main/afm-install44
-rw-r--r--meta-app-framework/recipes-core/af-main/af-main_1.0.bb6
2 files changed, 50 insertions, 0 deletions
diff --git a/meta-app-framework/recipes-core/af-main/af-main/afm-install b/meta-app-framework/recipes-core/af-main/af-main/afm-install
new file mode 100755
index 0000000..6d37bae
--- /dev/null
+++ b/meta-app-framework/recipes-core/af-main/af-main/afm-install
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+pretty() {
+ sed \
+ -e '/^method return .*/d' \
+ -e 's/^Error org.freedesktop.DBus.Error.Failed: "\?\(.*\)"\?$/ERROR: \1/' \
+ -e 's/^ string "\(.*\)"/\1/' \
+ -e 's/},/&\n/'
+}
+
+send() {
+ dbus-send --system --print-reply \
+ --dest=org.AGL.afm.system \
+ /org/AGL/afm/system \
+ org.AGL.afm.system.$1 \
+ "string:$2" |
+ pretty
+}
+
+case "$1" in
+
+ add|install)
+ f=$(realpath $2)
+ send install '{"wgt":"'"$f"'","force":true}'
+ ;;
+
+ -h|--help|help)
+ cat << EOC
+
+The commands are:
+
+ add wgt
+ install wgt install the wgt file
+
+EOC
+ ;;
+
+ *)
+ echo "unknown command $1" >&2
+ exit 1
+ ;;
+esac
+
+
diff --git a/meta-app-framework/recipes-core/af-main/af-main_1.0.bb b/meta-app-framework/recipes-core/af-main/af-main_1.0.bb
index 834e293..7819bfa 100644
--- a/meta-app-framework/recipes-core/af-main/af-main_1.0.bb
+++ b/meta-app-framework/recipes-core/af-main/af-main_1.0.bb
@@ -64,6 +64,11 @@ SRC_URI += "\
file://add-qt-wayland-shell-integration.patch \
"
+# tools used to install wgt at first boot
+SRC_URI += "\
+ file://afm-install \
+"
+
do_install_append() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/init-afm-dirs.sh ${D}${bindir}
@@ -74,6 +79,7 @@ do_install_append() {
install -p -D ${WORKDIR}/init-afm-dirs.service ${D}${systemd_unitdir}/system/init-afm-dirs.service
ln -sf ${systemd_unitdir}/system/init-afm-dirs.service ${D}${sysconfdir}/systemd/system/default.target.wants
fi
+ install -m 0755 ${WORKDIR}/afm-install ${D}${bindir}
}
do_install_append_smack () {