Skip to content

Commit

Permalink
Move x11 to xorg and make x11 a meta-target.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnschneid committed Nov 23, 2013
1 parent fe79f0e commit 52b37a1
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 31 deletions.
10 changes: 9 additions & 1 deletion targets/common
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# DESCRIPTION with the description of the target, and REQUIRES with a
# space-separated list of other targets it needs.

# The script can also specify a space-separated list of targets in PROVIDES;
# this will prevent other targets from installing when this one is done first.

# Finally, targets can set HOSTBIN, CHROOTBIN, and CHROOTETC with a
# space-separated list of files to copy from host-bin, chroot-bin, and
# chroot-etc into the appropriate places.
Expand All @@ -36,9 +39,14 @@ elif [ ! "$TARGETS" = 'check' ]; then
else
echo "$TARGET" >> "${TARGETDEDUPFILE:-/dev/null}"
fi
# Avoid adding things already provided
for t in $PROVIDES; do
echo "$t" >> "${TARGETDEDUPFILE:-/dev/null}"
done
# Source the prerequisites
for t in $REQUIRES; do
(TARGET="$t" HOSTBIN='' CHROOTBIN='' CHROOTETC=''; . "$TARGETSDIR/$t")
(TARGET="$t" PROVIDES='' HOSTBIN='' CHROOTBIN='' CHROOTETC=''
. "$TARGETSDIR/$t")
done
# Add a print to the output
echo ''
Expand Down
30 changes: 5 additions & 25 deletions targets/x11
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,10 @@
# 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.
if [ ! "$TARGETS" = 'help' -a ! "${ARCH#arm}" = "$ARCH" ]; then
echo 'x11 target does not work on ARM. Substituting in xephyr.' 1>&2
TARGET=xephyr
. "${TARGETSDIR:="$PWD"}/$TARGET"
if [ "${ARCH#arm}" != "$ARCH" ]; then
REQUIRES='xephyr'
else
REQUIRES='xorg'
fi
REQUIRES='core audio'
DESCRIPTION='Basic X11 install. Does not install any desktop environment.'
CHROOTBIN='croutoncycle croutonpowerd croutonxinitrc-wrapper setres xinit'
CHROOTETC='xbindkeysrc.scm xserverrc-x11'
DESCRIPTION='X11 via autodetected backend. Does not install any desktop environment.'
. "${TARGETSDIR:="$PWD"}/common"

### Append to prepare.sh:
XMETHOD=x11

install xorg dmz-cursor-theme kbd
# Fix launching X11 from inside crosh (user doesn't own a TTY)
sed -i 's/allowed_users=.*/allowed_users=anybody/' '/etc/X11/Xwrapper.config'

# Make chvt and fgconsole SUID root so we don't need to run keylaunch as root
chmod u+s /bin/chvt

TIPS="$TIPS
You can flip through your running chroot desktops and Chromium OS by hitting
Ctrl+Alt+Shift+Back and Ctrl+Alt+Shift+Forward.
"

### append x11-common
9 changes: 4 additions & 5 deletions targets/xephyr
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
REQUIRES='core audio'
DESCRIPTION='Nested X11 install. Replaces X11 if specified first.'
PROVIDES='x11'
DESCRIPTION='Nested X11 backend. Improves compatibility but lacks GPU accel.'
CHROOTBIN='croutoncycle croutonpowerd croutonwheel croutonwm croutonxinitrc-wrapper xinit'
CHROOTETC='xbindkeysrc.scm xserverrc-xephyr'
# Prevent X11 from being added if it hasn't already.
echo 'x11' >> "${TARGETDEDUPFILE:-/dev/null}"
CHROOTETC='xbindkeysrc.scm xserverrc-xephyr xserverrc-local.example'
. "${TARGETSDIR:="$PWD"}/common"

### Append to prepare.sh:
XMETHOD=xephyr
XMETHOD="${XMETHOD:-xephyr}"

if release -eq quantal; then
# As of 2013-01-08, Quantal's Xephyr lacks GLX. Download one manually.
Expand Down
30 changes: 30 additions & 0 deletions targets/xorg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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.
if [ "$TARGETS" != 'help' -a "${ARCH#arm}" != "$ARCH" ]; then
error 1 'xorg target does not work on ARM.'
fi
REQUIRES='core audio'
PROVIDES='x11'
DESCRIPTION='X.Org X11 backend. Enables GPU acceleration on supported platforms.'
CHROOTBIN='croutoncycle croutonpowerd croutonxinitrc-wrapper setres xinit'
CHROOTETC='xbindkeysrc.scm xserverrc-x11 xserverrc-local.example'
. "${TARGETSDIR:="$PWD"}/common"

### Append to prepare.sh:
XMETHOD="${XMETHOD:-x11}"

install xorg dmz-cursor-theme kbd
# Fix launching X11 from inside crosh (user doesn't own a TTY)
sed -i 's/allowed_users=.*/allowed_users=anybody/' '/etc/X11/Xwrapper.config'

# Make chvt and fgconsole SUID root so we don't need to run keylaunch as root
chmod u+s /bin/chvt

TIPS="$TIPS
You can flip through your running chroot desktops and Chromium OS by hitting
Ctrl+Alt+Shift+Back and Ctrl+Alt+Shift+Forward.
"

### append x11-common

0 comments on commit 52b37a1

Please sign in to comment.