1ccef6fe57c30998dce698bd397dfa7ad14f5b0f
[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 # Enable a logind session for 'app' user on seat0 (the default seat for
16 # graphical sessions)
17 mkdir -p /usr/lib/systemd/system/graphical.target.wants
18 ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service
19 ln -sf weston.target  /usr/lib/systemd/user/default.target
20
21 # Add over-riding environment to enable the web runtime to
22 # run on an IVI image as a different user then the tizen user
23 # Some notes on some of the variables:
24 #  - ELM_THEME is needed in order for the wrt to have visible content
25 #  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
26 cat > /etc/sysconfig/wrt <<EOF
27 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
28 XDG_RUNTIME_DIR=/run/user/5000
29 ELM_ENGINE=wayland_egl
30 ECORE_EVAS_ENGINE=wayland_egl
31 ELM_THEME=tizen-HD-light
32 WRT_PROCESS_POOL_DISABLE=1
33 EOF
34
35 # Use the same over-rides for the native prelaunch daemon
36 cp /etc/sysconfig/wrt /etc/sysconfig/launchpad
37
38 # Add a rule to ensure the app user has permissions to
39 # open the graphics device
40 cat > /etc/udev/rules.d/99-dri.rules <<EOF
41 SUBSYSTEM=="drm", MODE="0666"
42 EOF