summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/bin/hwautocfg
diff options
context:
space:
mode:
Diffstat (limited to 'initrd/initrd-stuff/bin/hwautocfg')
-rwxr-xr-xinitrd/initrd-stuff/bin/hwautocfg57
1 files changed, 31 insertions, 26 deletions
diff --git a/initrd/initrd-stuff/bin/hwautocfg b/initrd/initrd-stuff/bin/hwautocfg
index 8fed0677..9859ff54 100755
--- a/initrd/initrd-stuff/bin/hwautocfg
+++ b/initrd/initrd-stuff/bin/hwautocfg
@@ -17,7 +17,7 @@ local xfc=$1
# define some defaults
local HSYNCRANGE="31.5-63.5"
local VSYNCRANGE="60-90"
-local MAXRES="1024x768"
+local DEFAULTMODES='"1024x768" "800x600" "640x480"'
local DEFAULTCOLORDPT=24
# set variables representing the xorg.conf sections (version 6.8.x)
local Module='\tLoad\t\t"dbe"\n
@@ -116,16 +116,9 @@ systems color depth failed.\n $msg" nonfatal
CDP=${DEFAULTCOLORDPT}
fi
-#OPTIMIZEME: Optimiere den dreifachen aufruf von Screenres
+# Gather information about the Monitor capabilities for later use
screenres > /tmp/screenres
-VERTSR=`cat /tmp/screenres | sed -n '/Vertical Frequency Range/s/[^0-9]* \([0-9-]*\)/\1/p'`
-HORISR=`cat /tmp/screenres | sed -n '/Horizontal Frequency Range/s/[^0-9]* \([0-9-]*\)/\1/p'`
-if [ -n "$HORISR" ]; then
- HS=$HORISR
-fi
-if [ -n "$VERTSR" ]; then
- VS=$VERTSR
-fi
+
if [ -n "$hw_monitor" ] ; then
# just cut all starting from k(Hz) ...
@@ -134,32 +127,44 @@ if [ -n "$hw_monitor" ] ; then
[ -z "$VS" ] && VS=${hw_monitor%hz*}
VS=${VS##* }
MR=${hw_monitor##* }
- hwmsg="Please check your predefined monitor settings ($hw_monitor): Manual\n\
- configurtion of display"
else
- # gather monitor information automatically
- ddcprobe > /tmp/ddcprobe
- hwmsg="Please check the output of ddcprobe. The settings where not \
-complete\n or non existant. The $0 script tried for a fully automatic\n\
- configuration of display"
+ VERTSR=`cat /tmp/screenres | sed -n '/Vertical Frequency Range/s/[^0-9]* \([0-9-]*\)/\1/p'`
+ HORISR=`cat /tmp/screenres | sed -n '/Horizontal Frequency Range/s/[^0-9]* \([0-9-]*\)/\1/p'`
+ if [ -n "$HORISR" ]; then
+ HS=$HORISR
+ fi
+ if [ -n "$VERTSR" ]; then
+ VS=$VERTSR
+ fi
+ if [ -n "MR" ]; then
+ # compute max resolution
+ MODES=`cat /tmp/screenres | sed -n '/Recommended Screen Modes:/s/[^"]*\(.*\)/\1/p'`
+ fi
+# # gather monitor information automatically
+# ddcprobe > /tmp/ddcprobe
+# hwmsg="Please check the output of ddcprobe. The settings where not \
+#complete\n or non existant. The $0 script tried for a fully automatic\n\
+# configuration of display"
fi
-if [ -z "$HS" ] ; then error " $hwmsg timings requested but could not \
-establish\n horizontal frequency in kHz." nonfatal
+hwmsg="Please check your predefined monitor settings ($hw_monitor): Automatic\n\
+configuration of display"
+if [ -z "$HS" ] ; then error " $hwmsg timings was attempted, but the \
+horizontal frequency could not be detected. Using default frequency \
+range (${HSYNCRANGE})" nonfatal
HS=${HSYNCRANGE}
fi
-if [ -z "$VS" ] ; then error " $hwmsg timings but could not establish \
-vertical\n frequency in Hz." nonfatal
+if [ -z "$VS" ] ; then error " $hwmsg timings was attempted, but the \
+vertical frequency could not be detected. Using default frequency \
+range (${VSYNCRANGE})" nonfatal
VS=${VSYNCRANGE}
fi
-if [ -z "$MR" ] ; then error " $hwmsg resolution requested but not \
-established." nonfatal
- MR=${MAXRES}
+if [ -z "$MR" ] ; then error " $hwmsg resolution was attempted but not \
+established. Using default resolutions (${DEFAULTMODES})" nonfatal
+ MR=${DEFAULTMODES}
fi
monmanual=yes
-# compute max resolution
-MODES=`cat /tmp/screenres | sed -n '/Recommended Screen Modes:/s/[^"]*\(.*\)/\1/p'`
# finally write config file
echo -e "#\n# autogenerated X hardware configuration by $0\n# \