summaryrefslogtreecommitdiff
path: root/scripts/base-weston-default.post
blob: 73f0768e3fcea7e138d685f4800f01f5a7e41cf1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#################### base-weston-default.post ##################
# Initialize the native application database
pkg_initdb

# Add 'app' user to the weston-launch group
/usr/sbin/groupmod -A app weston-launch

# Temporary work around for bug in filesystem package resulting in the 'app' user home
# directory being only readable by root
chown -R app:app /opt/home/app

# Since weston-launch runs with the "User" label, the app
# home dir must have the same label
chsmack -a User /opt/home/app

# Enable a logind session for 'app' user on seat0 (the default seat for
# graphical sessions)
mkdir -p /usr/lib/systemd/system/graphical.target.wants
ln -s ../user-session-launch@.service /usr/lib/systemd/system/graphical.target.wants/user-session-launch@seat0-5000.service
ln -sf weston.target  /usr/lib/systemd/user/default.target

# Enable user@5000.service by setting the linger for user 'app'
#mkdir -p /var/lib/systemd/linger
#touch /var/lib/systemd/linger/app

# Add over-riding environment to enable the web runtime to
# run as a different user than the tizen user
# Some notes on some of the variables:
#  - ELM_THEME is needed in order for the wrt to have visible content
#  - WRT_PROCESS_POOL_DISABLE is a work around for TIVI-2062
cat > /etc/sysconfig/wrt <<EOF
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/5000/dbus/user_bus_socket
XDG_RUNTIME_DIR=/run/user/5000
ELM_ENGINE=wayland_egl
ECORE_EVAS_ENGINE=wayland_egl
ELM_THEME=tizen-HD-light
WRT_PROCESS_POOL_DISABLE=1
EOF

# Use the same over-rides for the native prelaunch daemon
cp /etc/sysconfig/wrt /etc/sysconfig/launchpad

# sdx: for AMD (ac.service)
#cp /etc/sysconfig/wrt /etc/sysconfig/prelaunch

# Add a rule to ensure the app user has permissions to
# open the graphics device
cat > /etc/udev/rules.d/99-dri.rules <<EOF
SUBSYSTEM=="drm", MODE="0666"
EOF

############

# sdx: set DBUS env inside weston shell (login shell)
cat >/etc/profile.d/user-dbus.sh <<'EOF'
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$UID/dbus/user_bus_socket
EOF

# sdx: user 'app' must own /dev/tty1 for weston to start correctly
cat >/usr/lib/udev/rules.d/99-tty.rules <<EOF
SUBSYSTEM=="tty", KERNEL=="tty1", GROUP="app", OWNER="app"
EOF

# sdx: fix smack labels on /var/log
chsmack -a '*' /var/log