mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
91 lines
3.3 KiB
Bash
Executable File
91 lines
3.3 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
################################################################################
|
|
# This file is part of OpenELEC - http://www.openelec.tv
|
|
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
|
#
|
|
# This Program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
# any later version.
|
|
#
|
|
# This Program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with OpenELEC; see the file COPYING. If not, write to
|
|
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
# http://www.gnu.org/copyleft/gpl.html
|
|
################################################################################
|
|
|
|
. /etc/profile
|
|
|
|
if [ "$RUNLEVEL" = openelec ]; then
|
|
|
|
logger -t Xorg "### starting Xorg with driver ${xorg_driver} ###"
|
|
|
|
##############################################################################
|
|
# setup xorg.conf paths
|
|
##############################################################################
|
|
|
|
logger -t Xorg "### setup xorg.conf paths ###"
|
|
|
|
XORG_CONF_DEFAULT="/etc/X11/xorg.conf"
|
|
XORG_CONF_DRIVER="/etc/X11/xorg-${xorg_driver}.conf"
|
|
XORG_CONF_USER="/storage/.config/xorg.conf"
|
|
|
|
##############################################################################
|
|
# creating start options
|
|
##############################################################################
|
|
|
|
logger -t Xorg "### creating start options ###"
|
|
|
|
XORG_ARGS="-s 0 -nr -noreset -allowMouseOpenFail -nocursor -nolisten tcp"
|
|
|
|
if [ "$DEBUG" = yes ]; then
|
|
XORG_ARGS="$XORG_ARGS -logverbose 6 -verbose 6"
|
|
fi
|
|
|
|
# load user defined xorg.conf, if exist
|
|
if [ -f "$XORG_CONF_USER" ]; then
|
|
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_USER"
|
|
elif [ -f "$XORG_CONF_DRIVER" ]; then
|
|
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DRIVER"
|
|
elif [ -f "$XORG_CONF_DEFAULT" ]; then
|
|
XORG_ARGS="$XORG_ARGS -config $XORG_CONF_DEFAULT"
|
|
fi
|
|
|
|
##############################################################################
|
|
# creating needed directories and symlinks
|
|
##############################################################################
|
|
|
|
logger -t Xorg "### creating needed directories and symlinks ###"
|
|
|
|
mkdir -p /var/cache/xkb
|
|
mkdir -p /var/lib
|
|
mkdir -m 1777 -p /tmp/.ICE-unix
|
|
chown root:root /tmp/.ICE-unix
|
|
|
|
if [ "${xorg_driver}" = "nvidia" ]; then
|
|
ln -sf /usr/lib/libGL_nvidia.so.1 /var/lib/libGL.so
|
|
ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so
|
|
XORG_ARGS="$XORG_ARGS -ignoreABI"
|
|
else
|
|
ln -sf /usr/lib/libGL_mesa.so.1 /var/lib/libGL.so
|
|
ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so
|
|
fi
|
|
|
|
##############################################################################
|
|
# starting Xorg
|
|
##############################################################################
|
|
|
|
logger -t Xorg "### starting Xorg with '$DISPLAY vt01 $XORG_ARGS' ###"
|
|
|
|
Xorg $DISPLAY vt01 $XORG_ARGS > /dev/null 2>&1 &
|
|
|
|
fi
|
|
|
|
exit 0
|