From d7fe0c700454c656f62da5da51499a13b73daa70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?K=C3=A9vin=20THIERRY?= Date: Fri, 19 Sep 2014 16:02:25 +0200 Subject: [PATCH] Modello-Installer: install Modello apps MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Install Modello applications at first boot. If installation is successful, it won't be tried again next times the system is restarted. Change-Id: Ib76f457e564cb827ca3d3d0f6ce4b87aac7a3efd Signed-off-by: Kévin THIERRY --- .../Modello-Installer-extraconf.inc | 14 +++++++++++++- .../modello-installer-postinst.service | 11 +++++++++++ .../Modello-Installer/modello-installer-postinst.sh | 20 ++++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.service create mode 100644 recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.sh diff --git a/recipes-tizen/Modello-Installer/Modello-Installer-extraconf.inc b/recipes-tizen/Modello-Installer/Modello-Installer-extraconf.inc index 34d5441..45cfdc3 100644 --- a/recipes-tizen/Modello-Installer/Modello-Installer-extraconf.inc +++ b/recipes-tizen/Modello-Installer/Modello-Installer-extraconf.inc @@ -1,3 +1,15 @@ +SRC_URI += "file://modello-installer-postinst.sh" +SRC_URI += "file://modello-installer-postinst.service" + RDEPENDS_Modello_Installer-xwalk_remove = "Modello_Phone" -ALLOW_EMPTY_Modello_Installer-xwalk = "1" \ No newline at end of file +do_install_append() { + install -m 0755 -p -D ${WORKDIR}/modello-installer-postinst.sh ${D}${prefix}/share/modello-installer/modello-installer-postinst.sh + install -p -D ${WORKDIR}/modello-installer-postinst.service ${D}/lib/systemd/system/modello-installer-postinst.service + mkdir -p ${D}/lib/systemd/system/multi-user.target.wants + ln -sf ../modello-installer-postinst.service ${D}/lib/systemd/system/multi-user.target.wants/modello-installer-postinst.service +} + +FILES_Modello_Installer-xwalk += "${prefix}/share/modello-installer/modello-installer-postinst.sh" +FILES_Modello_Installer-xwalk += "/lib/systemd/system/modello-installer-postinst.service" +FILES_Modello_Installer-xwalk += "/lib/systemd/system/multi-user.target.wants/modello-installer-postinst.service" diff --git a/recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.service b/recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.service new file mode 100644 index 0000000..7e9500d --- /dev/null +++ b/recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.service @@ -0,0 +1,11 @@ +[Unit] +Description=Install Modello applications +Before=Modello_Homescreen.service + +[Service] +Type=oneshot +ExecStart=/usr/share/modello-installer/modello-installer-postinst.sh +ExecStartPost=/bin/rm -f /lib/systemd/system/multi-user.target.wants/modello-installer-postinst.service + +[Install] +WantedBy=multi-user.target diff --git a/recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.sh b/recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.sh new file mode 100644 index 0000000..10a08bc --- /dev/null +++ b/recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.sh @@ -0,0 +1,20 @@ +#!/bin/sh -e + +source /etc/tizen-platform.conf +export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/5000/dbus/user_bus_socket" + +for list in $(find $TZ_SYS_APP_PREINSTALL -name "Modello*") +do + #XWalk requires you not be root to install files + echo "Installing $list" + /bin/su app -c "xwalkctl -i $list" +done + +for list2 in $(ls -d $TZ_SYS_HOME/app/.config/xwalk-service/applications/*/) +do + /bin/su app -c "mkdir -p '$list2/css'" + /bin/su app -c "mkdir -p '$list2/js'" + /bin/su app -c "cp -r /opt/usr/apps/_common/js/services '$list2/js/'" + /bin/su app -c "cp -r /opt/usr/apps/_common/css/* '$list2/css/'" + /bin/su app -c "cp -r /opt/usr/apps/_common/icons '$list2/'" +done -- 2.7.4