adjust scripts, patterns and config for generic-[x11,wayland]-[i586,x86_64]
[platform/upstream/meta-generic.git] / scripts / base-weston-default.post
1 #################### base-weston-default.post ##################
2 # to be synced with profile/ivi/meta-ivi/scripts/base-weston-default.post
3
4 # Initialize the native application database
5 pkg_initdb
6
7 # Add 'app' user to the weston-launch group
8 /usr/sbin/groupmod -A app weston-launch
9
10 # Temporary work around for bug in filesystem package resulting in the 'app' user home
11 # directory being only readable by root
12 chown -R app:app /opt/home/app
13
14 # Since weston-launch runs with the "User" label, the app
15 # home dir must have the same label
16 chsmack -a User /opt/home/app
17
18 # Enable a logind session for 'app' user on seat0 (the default seat for
19 # graphical sessions)
20 mkdir -p /usr/lib/systemd/system/graphical.target.wants
21 ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service
22 ln -sf weston.target  /usr/lib/systemd/user/default.target
23
24 # Enable user@5000.service by setting the linger for user 'app'
25 #mkdir -p /var/lib/systemd/linger
26 #touch /var/lib/systemd/linger/app
27
28 # Add over-riding environment to enable the web runtime to
29 # run on an IVI image as a different user then the tizen user
30 # Some notes on some of the variables:
31 #  - ELM_THEME is needed in order for the wrt to have visible content
32 #  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
33 cat > /etc/sysconfig/wrt <<EOF
34 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
35 XDG_RUNTIME_DIR=/run/user/5000
36 ELM_ENGINE=wayland_egl
37 ECORE_EVAS_ENGINE=wayland_egl
38 ELM_THEME=tizen-HD-light
39 WRT_PROCESS_POOL_DISABLE=1
40 EOF
41
42 # Use the same over-rides for the native prelaunch daemon
43 cp /etc/sysconfig/wrt /etc/sysconfig/launchpad
44
45 # sdx: for AMD (ac.service)
46 #cp /etc/sysconfig/wrt /etc/sysconfig/prelaunch
47
48 # Add a rule to ensure the app user has permissions to
49 # open the graphics device
50 cat > /etc/udev/rules.d/99-dri.rules <<EOF
51 SUBSYSTEM=="drm", MODE="0666"
52 EOF
53
54 ############
55
56 # sdx: set DBUS env inside weston shell (login shell)
57 cat >/etc/profile.d/user-dbus.sh <<'EOF'
58 export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/dbus/user_bus_socket
59 EOF
60
61 # sdx: user 'app' must own /dev/tty1 for weston to start correctly
62 cat >/usr/lib/udev/rules.d/99-tty.rules <<EOF
63 SUBSYSTEM=="tty", KERNEL=="tty1", GROUP="app", OWNER="app"
64 EOF
65
66 # sdx: fix smack labels on /var/log
67 chsmack -a '*' /var/log
68