summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-12-06 15:37:01 +0100
committerDirk von Suchodoletz2007-12-06 15:37:01 +0100
commit5703ace9a32228d944e1cf5e819a7737335506d6 (patch)
treef426f5422a2cb5206c20e317ec6ba883be402d91 /initramfs
parentSome fixes for problems Reiner reported ... (diff)
downloadcore-5703ace9a32228d944e1cf5e819a7737335506d6.tar.gz
core-5703ace9a32228d944e1cf5e819a7737335506d6.tar.xz
core-5703ace9a32228d944e1cf5e819a7737335506d6.zip
Small bugfix, added comments to xconfig.
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1425 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs')
-rwxr-xr-xinitramfs/initrd-stuff/bin/xconfig29
1 files changed, 18 insertions, 11 deletions
diff --git a/initramfs/initrd-stuff/bin/xconfig b/initramfs/initrd-stuff/bin/xconfig
index c00c386d..7f465746 100755
--- a/initramfs/initrd-stuff/bin/xconfig
+++ b/initramfs/initrd-stuff/bin/xconfig
@@ -12,13 +12,16 @@
#
# Universal (distro independent) xorg.conf preparation script for OpenSLX
# linux stateless clients, depending on ddcprobe
+#
+# this tool produces a 1024x768 standard resolution if no monitor was
+# detected (problems on some older i8XX, newer NVidia, and ATI adaptors)
#############################################################################
# local functions used within - check if the monitor might be an older crt
iscrt () {
local dim=$1
local year=$2
-# first three characters are interpreted CRT/TFT
+# first three characters (CRT/TFT) are interpreted later
local crt="CRT Generic"
# sub 17" displays
if [ $dim -lt 750 ] ; then
@@ -52,7 +55,8 @@ elif [ $dim -lt 1300 ] ; then
crt="CRT 20(+)''"
echo -e "1600x1200\n1400x1050\n1280x1024\n1152x864" > /tmp/res
fi
-# any bigger display is most probably a tft
+# any bigger display is most probably a tft (and nobody should have bought
+# a big crt after 2003 :))
elif [ $year -ge 2004 ] ; then
crt="TFT 4:3 22+''"
fi
@@ -73,11 +77,10 @@ echo "$crt"
. /etc/distro-functions
xfc="/tmp/xorg.conf"
-echo "# ${D_XF86CONFFILE}" > $xfc
+echo -e "# ${D_XF86CONFFILE}\n# autogenerated X hardware configuration by \
+xconfig in OpenSLX stage3\n# DO NOT EDIT THIS FILE BUT 'xconfig' INSTEAD" \
+ > $xfc
echo '
-## autogenerated X hardware configuration by $0 ##
-## OpenSLX.ORG Project <openslx-users@openslx.org> ##
-## DO NOT EDIT THIS FILE BUT 'xconfig' INSTEAD ##
Section "Files"
EndSection
Section "ServerFlags"
@@ -167,17 +170,20 @@ EndSection
Section "DRI"
Mode 0666
EndSection
-'> $xfc
-
+' >> $xfc
+# read ddcprobe output (the adaptor VESA capabilities are of no interest)
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
+ # we need exact resolutions for tft displays only and we want to filter
+ # quadratic resolutions (bug of ddcprobe??)
[ "${IsCrt%% *}" = "TFT" -a $((${Width}00 / ${Height})) -ge 125 ] && \
echo $Res >> /tmp/res
+ # add information on grafic adaptor and monitor (no practical use
+ # nevertheless)
[ "x${VendorName}" = "x" ] && VendorName="No vendor string detected"
grep ModelName $xfc 2>&1 > /dev/null || \
sed -e "/Section \"Monitor\"/a\ \ ModelName \"Display - ${IsCrt}\"" \
@@ -203,7 +209,7 @@ ddcprobe|sed "/mode: /d"|while read line ; do
Width=${Dim%% *}
Height=${Dim##* }
Dim=$(($Width * $Height))
- # check for geometry - no crt if no 4:3 ratio
+ # check for geometry - no crt if no 4:3 pixel ratio
if [ $((${Width}00 / $((${Height} + 1 )))) -lt 140 ] ; then
IsCrt="$(iscrt $Dim $Year)"
else
@@ -215,7 +221,8 @@ done
# if predefined value is present otherwise use computed/detected stuff
if [ -n "${hw_monitor}" ] ; then
- # just cut all starting from k(Hz) ...
+ # just cut all starting from k(Hz), do we need the option to set maximum
+ # monitor capabilities?
#HS=${hw_monitor%k*}
#VS=${hw_monitor%Hz*}
Modes="\"${hw_monitor##* }\""