diff options
author | Ronan Le Martret <ronan.lemartret@iot.bzh> | 2017-02-15 16:54:11 +0100 |
---|---|---|
committer | Stephane Desneux <stephane.desneux@iot.bzh> | 2017-03-27 15:33:40 +0200 |
commit | 802f845b9d31b8b72067930abd2a23f1a321c691 (patch) | |
tree | 194e99d58f73fa747ac3d3f65da8c9f4746a67b1 /meta-app-framework | |
parent | a9fd01093b3feda9a5f71484c1934c890da8cb52 (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>
Signed-off-by: Stephane Desneux <stephane.desneux@iot.bzh>
Diffstat (limited to 'meta-app-framework')
-rwxr-xr-x | meta-app-framework/recipes-core/af-main/af-main/afm-install | 44 | ||||
-rw-r--r-- | meta-app-framework/recipes-core/af-main/af-main_1.0.bb | 6 |
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 000000000..6d37baed8 --- /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 834e293fa..7819bfadf 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 () { |