xorg-server: fixing udev rule to start correctly with nvidia drivers as well with OSS included in kernel

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2011-02-25 23:15:46 +01:00
parent c80f0ba02d
commit 79c6be8d82
2 changed files with 29 additions and 10 deletions

View File

@ -24,7 +24,7 @@
if [ "$RUNLEVEL" = openelec ]; then
logger -t Xorg "### starting Xorg with driver $1 ###"
logger -t Xorg "### starting Xorg with driver ${xorg_driver} ###"
##############################################################################
# setup xorg.conf paths
@ -33,7 +33,7 @@ if [ "$RUNLEVEL" = openelec ]; then
logger -t Xorg "### setup xorg.conf paths ###"
XORG_CONF_DEFAULT="/etc/X11/xorg.conf"
XORG_CONF_DRIVER="/etc/X11/xorg-$1.conf"
XORG_CONF_DRIVER="/etc/X11/xorg-${xorg_driver}.conf"
XORG_CONF_USER="/storage/.config/xorg.conf"
##############################################################################
@ -68,7 +68,7 @@ if [ "$RUNLEVEL" = openelec ]; then
mkdir -m 1777 -p /tmp/.ICE-unix
chown root:root /tmp/.ICE-unix
if [ "$1" = "nvidia" ]; then
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"

View File

@ -18,13 +18,32 @@
# http://www.gnu.org/copyleft/gpl.html
################################################################################
# only does something with "drivers" subsystem devices and supported hardware.
SUBSYSTEM!="drivers", GOTO="end"
ACTION!="add|change", GOTO="end_video"
KERNEL!="i915", KERNEL!="nouveau", KERNEL!="nvidia", KERNEL!="radeon", \
KERNEL!="vmware", GOTO="end"
# xorg_start only does something for subsystem "pci" and "video" class.
SUBSYSTEM=="pci", ATTR{class}=="0x030000", GOTO="subsystem_pci"
SUBSYSTEM=="drivers", GOTO="subsystem_drivers"
# Start Xorg based on the loaded drm driver
ACTION=="add|change", RUN+="/lib/udev/xorg_start %k"
# check for drivers dont use the pci substem
LABEL="subsystem_drivers"
LABEL="end"
KERNEL=="nvidia", ENV{xorg_driver}="nvidia", GOTO="start_xorg"
GOTO="end_video"
# check for drivers using the pci substem
LABEL="subsystem_pci"
DRIVER=="i915", ENV{xorg_driver}="i915", GOTO="start_xorg"
DRIVER=="nouveau", ENV{xorg_driver}="nouveau", GOTO="start_xorg"
DRIVER=="radeon", ENV{xorg_driver}="radeon", GOTO="start_xorg"
#DRIVER=="vmware", ENV{xorg_driver}="vmware", GOTO="start_xorg"
GOTO="end_video"
# start Xorg
LABEL="start_xorg"
ACTION=="add|change", RUN+="/lib/udev/xorg_start"
LABEL="end_video"