Fix multi-user configuration
[profile/ivi/meta-ivi.git] / scripts / base-weston-default.post
1 # Initialize the native application database
2 pkg_initdb
3
4 # adjust app group: main group 'users', extra group 'app', 'weston-launch'
5 /usr/sbin/usermod -g users app
6 /usr/sbin/usermod -G app,weston-launch app
7
8 # Enable a logind session for 'app' user on seat0 (the default seat for
9 # graphical sessions)
10 mkdir -p /usr/lib/systemd/system/graphical.target.wants
11 ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service
12 ln -sf weston.target  /usr/lib/systemd/user/default.target
13
14 # Add over-riding environment to enable the web runtime to
15 # run on an IVI image as a different user then the tizen user
16 # Some notes on some of the variables:
17 #  - ELM_THEME is needed in order for the wrt to have visible content
18 #  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
19 cat > /etc/sysconfig/wrt <<EOF
20 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
21 XDG_RUNTIME_DIR=/run/user/5000
22 ELM_ENGINE=wayland_egl
23 ECORE_EVAS_ENGINE=wayland_egl
24 ELM_THEME=tizen-HD-light
25 WRT_PROCESS_POOL_DISABLE=1
26 EOF
27
28 # Use the same over-rides for the native prelaunch daemon
29 cp /etc/sysconfig/wrt /etc/sysconfig/launchpad
30
31 # Add a rule to ensure the app user has permissions to
32 # open the graphics device
33 cat > /etc/udev/rules.d/99-dri.rules <<EOF
34 SUBSYSTEM=="drm", MODE="0666"
35 EOF