summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/bin/xconfig
diff options
context:
space:
mode:
Diffstat (limited to 'initramfs/initrd-stuff/bin/xconfig')
-rwxr-xr-xinitramfs/initrd-stuff/bin/xconfig163
1 files changed, 113 insertions, 50 deletions
diff --git a/initramfs/initrd-stuff/bin/xconfig b/initramfs/initrd-stuff/bin/xconfig
index dce2a68f..8865674c 100755
--- a/initramfs/initrd-stuff/bin/xconfig
+++ b/initramfs/initrd-stuff/bin/xconfig
@@ -1,4 +1,20 @@
-#!/bin/ash
+#!/bin/sh
+# Copyright (c) 2007 - RZ Uni Freiburg
+# Copyright (c) 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your feedback to feedback@openslx.org
+#
+# General information about OpenSLX can be found under http://openslx.org
+#
+# Universal (distro independent) xorg.conf preparation script for OpenSLX
+# linux stateless clients, depending on ddcprobe
+
+#############################################################################
+# local functions used within - check if the monitor might be an older crt
iscrt () {
local dim=$1
local year=$2
@@ -41,10 +57,35 @@ elif [ $year -ge 2004 ] ; then
fi
echo "$crt"
}
-xfc=xorg
-echo -e '
+
+#############################################################################
+# main script
+
+# functions common for all distros
+. /etc/functions
+# functions common for all distros, messages contains all error and
+# info output
+. /etc/messages
+# load distro specific configuration variables and functions. distro
+# specific functions may overwrite functions defined in /etc/functions
+. /etc/sysconfig/config
+. /etc/distro-functions
+
+xfc="/tmp/xorg.conf"
+echo "# ${D_XF86CONFFILE}" > $xfc
+echo '
+## autogenerated X hardware configuration by $0 ##
+## OpenSLX.ORG Project <openslx-users@openslx.org> ##
+## DO NOT EDIT THIS FILE BUT '$0' INSTEAD ##
Section "Files"
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"
@@ -53,6 +94,8 @@ Section "Module"
Load "freetype"
Load "int10"
Load "vbe"
+ Load "glx"
+ Load "dri"
EndSection
Section "InputDevice"
Identifier "Generic Keyboard"
@@ -60,7 +103,7 @@ Section "InputDevice"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
- Option "XkbLayout" "de"
+ Option "XkbLayout" "XKEYBOARD"
Option "XkbVariant" "nodeadkeys"
EndSection
Section "InputDevice"
@@ -115,7 +158,7 @@ Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Generic Keyboard"
- InputDevice "Configured Mouse"
+ InputDevice "Generic Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
@@ -123,50 +166,70 @@ EndSection
Section "DRI"
Mode 0666
EndSection
-'> /tmp/$xfc
+'> $xfc
-rm /tmp/res
-cat $1|sed "/mode: /d"|while read line ; do
- case $line in
- ctiming*|dtiming*)
- Res=$(echo $line|sed "s/.*:\ //;s/@.*//")
- Width=${Res%%x*}
- Height=${Res##*x}
- # we need exact resolutions for tft displays only
- [ "${IsCrt%% *}" = "TFT" -a $((${Width}00 / ${Height})) -ge 125 ] && echo $Res >> /tmp/res
- [ "x${VendorName}" = "x" ] && VendorName="No vendor string detected"
- grep ModelName /tmp/$xfc 2>&1 >/dev/null || \
- sed -e "/Section \"Monitor\"/a\ \ ModelName \"Display - ${IsCrt}\"" \
- -e "/Section \"Device\"/a\ \ VendorName \"${VendorName}\"" \
- -i /tmp/$xfc
- ;;
- monitorname*|monitorid*)
- [ "x${line##monitor*:}" = "x" ] || sed "s/Display - /${line##monitor*: } - /" -i /tmp/$xfc
- ;;
- product*)
- [ "$line" != "product:" ] && \
- sed "/Section \"Device\"/a\ \ BoardName \"${line##product: }\"" \
- -i /tmp/$xfc
- ;;
- oem*|vendor*)
- [ "x${line##?e*:}" = "x" ] || VendorName="${line##?e*: }"
- ;;
- manufacture*)
- Year=${line##* }
- ;;
- screensize*)
- Dim=${line##screensize: }
- Width=${Dim%% *}
- Height=${Dim##* }
- Dim=$(($Width * $Height))
- # check for geometry - no crt if no 4:3 ratio
- if [ $((${Width}00 / $((${Height} + 1 )))) -lt 140 ] ; then
- IsCrt="$(iscrt $Dim $Year)"
- else
- IsCrt="TFT WideScreen"
- fi
- ;;
- esac
+ddcprobe|sed "/mode: /d"|while read line ; do
+ case $line in
+ ctiming*|dtiming*)
+ Res=$(echo $line|sed "s/.*:\ //;s/@.*//")
+ Width=${Res%%x*}
+ Height=${Res##*x}
+ # we need exact resolutions for tft displays only
+ [ "${IsCrt%% *}" = "TFT" -a $((${Width}00 / ${Height})) -ge 125 ] && \
+ echo $Res >> /tmp/res
+ [ "x${VendorName}" = "x" ] && VendorName="No vendor string detected"
+ grep ModelName $xfc 2>&1 >/dev/null || \
+ sed -e "/Section \"Monitor\"/a\ \ ModelName \"Display - ${IsCrt}\"" \
+ -e "/Section \"Device\"/a\ \ VendorName \"${VendorName}\"" \
+ -i $xfc
+ ;;
+ monitorname*|monitorid*)
+ [ "x${line##monitor*:}" = "x" ] || sed "s/Display - /${line##monitor*: } - /" -i $xfc
+ ;;
+ product*)
+ [ "$line" != "product:" ] && \
+ sed "/Section \"Device\"/a\ \ BoardName \"${line##product: }\"" \
+ -i $xfc
+ ;;
+ oem*|vendor*)
+ [ "x${line##?e*:}" = "x" ] || VendorName="${line##?e*: }"
+ ;;
+ manufacture*)
+ Year=${line##* }
+ ;;
+ screensize*)
+ Dim=${line##screensize: }
+ Width=${Dim%% *}
+ Height=${Dim##* }
+ Dim=$(($Width * $Height))
+ # check for geometry - no crt if no 4:3 ratio
+ if [ $((${Width}00 / $((${Height} + 1 )))) -lt 140 ] ; then
+ IsCrt="$(iscrt $Dim $Year)"
+ else
+ IsCrt="TFT WideScreen"
+ fi
+ ;;
+ esac
done
-for line in `sort -run /tmp/res` ; do Modes="$Modes \"$line\""; done
-sed "s/Modes \"/Modes ${Modes} \"/" -i /tmp/$xfc
+
+# if predefined value is present otherwise use computed/detected stuff
+if [ -n "${hw_monitor}" ] ; then
+ # just cut all starting from k(Hz) ...
+ #HS=${hw_monitor%k*}
+ #VS=${hw_monitor%Hz*}
+ Modes="\"${hw_monitor##* }\""
+else
+ for line in $(sort -run /tmp/res) ; do Modes="$Modes \"$line\""; done
+fi
+sed "s/Modes \"/Modes ${Modes} \"/" -i $xfc
+
+# run localizator and configure X11 keyboard
+localization "${country}"
+if [ -z "${XKEYBOARD}" ] ; then
+ error "${hcfg_keyb}" nonfatal
+ XKEYBOARD="us"
+fi
+sed "s/XKEYBOARD/${XKEYBOARD}/" -i $xfc
+# displayvars
+#displayvars
+#sed "/Section \"Device\"/a\ \ ${Files}" -i $xfc