forked from dnschneid/crouton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
x11-common
70 lines (57 loc) · 2.2 KB
/
x11-common
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
67
68
69
70
#!/bin/sh -e
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This isn't a real target; it's the common commands for installing various
# forms of X11.
### Append to prepare.sh:
# Store and apply the X11 method
ln -sfT "/etc/crouton/xserverrc-$XMETHOD" '/etc/X11/xinit/xserverrc'
# Install utility for croutoncycle
compile wmtools '-lX11' libx11-dev
# Install utilities and links for powerd-poking daemon
compile xi2event '-lX11 -lXi' libx11-dev libxi-dev
install --minimal dbus
ln -sf croutonpowerd /usr/local/bin/gnome-screensaver-command
ln -sf croutonpowerd /usr/local/bin/xscreensaver-command
# Install xbindkeys and xautomation for key shortcuts and kbd for chvt
install --minimal xbindkeys xautomation kbd
# Make chvt SUID root so we don't need to run croutoncycle as root
chmod u+s /bin/chvt
# Add a blank Xauthority to all users' home directories
touch /etc/skel/.Xauthority
chmod 600 /etc/skel/.Xauthority
# Make xscreensaver default to blank only
echo 'mode: blank' > /etc/skel/.xscreensaver
# Create /usr/share/desktop-directories to avoid issues with xdg-desktop-menu
mkdir -p /usr/share/desktop-directories
# Prevent Upstart from taking over X sessions
echo > /etc/upstart-xsessions
# This makes sure Xephyr, running as user, can write server-*.xkm files to
# /var/lib/xkb, so it does not conflict with files created by Chromium OS
# X server in /tmp.
mkdir -p /var/lib/xkb
chgrp video /var/lib/xkb
chmod g+rw /var/lib/xkb
# Update policies for mounting and unmounting devices with udisks2
mkdir -p '/etc/polkit-1/localauthority/10-vendor.d'
cat > '/etc/polkit-1/localauthority/10-vendor.d/10-crouton-udisks2.pkla' <<EOF
[Allow mounting when started from crosh]
Identity=*
Action=org.freedesktop.udisks*.filesystem-mount
ResultAny=auth_admin
ResultInactive=yes
ResultActive=yes
[Allow eject when started from crosh]
Identity=*
Action=org.freedesktop.udisks*.*eject*
ResultAny=auth_admin
ResultInactive=yes
ResultActive=yes
[Disallow unmounting of Chromium OS mounts; it won't work]
Identity=*
Action=org.freedesktop.udisks*.filesystem-unmount-others
ResultAny=no
ResultInactive=no
ResultActive=no
EOF