diff options
author | Ronan Le Martret <ronan.lemartret@iot.bzh> | 2017-02-15 16:54:11 +0100 |
---|---|---|
committer | Ronan Le Martret <ronan.lemartret@iot.bzh> | 2017-02-15 20:54:35 +0100 |
commit | 347aa4d4cb96df12f5b7e4cb4775a59d26861c29 (patch) | |
tree | f6c931efeb4e9b04cfc5398cb9489c67c8d9a6c5 /meta-app-framework/recipes-core/af-main | |
parent | 5a7b27c47f1cd51b21f17e38a8abce5504d78471 (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>
Diffstat (limited to 'meta-app-framework/recipes-core/af-main')
-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 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 () { |