From ea946678e9ebc00d37b489ec4f22e2bbf2bc04a3 Mon Sep 17 00:00:00 2001 From: Bastian Wissler Date: Fri, 29 Aug 2008 09:31:34 +0000 Subject: First real stage3 implementation (I just thought last time) git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2128 95ad53e4-c205-0410-b2fa-d234c58c8868 --- os-plugins/plugins/xserver/XX_xserver.sh | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'os-plugins/plugins/xserver/XX_xserver.sh') diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh index d37592ff..0d84c84c 100644 --- a/os-plugins/plugins/xserver/XX_xserver.sh +++ b/os-plugins/plugins/xserver/XX_xserver.sh @@ -38,11 +38,42 @@ if [ -e /initramfs/plugin-conf/xserver.conf ]; then sed "s/.*v4 Server Module: //") # proprietary ATI/NVidia modules listed a different way with hwinfo [ -z "$xmodule" ] || error "${hcfg_hwsetup}" nonfatal + set -x + + if [ $(grep -i -m 1 'Driver Activation Cmd: "modprobe fglrx"' \ + /etc/hwinfo.data | wc -l) -eq "1" -a $xserver_prefnongpl -eq 1 ] + then + # we have an ati card here + ATI=1 + MODULE_PATH="/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/xorg/modules/\,\ +/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/X11R6/lib/modules/\," + xmodule="fglrx" + LINKAGE="/mnt/var/lib/X11R6/xserver/usr/lib/" + cp -r /mnt/opt/openslx/plugin-repo/xserver/ati/atiroot/etc/* /mnt/etc/ + ln -s \ + /mnt/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/libGL.so.1.2 \ + ${LINKAGE}libGL.so.1 + ln -s \ + /mnt/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/libGL.so.1.2 \ + ${LINKAGE}libGL.so.1.2 + + # TODO: This is probably Ubuntu-specific + echo "/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/lib/\n\ +/opt/openslx/plugin-repo/xserver/ati/atiroot/usr/X11R6/lib/" \ + > /mnt/etc/ld.so.conf.d/999opengl.conf + ldsc="on" # regenerate ld.so.cache + fi + + set +x + + # TODO: nvidia module + echo -e "# $xfc\n# autogenerated X hardware configuration by the xserver \ plugin in OpenSLX stage3\n# DO NOT EDIT THIS FILE BUT THE PLUGIN INSTEAD" \ > $xfc echo ' Section "Files" + ModulePath "/usr/lib/xorg/modules/" EndSection Section "ServerFlags" Option "AllowMouseOpenFail" @@ -161,6 +192,13 @@ Section "InputDevice"\ a\ \ InputDevice\ \ "Synaptics TP"\ \ \ \ \ \ "SendCoreEvents" }' -i $xfc fi + + + if [ "$xserver_prefnongpl" -eq "1" ]; then + sed -e "s,ModulePath \",ModulePath \"${MODULE_PATH},g" \ + -i $xfc + fi + [ $DEBUGLEVEL -gt 0 ] && echo "done with 'xserver' os-plugin ..."; # some configurations produce no proper screen resolution without # Horizsync and Vertrefresh set (more enhancements might be needed for -- cgit v1.2.3-55-g7522