Fix ail_initdb script. 31/28031/1 accepted/tizen/common/20140924.142828 accepted/tizen/ivi/20140925.212642 submit/tizen_common/20140924.140157 submit/tizen_common/20140924.142113 submit/tizen_ivi/20140924.063121 submit/tizen_ivi/20140924.150732
authorBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Wed, 24 Sep 2014 13:50:45 +0000 (15:50 +0200)
committerBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Wed, 24 Sep 2014 13:52:16 +0000 (15:52 +0200)
/usr/dbspace doesn't owned by tizenglobalapp so ail_initdb can't be exectuted correctly.

Make sure that app_info.db is created evenif no desktop file is found in /usr/share/applications

Move tizenglobalapp creation from slp-pkgmgr to ail

Change-Id: Ia33f471263dd4a4d5d6b5791b71ff607c876e981
Signed-off-by: Baptiste DURAND <baptiste.durand@open.eurogiciel.org>
packaging/ail.spec
tool/CMakeLists.txt
tool/src/initdb.c

index 95bc2c3..c20ebfd 100755 (executable)
@@ -54,6 +54,13 @@ export FFLAGS="$FFLAGS -DTIZEN_ENGINEER_MODE"
 
 %post
 /sbin/ldconfig
+# Create tizenglobalapp user needed for global installation
+%{_sbindir}/useradd -d %TZ_SYS_RW_APP -m %TZ_SYS_GLOBALAPP_USER -r -c "system user for common applications" -g root
+
+#mkdir -p %TZ_SYS_RW_APP/.config/xwalk-service/applications
+#cd %TZ_SYS_RW_APP/
+#ln -s .config/xwalk-service/applications/
+
 vconftool set -t string db/ail/ail_info "0" -f -s system::vconf_inhouse
 vconftool set -t string db/menuscreen/desktop "0" -f -s system::vconf_inhouse
 vconftool set -t string db/menu_widget/language "en_US.utf8" -f -s system::vconf_inhouse
@@ -76,6 +83,10 @@ chsmack -a '*' %{TZ_SYS_RO_DESKTOP_APP}
 
 chmod g+w %{TZ_SYS_RW_DESKTOP_APP}
 chmod g+w %{TZ_SYS_RO_DESKTOP_APP}
+chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_RW_DESKTOP_APP}
+chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_RO_DESKTOP_APP}
+chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_RW_APP}
+chown %TZ_SYS_GLOBALAPP_USER:root %{TZ_SYS_DB}
 
 ail_initdb 2>/dev/null
 chsmack -a '*' %{TZ_SYS_DB}/.app_info.db*
index 9e49419..a8128fa 100755 (executable)
@@ -1,7 +1,7 @@
 #AIL init DB build script
 
 SET(INITDB ail_initdb)
-SET(SRCS src/initdb.c)
+SET(SRCS src/initdb.c ../src/ail_db.c)
 
 SET(FOTA ail_fota)
 SET(FOTASRCS src/ail_fota.c)
index db69aa7..447e8d7 100755 (executable)
@@ -32,6 +32,7 @@
 
 #include "ail.h"
 #include "ail_private.h"
+#include "ail_db.h"
 
 
 #ifdef _E
@@ -253,11 +254,11 @@ int main(int argc, char *argv[])
        ret = setenv("AIL_INITDB", "1", 1);
        _D("AIL_INITDB : %d", ret);
        setresuid(GLOBAL_USER, GLOBAL_USER, OWNER_ROOT);
-       ret = initdb_count_app();
-       if (ret > 0) {
-               _D("Some Apps in the App Info DB.");
-       }
 
+       if (db_open(DB_OPEN_RW, GLOBAL_USER) != AIL_ERROR_OK) {
+               _E("Fail to create system databases");
+               return AIL_ERROR_DB_FAILED;
+       }
        ret = initdb_load_directory(USR_DESKTOP_DIRECTORY);
        if (ret == AIL_ERROR_FAIL) {
                _E("cannot load usr desktop directory.");