summaryrefslogtreecommitdiffstats
path: root/initrd/initrd-stuff/bin/screenres
diff options
context:
space:
mode:
Diffstat (limited to 'initrd/initrd-stuff/bin/screenres')
-rwxr-xr-xinitrd/initrd-stuff/bin/screenres18
1 files changed, 10 insertions, 8 deletions
diff --git a/initrd/initrd-stuff/bin/screenres b/initrd/initrd-stuff/bin/screenres
index aa795174..8518b22e 100755
--- a/initrd/initrd-stuff/bin/screenres
+++ b/initrd/initrd-stuff/bin/screenres
@@ -1,6 +1,7 @@
#!/bin/sh
#
# Author(s): Felix Endres
+# Dirk von Suchodoletz, 04-07-2006
#
# Copyright: (c) 2006 - RZ Universitaet Freiburg
#
@@ -36,7 +37,6 @@ default_vert_freq_range_hz="" #"60-90"
default_recommended_screen_modes="" #'"1024x768" "800x600" "640x480"'
-
calculate_max_horizontal_freq () {
highest_resolution=` echo $screen_resolutions | sed -n 's/"\([0-9x]*\)".*/\1/p'`
[ -z $highest_resolution ] && return # if the highest resolution can not be extracted, the frequency can not be calculated
@@ -123,9 +123,11 @@ define_max_recommended_horizontal_pixel_count () {
tmp_ddcprobe_output=$1
if [ -z $tmp_ddcprobe_output ]; then
tmp_ddcprobe_output=/tmp/ddcprobe_output
- ddcprobe > ${tmp_ddcprobe_output}
+ ddcprobe | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/" \
+ > ${tmp_ddcprobe_output}
fi
-failed=`sed -n '/edid.*failed/Ip' ${tmp_ddcprobe_output}`
+# fixme: parameter I is not compatible with busybox - how to circumvent?
+failed=`sed -n '/edid.*failed/p' ${tmp_ddcprobe_output}`
if [ -n "$failed" ]; then
echo "Error: Display seems to be incapable of providing DDC Information"
# Print Defaults OPTIMIZEME: The defaults could be command line parameters
@@ -134,9 +136,9 @@ if [ -n "$failed" ]; then
echo "Vertical Frequency Range (Hz): $default_vert_freq_range_hz"
exit 1;
fi
-screen_size_in_qcm=$((`sed -n "s/[Ss]creen.*[Ss]ize[^0-9]*\([0-9]*\)[^0-9]*\([0-9]*\).*/\1 * \2/p" ${tmp_ddcprobe_output}`))
-max_pixels=$((`echo "\`sed -n '/edid/I,$s/.*[ \t]\([0-9]\{3,4\}\)x\([0-9]\{3,4\}\).*/\2 * \1/p' ${tmp_ddcprobe_output}|sort -rn| sed -n 1p\`"`))
-manufacturing_year=`sed -n 's/manufact.*\([12][90][0-9][0-9]\).*/\1/Ip' ${tmp_ddcprobe_output}`
+screen_size_in_qcm=$((`sed -n "s/screen.*size[^0-9]*\([0-9]*\)[^0-9]*\([0-9]*\).*/\1 * \2/p" ${tmp_ddcprobe_output}`))
+max_pixels=$((`echo "\`sed -n '/edid/,$s/.*[ \t]\([0-9]\{3,4\}\)x\([0-9]\{3,4\}\).*/\2 * \1/p' ${tmp_ddcprobe_output}|sort -rn| sed -n 1p\`"`))
+manufacturing_year=`sed -n 's/manufact.*\([12][90][0-9][0-9]\).*/\1/p' ${tmp_ddcprobe_output}`
[ -n "$DEBUG" ] && echo "Maximal Resolution: $max_pixels"
# 640x400 (below)
@@ -194,7 +196,7 @@ fi
# Find the lines with two times 3 to 4 digits delimited by an x. Print with the two values reverted, so sort sorts w.r.t the 2nd value. Then swap back
# Minor problem: If two Modes are found in a line, the second one is used.
-screen_resolutions=`sed -n '/edid/I,$s/\(.*[ \t]\)*\([0-9]\{3,4\}\) *x *\([0-9]\{3,4\}\).*/\3 x \2/p' ${tmp_ddcprobe_output}| sort -rn | sort -rnu | sed -n 's/\([0-9]\{3,4\}\) x \([0-9]\{3,4\}\).*/"\2x\1"/p' `
+screen_resolutions=`sed -n '/edid/,$s/\(.*[ \t]\)*\([0-9]\{3,4\}\) *x *\([0-9]\{3,4\}\).*/\3 x \2/p' ${tmp_ddcprobe_output}| sort -rn | sort -rnu | sed -n 's/\([0-9]\{3,4\}\) x \([0-9]\{3,4\}\).*/"\2x\1"/p' `
screen_resolutions=`echo $screen_resolutions`
echo "Supported Screen Modes: $screen_resolutions"
@@ -202,7 +204,7 @@ echo "Supported Screen Modes: $screen_resolutions"
######## Vertical and horizontal frequency ranges #########
# find a line with the word range and and numbers with a minus in the middle (e.g 123-321)
-frequency_ranges=`sed '/[Rr][Aa][Nn][Gg][Ee]/!d;s/[^0-9]*\([1-9][0-9]\)[ \t]*-[ \t]*\([1-9][0-9]*\)[^0-9]*\([1-9][0-9]*\)[ \t]*-[ \t]*\([1-9][0-9]*\).*/\1-\2 \3-\4/' ${tmp_ddcprobe_output}`
+frequency_ranges=`sed '/range/!d;s/[^0-9]*\([1-9][0-9]\)[ \t]*-[ \t]*\([1-9][0-9]*\)[^0-9]*\([1-9][0-9]*\)[ \t]*-[ \t]*\([1-9][0-9]*\).*/\1-\2 \3-\4/' ${tmp_ddcprobe_output}`
set -- $frequency_ranges # split into $1 und $2
if [ -z "$frequency_ranges" ] && [ $tft_probability -lt 50 ]; then