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/xconfig27
1 files changed, 16 insertions, 11 deletions
diff --git a/initramfs/initrd-stuff/bin/xconfig b/initramfs/initrd-stuff/bin/xconfig
index 8865674c..54113fec 100755
--- a/initramfs/initrd-stuff/bin/xconfig
+++ b/initramfs/initrd-stuff/bin/xconfig
@@ -18,6 +18,7 @@
iscrt () {
local dim=$1
local year=$2
+# first three characters are interpreted CRT/TFT
local crt="CRT Generic"
# sub 17" displays
if [ $dim -lt 750 ] ; then
@@ -33,27 +34,27 @@ elif [ $dim -lt 1000 ] ; then
crt="CRT 19inch"
echo "1400x1050\n1280x1024\n1152x864" > /tmp/res
else
- crt="TFT 4:3 17inch"
+ crt="TFT 4:3 17''"
fi
# 18/19" tft displays (available after 2001)
elif [ $dim -lt 1200 ] ; then
if [ $year -ge 2002 ] ; then
- crt="TFT 4:3 18+inch"
+ crt="TFT 4:3 18(+)''"
else
- crt="CRT 20inch"
+ crt="CRT 20''"
echo "1400x1050\n1280x1024\n1152x864" > /tmp/res
fi
# sub 22" displays are crts if older than 2004 :)
elif [ $dim -lt 1300 ] ; then
if [ $year -ge 2004 ] ; then
- crt="TFT 4:3 19+inch"
+ crt="TFT 4:3 19(+)''"
else
- crt="CRT 20+inch"
+ crt="CRT 20(+)''"
echo "1600x1200\n1400x1050\n1280x1024\n1152x864" > /tmp/res
fi
# any bigger display is most probably a tft
elif [ $year -ge 2004 ] ; then
- crt="TFT 4:3 22+inch"
+ crt="TFT 4:3 22+''"
fi
echo "$crt"
}
@@ -76,7 +77,7 @@ 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 ##
+## DO NOT EDIT THIS FILE BUT 'xconfig' INSTEAD ##
Section "Files"
EndSection
Section "ServerFlags"
@@ -178,7 +179,7 @@ ddcprobe|sed "/mode: /d"|while read line ; do
[ "${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 || \
+ grep ModelName $xfc 2>&1 > /dev/null || \
sed -e "/Section \"Monitor\"/a\ \ ModelName \"Display - ${IsCrt}\"" \
-e "/Section \"Device\"/a\ \ VendorName \"${VendorName}\"" \
-i $xfc
@@ -219,15 +220,19 @@ if [ -n "${hw_monitor}" ] ; then
#VS=${hw_monitor%Hz*}
Modes="\"${hw_monitor##* }\""
else
- for line in $(sort -run /tmp/res) ; do Modes="$Modes \"$line\""; done
+ # to be checked if correct
+ if [ -f /tmp/res ] ; then
+ for line in $(sort -run /tmp/res) ; do Modes="$Modes \"$line\""; done
+ else
+ error "$hcfg_res" nonfatal
+ fi
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"
+ error "${xcfg_keyb}" nonfatal
fi
sed "s/XKEYBOARD/${XKEYBOARD}/" -i $xfc
# displayvars