Merge "Fix Smack label on "app" home directory" into tizen
[profile/ivi/meta-ivi.git] / scripts / base-weston-default.post
1 # Initialize the native application database
2 pkg_initdb
3
4 # Add 'app' user to the weston-launch group
5 /usr/sbin/groupmod -A app weston-launch
6
7 # Temporary work around for bug in filesystem package resulting in the 'app' user home
8 # directory being only readable by root
9 chown -R app:app /opt/home/app
10
11 # Since weston-launch runs with the "User" label, the app
12 # home dir must have the same label
13 chsmack -a User /opt/home/app
14
15 # base-weston-default.post
16 mkdir -p /usr/lib/systemd/system/graphical.target.wants
17 ln -sf ../user-session@.service /usr/lib/systemd/system/graphical.target.wants/user-session@5000.service
18 ln -sf weston.target  /usr/lib/systemd/user/default.target
19
20 # Add over-riding environment to enable the web runtime to
21 # run on an IVI image as a different user then the tizen user
22 # Some notes on some of the variables:
23 #  - ELM_THEME is needed in order for the wrt to have visible content
24 #  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
25 cat > /etc/sysconfig/wrt <<EOF
26 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
27 XDG_RUNTIME_DIR=/run/user/5000
28 ELM_ENGINE=wayland_egl
29 ECORE_EVAS_ENGINE=wayland_egl
30 ELM_THEME=tizen-HD-light
31 WRT_PROCESS_POOL_DISABLE=1
32 EOF
33
34 # Use the same over-rides for the native prelaunch daemon
35 cp /etc/sysconfig/wrt /etc/sysconfig/launchpad
36
37 # Add a rule to ensure the app user has permissions to
38 # open the graphics device
39 cat > /etc/udev/rules.d/99-dri.rules <<EOF
40 SUBSYSTEM=="drm", MODE="0666"
41 EOF