d644ad09924ae5d1e8eb6dc054c1e5c1b284408e
[platform/upstream/meta-generic.git] / scripts / generic-desktop-applications.post
1 #!/bin/sh
2 echo "#################### generic-desktop-applications.post ####################"
3
4 # temp workaround to fill each user app_info database with global db infos
5 . /etc/tizen-platform.conf
6 ail_initdb
7 pkg_initdb
8
9 # workaround TC-1624 (ail-initdb/pkg_initdb segfault in MIC)
10 cat >/usr/lib/systemd/system/appfw_initdb.service  <<'EOF'
11 [Unit]
12 Description=First boot script for init App DB (workaround TC-1624)
13 ConditionPathExists=!/usr/dbspace/.app_info.db
14 Before=ac.service
15
16 [Service]
17 ExecStart=/usr/bin/ail_initdb ; /usr/bin/pkg_initdb
18 Type=oneshot
19 RemainAfterExit=yes
20 EOF
21 ln -s appfw_initdb.service /usr/lib/systemd/system/graphical.target.wants/
22
23 # depends on generic-base functions
24 function generic_desktop_applications_fix_userhome() {
25         user=$1
26
27         generic_base_user_exists $user || return 1
28         homedir=$(generic_base_user_home $user)
29         
30         echo "Fix app_info.db of $user"
31         chown -R $user:users $homedir/.applications/dbspace/
32 }
33
34 # fix app user
35 generic_desktop_applications_fix_userhome app
36
37
38