summaryrefslogtreecommitdiffstats
path: root/abs/mv-core/MythVantage-config/xconfig.sh
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2009-08-17 17:16:31 (GMT)
committerJames Meyer <james.meyer@operamail.com>2009-08-17 17:16:31 (GMT)
commit997dbedae9ea47fbb46ec15f8827cf1a8065c11e (patch)
treee20e579880f339682d8ede709369769269a365e0 /abs/mv-core/MythVantage-config/xconfig.sh
parentda98b0f401f135cb5a04270dbfc46c5dafc43d9d (diff)
downloadlinhes_pkgbuild-997dbedae9ea47fbb46ec15f8827cf1a8065c11e.zip
linhes_pkgbuild-997dbedae9ea47fbb46ec15f8827cf1a8065c11e.tar.gz
linhes_pkgbuild-997dbedae9ea47fbb46ec15f8827cf1a8065c11e.tar.bz2
mv-core: bring it up to date so that it works again
Diffstat (limited to 'abs/mv-core/MythVantage-config/xconfig.sh')
-rwxr-xr-xabs/mv-core/MythVantage-config/xconfig.sh109
1 files changed, 85 insertions, 24 deletions
diff --git a/abs/mv-core/MythVantage-config/xconfig.sh b/abs/mv-core/MythVantage-config/xconfig.sh
index eaa84b6..2fad821 100755
--- a/abs/mv-core/MythVantage-config/xconfig.sh
+++ b/abs/mv-core/MythVantage-config/xconfig.sh
@@ -1,51 +1,64 @@
#!/bin/bash
+#SET DISPLAYCARD to force a cardtype
+#SET DISPLAYRES to force Xres, ENV takes precendent over cmdline
+#displayres=cmdline
#NVPKGS="ati-dri xf86-video-ati xf86-video-radeonhd intel-dri xf86-video-intel unichrome-dri xf86-video-unichrome xf86-video-mga xf86-video-savage xf86-video-trident"
-NVPKGS="ati-dri xf86-video-ati xf86-video-radeonhd intel-dri xf86-video-intel xf86-video-mga xf86-video-savage xf86-video-trident"
+NVPKGS="ati-dri xf86-video-ati xf86-video-radeonhd intel-dri xf86-video-intel xf86-video-mga xf86-video-savage xf86-video-trident unichrome-dri xf86-video-openchrome"
BASE=""
. /etc/profile
NVIDIA_96XX="$TEMPLATES/xorg/96xx_supported.txt"
#TEMPLATES="/usr/share/templates"
+MYTHHOME=$BASE/home/mythtv
function Xvalues {
CMDLINE=$(cat /proc/cmdline)
echo "$CMDLINE" | grep -q forceXvesa
- if [ $? = 0 ]
+ if [ $? = 0 ]
then
VGACARDTYPE=vesa
+ Xcardtype=$VGACARDTYPE
else
VGACARDTYPE=`lspci | grep -i vga | sort -r | head -n 1 | cut -d: -f3 | cut -d" " -f2`
VGAPCIID=`lspci | grep -i vga | sort -r | head -n 1 | cut -d" " -f1`
CARDID=`lspci -n | grep "$VGAPCIID" | grep 10de | cut -d" " -f3 | cut -d: -f2`
VENDORID=`lspci -n | grep "$VGAPCIID" | grep 10de | cut -d" " -f3 | cut -d: -f1`
fi
- echo "$VGACARDTYPE"
+ #force VGACARDTYPE
+ if [ ! x$DISPLAYCARD = x ]
+ then
+ VGACARDTYPE=$DISPLAYCARD
+ Xcardtype=$VGACARDTYPE
+ fi
+ echo "Will use $VGACARDTYPE"
currentmode=`cat "$BASE/etc/X11/xorg.conf" | grep Modes | awk -Fs '{ print $2 }'`
}
function presetupX {
- if [ "$XUseAdvanced" = 1 ]
+ if [ -f /etc/sysconfig/IGNORE_X ]
then
+ echo "Will not run xconfig.sh due to presence of /etc/sysconfig/IGNORE_X"
+ return 1
+ else
if [ "$XIgnoreConfig" = 1 ]
then
echo "Using User supplied X"
- if [ -f "$BASE/data/home/mythtv/templates/xorg.user" ]
+ if [ -f "$MYTHHOME/templates/xorg.user" ]
then
- cp -f "$BASE/data/home/mythtv/templates/xorg.user" "$XORG_CONF"
+ cp -f "$MYTHHOME/templates/xorg.user" "$XORG_CONF"
else
echo "Didn't find the file"
- echo "Copy your config file to $BASE/data/home/mythtv/templates/xorg.use" >> "$XORG_CONF"
+ echo "Copy your config file to $MYTHHOME/templates/xorg.user" > "$XORG_CONF"
fi
else
- setupAdvancedX
- fi
- else
- if [ -f /etc/sysconfig/IGNORE_X ]
- then
- echo "Will not run xconfig.sh due to presence of /etc/sysconfig/IGNORE_X"
- else
- setupX
+ if [ "$XUseAdvanced" = 1 ]
+ then
+ setupAdvancedX
+ else
+ setupX
+ fi
fi
fi
+
}
function setupAdvancedX {
@@ -53,7 +66,7 @@ function setupAdvancedX {
Xcategory=`echo "$Xresadvanced" | cut -d_ -f1`
Xres=`echo "$Xresadvanced" | cut -d_ -f2`
echo "$Xcategory"
- if [ "$Xcategory" = "Nvidia" ]
+ if [ "$Xcategory" = "nVidia Modeline" ]
then
Xres=""
if [ "$XnVidia1080p" = "1" ]
@@ -79,7 +92,7 @@ function setupAdvancedX {
fi
# echo $ML
case $Xcardtype in
- NVIDIA|nVidia)
+ NVIDIA|nVidia|nvidia)
case $Xconnection in
DVI) ConnectedMonitor=DFP ;;
vga) ConnectedMonitor=CRT;;
@@ -175,7 +188,12 @@ function setupX {
then
case $VGACARDTYPE in
nVidia)
- sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.nvidia" > "$XORG_CONF"
+ if [ ${Xres} = Auto ]
+ then
+ sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.nvidia" > "$XORG_CONF"
+ else
+ sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.nvidia" > "$XORG_CONF"
+ fi
if [ "$TESTMODE" != "test" ]
then
#nvidia check right here
@@ -184,11 +202,13 @@ function setupX {
then
#install 96xx drivers
echo "installing nvidia 96xx drivers"
+ pacman --noconfirm -Rd libgl > /dev/null 2>&1
pacman --noconfirm -R $NVPKGS > /dev/null 2>&1
pacman --noconfirm -S nvidia-96xx nvidia-96xx-utils > /dev/null 2>&1
else
#install latest drivers
echo "installing current nvidia drivers"
+ pacman --noconfirm -Rd libgl > /dev/null 2>&1
pacman --noconfirm -R $NVPKGS > /dev/null 2>&1
pacman --noconfirm -S nvidia nvidia-utils > /dev/null 2>&1
fi
@@ -205,7 +225,12 @@ function setupX {
# xf86-video-openchrome
# xf86-video-unichrome
# There is also a seperate driver for the Unichrome Pro
- sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.via" > "$XORG_CONF"
+ if [ ${Xres} = Auto ]
+ then
+ sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.via" > "$XORG_CONF"
+ else
+ sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.via" > "$XORG_CONF"
+ fi
if [ "$TESTMODE" != "test" ]
then
if [ "$OPENCHROME" = "1" ]
@@ -236,8 +261,13 @@ function setupX {
fi
;;
- Intel)
- sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.intel" > "$XORG_CONF"
+ Intel|intel)
+ if [ ${Xres} = Auto ]
+ then
+ sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.intel" > "$XORG_CONF"
+ else
+ sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.intel" > "$XORG_CONF"
+ fi
if [ "$TESTMODE" != "test" ]
then
pacman --noconfirm -R nvidia-utils > /dev/null 2>&1
@@ -247,7 +277,12 @@ function setupX {
;;
vesa|InnoTek)
- sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.vesa" > "$XORG_CONF"
+ if [ ${Xres} = Auto ]
+ then
+ sed -e "/^.*Modes.*$/d" "$TEMPLATES/xorg/xorg.conf.vesa" > "$XORG_CONF"
+ else
+ sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$TEMPLATES/xorg/xorg.conf.vesa" > "$XORG_CONF"
+ fi
;;
*)
@@ -257,11 +292,21 @@ function setupX {
if [ -f "$XCONF" ]
then
echo "Using $XCONF"
- grep -v Modes "$XCONF" | sed -e "/Depth.*16/a Modes \"${Xres}\" " -e "/Depth.*24/a Modes \"${Xres}\"" -e 's/dev\/mouse/dev\/psaux/g'> "$XORG_CONF"
+ if [ ${Xres} = Auto ]
+ then
+ grep -v Modes "$XCONF" | sed -e 's/dev\/mouse/dev\/psaux/g'> "$XORG_CONF"
+ else
+ grep -v Modes "$XCONF" | sed -e "/Depth.*16/a Modes \"${Xres}\" " -e "/Depth.*24/a Modes \"${Xres}\"" -e 's/dev\/mouse/dev\/psaux/g'> "$XORG_CONF"
+ fi
elif [ -f "$XCONFB" ]
then
echo "Using $XCONFB"
- sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$XCONFB" > "$XORG_CONF"
+ if [ ${Xres} = Auto ]
+ then
+ sed -e "/^.*Modes.*$/d" "$XCONFB" > "$XORG_CONF"
+ else
+ sed -e "s/^.*Modes.*$/\t Modes \"${Xres}\"/" "$XCONFB" > "$XORG_CONF"
+ fi
else
echo "Xorg configuration failed"
fi
@@ -296,6 +341,22 @@ else
else
Xres="800x600"
fi
+ CMDLINE=$(cat /proc/cmdline)
+ echo $CMDLINE | grep -q displayres
+ if [ $? = 0 ]
+ then
+ TEMPVAR=${CMDLINE#*displayres=}
+ DSR=${TEMPVAR%% *}
+ fi
+ if [ ! x$DSR = x ]
+ then
+ Xres=$DSR
+ fi
+ if [ ! x$DISPLAYRES = x ]
+ then
+ Xres=$DISPLAYRES
+ fi
+
XORG_CONF="/etc/X11/xorg.conf"
XVMC_CONFIG="/etc/X11/XvMCConfig"
fi