summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/xserver/XX_xserver.sh
diff options
context:
space:
mode:
Diffstat (limited to 'os-plugins/plugins/xserver/XX_xserver.sh')
-rw-r--r--os-plugins/plugins/xserver/XX_xserver.sh200
1 files changed, 95 insertions, 105 deletions
diff --git a/os-plugins/plugins/xserver/XX_xserver.sh b/os-plugins/plugins/xserver/XX_xserver.sh
index fbdb832f..df56f054 100644
--- a/os-plugins/plugins/xserver/XX_xserver.sh
+++ b/os-plugins/plugins/xserver/XX_xserver.sh
@@ -1,5 +1,5 @@
# Copyright (c) 2008 - RZ Uni Freiburg
-# Copyright (c) 2008 - OpenSLX GmbH
+# Copyright (c) 2008..2010 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -15,6 +15,81 @@
# script is included from init via the "." load function - thus it has all
# variables and functions available
+# defining a set of stanard configuration blocks
+x_modpath='Section "Files"
+# ModulePath "/usr/lib/xorg/modules/,/usr/lib64/xorg/modules/"
+EndSection'
+x_srvflags='Section "ServerFlags"
+ Option "AllowMouseOpenFail"
+ Option "AllowEmptyInput" "false"
+ Option "blank time" "5"
+ Option "standby time" "10"
+ Option "suspend time" "15"
+ Option "off time" "20"
+EndSection'
+x_modules='Section "Module"
+ Load "i2c"
+ Load "bitmap"
+ Load "ddc"
+ Load "extmod"
+ Load "freetype"
+ Load "int10"
+ Load "vbe"
+ Load "glx"
+ Load "dri"
+EndSection'
+x_mouse='Section "InputDevice"
+ Identifier "Generic Mouse"
+ Driver "mouse"
+# Option "Device" "/dev/input/mice"
+# Option "Protocol" "ImPS/2"
+# Option "ZAxisMapping" "4 5"
+# Option "Emulate3Buttons" "true"
+ Option "CorePointer"
+EndSection'
+x_keyboard='Section "InputDevice"
+ Identifier "Generic Keyboard"
+ Driver "kbd"
+ Option "CoreKeyboard"
+ Option "XkbRules" "xorg"
+ Option "XkbModel" "pc105"
+ Option "XkbLayout" "us"
+EndSection'
+x_videocard='Section "Device"
+ Identifier "Generic Video Card"
+ Driver "vesa"
+# BusID "PCI:xx" #especially needed for fglrx
+EndSection'
+x_monitor='Section "Monitor"
+ Identifier "Generic Display"
+ Option "DPMS"
+# Modelname "could be enabled via xserver::ddcinfo attribute"
+# Vertrefresh ...
+# Horizsync ...
+# DisplaySize ...
+EndSection'
+x_screen='Section "Screen"
+ Identifier "Default Screen"
+ Device "Generic Video Card"
+ Monitor "Generic Display"
+ DefaultDepth 24
+# SubSection "Display"
+# Depth 24
+# Modes "1024x768" "800x600"
+# EndSubSection
+EndSection'
+x_srvlayout='Section "ServerLayout"
+ Identifier "Default Layout"
+ Screen "Default Screen"
+ InputDevice "Generic Keyboard"
+ InputDevice "Generic Mouse"
+EndSection'
+x_dri='Section "DRI"
+ Mode 0666
+EndSection'
+# Xorg configuration file location
+xfc="/mnt/etc/X11/xorg.conf"
+
# read the central configuration file (fixme: should the keyboard layout
# defined within the xserver plugin settings - probably not, dvs)
if [ -e /initramfs/machine-setup ] ; then
@@ -28,8 +103,6 @@ if [ -e /etc/slxsystem.conf ]; then
. /etc/slxsystem.conf
fi
-# Xorg configuration file location
-xfc="/mnt/etc/X11/xorg.conf"
# directory for libGL, DRI library links to point to proper library set
# depending on the hardware environment
glliblinks="/mnt/var/X11R6/lib/"
@@ -51,9 +124,9 @@ if [ -e /initramfs/plugin-conf/xserver.conf -a \
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}" \
+ 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
@@ -71,8 +144,7 @@ if [ -e /initramfs/plugin-conf/xserver.conf -a \
# begin proprietary drivers section (xorg.conf part)
######################################################################
-
- if $(grep -iq -m 1 'Module: fglrx' /etc/hwinfo.gfxcard) && \
+ 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
@@ -150,103 +222,24 @@ ${PLUGIN_ROOTFS}/usr/X11R6/lib/modules/\,"
# end proprietary drivers xorg.conf section
######################################################################
-
- echo -e "# ${xfc#/mnt*}\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/,/usr/lib64/xorg/modules/"
-EndSection
-Section "ServerFlags"
- Option "AllowMouseOpenFail"
- Option "blank time" "5"
- Option "standby time" "10"
- Option "suspend time" "15"
- Option "off time" "20"
-EndSection
-Section "Module"
- Load "i2c"
- Load "bitmap"
- Load "ddc"
- Load "extmod"
- Load "freetype"
- Load "int10"
- Load "vbe"
- Load "glx"
- Load "dri"
-EndSection
-Section "InputDevice"
- Identifier "Generic Keyboard"
- Driver "kbd"
- Option "CoreKeyboard"
- Option "XkbRules" "xorg"
- Option "XkbModel" "pc105"
- Option "XkbLayout" "us"
-EndSection
-Section "InputDevice"
- Identifier "Generic Mouse"
- Driver "mouse"
-# Option "Device" "/dev/input/mice"
-# Option "Protocol" "ImPS/2"
-# Option "ZAxisMapping" "4 5"
-# Option "Emulate3Buttons" "true"
- Option "CorePointer"
-EndSection
-Section "Device"
- Identifier "Generic Video Card"
- Driver "vesa"
-# BusID "PCI:xx" #especially needed for fglrx
-EndSection
-Section "Monitor"
- Identifier "Generic Display"
- Option "DPMS"
-# Modelname "could be enabled via xserver::ddcinfo attribute"
-# Vertrefresh ...
-# Horizsync ...
-# DisplaySize ...
-EndSection
-Section "Screen"
- Identifier "Default Screen"
- Device "Generic Video Card"
- Monitor "Generic Display"
- DefaultDepth 24
-# SubSection "Display"
-# Depth 24
-# Modes "1024x768" "800x600"
-# EndSubSection
-EndSection
-Section "ServerLayout"
- Identifier "Default Layout"
- Screen "Default Screen"
- InputDevice "Generic Keyboard"
- InputDevice "Generic Mouse"
-EndSection
-Section "DRI"
- Mode 0666
-EndSection' >> $xfc
- # keyboard setup (fill XKEYBOARD)
+ # write the xorg.conf completely or in files needed (depending on
+ # distro version)
+ # determine keyboard setup (fill XKEYBOARD)
localization "${country}"
- # if no module was detected, stick to vesa module
- if [ -n "$xmodule" ] ; then
- sed "s/vesa/$xmodule/;s/\"us\"/\"${XKEYBOARD}\"/" -i $xfc
- else
- sed "s/\"us\"/\"${XKEYBOARD}\"/" -i $xfc
- fi
- if [ -n "${BUSID}" ]; then
- sed -e "s,^#.*BusID .*, BusID \"${BUSID}\",g" -i ${xfc}
- fi
+ # run distro specific generated stage3 script
+ [ -e /mnt/opt/openslx/plugin-repo/xserver/xserver.sh ] && \
+ . /mnt/opt/openslx/plugin-repo/xserver/xserver.sh
# set nodeadkeys for special layouts
if [ ${XKEYBOARD} = "de" ]; then
sed -e '/\"XkbLayout\"/a\\ \ Option "XkbVariant" "nodeadkeys"' \
- -i $xfc
+ -i ${xfc}
fi
# if a synaptic touchpad is present, add it to the device list
if grep -q -E "ynaptics" /etc/hwinfo.mouse || \
- dmesg | grep -q -E "ynaptics" ; then
- sed -e '/\"CorePointer\"/ {
+ dmesg | grep -q -E "ynaptics" ; then
+ sed -e '/\"CorePointer\"/ {
a\
EndSection\
Section "InputDevice"\
@@ -256,13 +249,13 @@ Section "InputDevice"\
Option "SendCoreEvents" "true"
}' -e '/Device "Generic Mouse"/ {
a\ \ InputDevice\ \ "Synaptics TP"\ \ \ \ \ \ "SendCoreEvents"
-}' -i $xfc
+}' -i ${xfc}
fi
# ModulePath for proprietary drivers (otherwise disabled)
if [ -n "$xserver_driver" -o "$xserver_prefnongpl" -eq "1" ]; then
sed -e "s,# ModulePath \", ModulePath \"${MODULE_PATH},g" \
- -i $xfc
+ -i ${xfc}
fi
############################################
@@ -275,7 +268,7 @@ a\ \ InputDevice\ \ "Synaptics TP"\ \ \ \ \ \ "SendCoreEvents"
sed -e "1s,^,include ${PLUGIN_ROOTFS}/ld.so.conf\n,g" -i /mnt/etc/ld.so.conf
if [ "${xmodule}" = "nvidia" ]; then
- sed -i "s,\(Driver.*\"nvidia\"\),\1\n Option \"NoLogo\" \"True\"," $xfc
+ sed -i "s,\(Driver.*\"nvidia\"\),\1\n Option \"NoLogo\" \"True\"," ${xfc}
fi
fi
@@ -337,19 +330,16 @@ EndSection' >> ${xfc}
[ -n "$vert" -a -n "$horz" ] && \
sed -e "s|# Horizsync.*| Horizsync $horz|;\
s|# Vertrefre.*| Vertrefresh $vert|;\
- s|# Modelname.*| Modelname \"$modl\"|" -i $xfc
+ s|# Modelname.*| Modelname \"$modl\"|" -i ${xfc}
[ -n "$size" ] && \
- sed -e "s|# DisplaySi.*| DisplaySize $size|" -i $xfc
+ sed -e "s|# DisplaySi.*| DisplaySize $size|" -i ${xfc}
[ -n "$modes" ] && \
sed -e "s|# SubSection.*| SubSection \"Display\"|;\
s|# Depth 24.*| Depth 24|;\
s|# Modes.*| Modes $modes|;\
- s|# EndSubSection.*| EndSubSection|;" -i $xfc
+ s|# EndSubSection.*| EndSubSection|;" -i ${xfc}
fi
- # run distro specific generated stage3 script
- [ -e /mnt/opt/openslx/plugin-repo/xserver/xserver.sh ] && \
- . /mnt/opt/openslx/plugin-repo/xserver/xserver.sh
[ $DEBUGLEVEL -gt 0 ] && echo "done with 'xserver' os-plugin ..."