summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorMichael Janczyk2009-03-03 19:39:20 +0100
committerMichael Janczyk2009-03-03 19:39:20 +0100
commit1e59a6afe5d105e9280fe1bedebf8c45fab65a25 (patch)
treecfe08d7f6c2e2a5e6abb08a7462e51f2681dab0d /os-plugins
parentchanged calculation to kbyte since byte calculation out of range (e.g. if you... (diff)
downloadcore-1e59a6afe5d105e9280fe1bedebf8c45fab65a25.tar.gz
core-1e59a6afe5d105e9280fe1bedebf8c45fab65a25.tar.xz
core-1e59a6afe5d105e9280fe1bedebf8c45fab65a25.zip
adding attr xserver::driver to override the driver of gfxcards
trunk because for testing purposes and dirk isnt to happy with this solution git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2663 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm14
-rw-r--r--os-plugins/plugins/xserver/XX_xserver.sh31
2 files changed, 36 insertions, 9 deletions
diff --git a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
index 26dfc395..2342f744 100644
--- a/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
+++ b/os-plugins/plugins/xserver/OpenSLX/OSPlugin/xserver.pm
@@ -86,6 +86,16 @@ sub getAttrInfo
content_descr => '0 ignore ddcinfo, 1 use ddcinfo if available',
default => '0',
},
+ 'xserver::driver' => {
+ applies_to_systems => 1,
+ applies_to_clients => 1,
+ description => unshiftHereDoc(<<' End-of-Here'),
+ force to use defined driver
+ End-of-Here
+ content_regex => undef,
+ content_descr => 'force to use defined driver',
+ default => undef,
+ },
'xserver::prefnongpl' => {
applies_to_systems => 1,
applies_to_clients => 1,
@@ -94,7 +104,7 @@ sub getAttrInfo
adaptors if available (0 prefer gpl, 1 use the nongpl)
End-of-Here
content_regex => qr{^(0|1)$},
- content_descr => '0 ignore ddcinfo, 1 use ddcinfo if available',
+ content_descr => '0 prefer gpl, 1 use the nongpl',
default => '0',
},
'xserver::usexrandr' => {
@@ -114,7 +124,7 @@ sub getAttrInfo
# stage1
# Currently not needed in scenarios where distro specific packages are
- # available, but in Suse-10.2 for example we use this method
+ # available, but for example in SUSE 10.2 we use this method
# -> provide downloaded packages here.
'xserver::pkgpath' => {
applies_to_vendor_os => 1,
diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh
index ceac1f22..2c7c6237 100644
--- a/os-plugins/plugins/xserver/XX_xserver.sh
+++ b/os-plugins/plugins/xserver/XX_xserver.sh
@@ -36,7 +36,24 @@ testmkd ${glliblinks}
if [ -e /initramfs/plugin-conf/xserver.conf -a \
! -f /rootfs/etc/X11/xorg.conf ]; then
. /initramfs/plugin-conf/xserver.conf
-
+ # check if driver set via xserver_driver
+ # if so check for xserver_prefnongpl and xserver_driver because you want to
+ # force driver even if xserver_prefnongpl=0
+ # eg: [ -n "$xserver_driver" -o "$xserver_prefnongpl" -eq 1 ]
+ if [ -n "$xserver_driver" ]; then
+ if `grep -qi "Server Module" /etc/hwinfo.gfxcard`; then
+ sed -i "s,XFree86.*,FORCED XFree86 v4 Server Module: ${xserver_driver}," \
+ /etc/hwinfo.gfxcard
+ echo -e "\n# File modified by $1" >> /etc/hwinfo.gfxcard
+ echo "# Reason: attribute server_driver set to ${xserver_driver}" \
+ >> /etc/hwinfo.gfxcard
+ else
+ echo -e "\n# File modified by $1" >> /etc/hwinfo.gfxcard
+ echo "# Reason: attribute server_driver set to ${xserver_driver}" \
+ >> /etc/hwinfo.gfxcard
+ echo "FORCED XFree86 v4 Server Module: ${xserver_driver}" >> /etc/hwinfo.gfxcard
+ fi
+ fi
# do not start any configuration if the admin provided a preconfigured
# xorg.conf in /rootfs/etc/X11/xorg.conf
if [ $xserver_active -ne 0 -a ! -f /rootfs/${xfc#/mnt} ]; then
@@ -50,9 +67,9 @@ if [ -e /initramfs/plugin-conf/xserver.conf -a \
# begin proprietary drivers section (xorg.conf part)
######################################################################
- waitfor /etc/hwinfo.data 10000
- if [ $(grep -i -m 1 'Module: fglrx' \
- /etc/hwinfo.gfxcard | wc -l) -ge "1" -a $xserver_prefnongpl -eq 1 ]
+
+ if $(grep -iq -m 1 'Module: fglrx' /etc/hwinfo.gfxcard) && \
+ [ -n "$xserver_driver" -o "$xserver_prefnongpl" -eq 1 ]
then
# we have an ati card here
PLUGIN_ROOTFS="/opt/openslx/plugin-repo/xserver/ati"
@@ -76,8 +93,8 @@ if [ -e /initramfs/plugin-conf/xserver.conf -a \
fi
ATI=1
fi
- elif [ $(grep -i -m 1 'Module: nvidia' \
- /etc/hwinfo.gfxcard | wc -l) -ge "1" -a $xserver_prefnongpl -eq 1 ]
+ elif $(grep -iq -m 1 'Module: nvidia' /etc/hwinfo.gfxcard) && \
+ [ -n "$xserver_driver" -o "$xserver_prefnongpl" -eq 1 ]
then
# we have an nvidia card here
NVIDIA=1
@@ -212,7 +229,7 @@ a\ \ InputDevice\ \ "Synaptics TP"\ \ \ \ \ \ "SendCoreEvents"
fi
# ModulePath for proprietary drivers
- if [ "$xserver_prefnongpl" -eq "1" ]; then
+ if [ -n "$xserver_driver" -o "$xserver_prefnongpl" -eq "1" ]; then
sed -e "s,ModulePath \",ModulePath \"${MODULE_PATH},g" \
-i $xfc
fi