/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>
%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
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*
#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)
#include "ail.h"
#include "ail_private.h"
+#include "ail_db.h"
#ifdef _E
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.");