310e1f22a6d719a45c4c6d49b300092e25f375e7
[platform/upstream/meta-generic.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 weston.target  /usr/lib/systemd/user/default.target
18
19 # Enable user@5000.service by setting the linger for user 'app'
20 mkdir -p /var/lib/systemd/linger
21 touch /var/lib/systemd/linger/app
22
23 # Add over-riding environment to enable the web runtime to
24 # run on an IVI image as a different user then the tizen user
25 # Some notes on some of the variables:
26 #  - ELM_THEME is needed in order for the wrt to have visible content
27 #  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
28 cat > /etc/sysconfig/wrt <<EOF
29 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
30 XDG_RUNTIME_DIR=/run/user/5000
31 ELM_ENGINE=wayland_egl
32 ECORE_EVAS_ENGINE=wayland_egl
33 ELM_THEME=tizen-HD-light
34 WRT_PROCESS_POOL_DISABLE=1
35 EOF
36
37 # Use the same over-rides for the native prelaunch daemon
38 cp /etc/sysconfig/wrt /etc/sysconfig/launchpad
39
40 # Add a rule to ensure the app user has permissions to
41 # open the graphics device
42 cat > /etc/udev/rules.d/99-dri.rules <<EOF
43 SUBSYSTEM=="drm", MODE="0666"
44 EOF
45
46 # sdx: user 'app' must own /dev/tty1 for weston to start correctly
47 cat >/usr/lib/udev/rules.d/99-tty.rules <<EOF
48 SUBSYSTEM=="tty", KERNEL=="tty1", GROUP="app", OWNER="app"
49 EOF