From 802f845b9d31b8b72067930abd2a23f1a321c691 Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Wed, 15 Feb 2017 16:54:11 +0100 Subject: 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 Signed-off-by: Stephane Desneux --- .../recipes-core/af-main/af-main/afm-install | 44 ++++++++++++++++++++++ .../recipes-core/af-main/af-main_1.0.bb | 6 +++ 2 files changed, 50 insertions(+) create mode 100755 meta-app-framework/recipes-core/af-main/af-main/afm-install (limited to 'meta-app-framework/recipes-core/af-main') 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 () { -- cgit 1.2.3-korg