Modello-Installer: install Modello apps 80/27880/1
authorKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Fri, 19 Sep 2014 14:02:25 +0000 (16:02 +0200)
committerKévin THIERRY <kevin.thierry@open.eurogiciel.org>
Mon, 22 Sep 2014 11:17:52 +0000 (13:17 +0200)
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 <kevin.thierry@open.eurogiciel.org>
recipes-tizen/Modello-Installer/Modello-Installer-extraconf.inc
recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.service [new file with mode: 0644]
recipes-tizen/Modello-Installer/Modello-Installer/modello-installer-postinst.sh [new file with mode: 0644]

index 34d5441..45cfdc3 100644 (file)
@@ -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 (file)
index 0000000..7e9500d
--- /dev/null
@@ -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 (file)
index 0000000..10a08bc
--- /dev/null
@@ -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