]> xenbits.xensource.com Git - xenclient/build.git/commitdiff
XC-135: [host installer] Warn if GPU unrecognised
authorChristopher Clark <christopher.clark@citrix.com>
Wed, 9 Sep 2009 01:51:00 +0000 (18:51 -0700)
committerChristopher Clark <christopher.clark@citrix.com>
Wed, 9 Sep 2009 01:51:00 +0000 (18:51 -0700)
target/generic/target_xenclient_installer_skeleton/install/stages/Check-GPU [new file with mode: 0755]
target/generic/target_xenclient_installer_skeleton/install/stages/sequence.graph

diff --git a/target/generic/target_xenclient_installer_skeleton/install/stages/Check-GPU b/target/generic/target_xenclient_installer_skeleton/install/stages/Check-GPU
new file mode 100755 (executable)
index 0000000..7cd5b5c
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/ash
+
+. ${SCRIPT_DIR}/functions
+not_previous $@ || exit ${Previous}
+
+# check_gfx:
+# Returns true if GPU recognised as OK:
+
+check_gfx()
+{
+    DISPLAY_ADAPTER=$(setpci -s 0:2.0 0xa.w 2>/dev/null)
+             VENDOR=$(setpci -s 0:2.0 0x0.w 2>/dev/null)
+
+    if [ "x${VENDOR}" = "x8086" ] && [ "x${DISPLAY_ADAPTER}" = "x0300" ] ; then
+        return 0
+    fi
+    echo "ERROR: GPU not recognised (${VENDOR}, ${DISPLAY_ADAPTER}).">&2
+    return 1
+}
+
+GPU_OK=0
+check_gfx || GPU_OK=1
+
+interactive || exit ${Continue}
+
+if [ ${GPU_OK} -ne 0 ] ; then
+    dialog --colors --yes-label "Ignore" --no-label "Abort" --yesno \
+"   \ZbERROR: Unrecognised Graphics Device\ZB
+
+   System may be incompatible with XenClient!" 0 0
+    OPT=$?
+    echo ${OPT}
+    echo "Ignoring unrecognised graphics device.">&2
+fi
+    [ "${OPT}" != 1 ] || exit ${Abort}
+    [ "${OPT}" != 255 ] || exit ${Previous}
+
+exit ${Continue}
index 19019d5139ebdc69699b1cad04e01dda2e3e558e..6ec8db21e27f4a9b4e2355bfb30263638b4b9618 100644 (file)
@@ -7,7 +7,8 @@ Pre-install-hook,        Continue:Welcome | Abort:Fail
 
 Welcome,                 Continue:EULA | Abort:Fail
 EULA,                    Continue:Check-host-capabilities | Abort:Fail
-Check-host-capabilities, Continue:Choose-install-type | Abort:Fail
+Check-host-capabilities, Continue:Check-GPU | Abort:Fail
+Check-GPU,               Continue:Choose-install-type | Abort:Fail
 
 Choose-install-type,     Optical:Locate-optical-media | Network:Select-NIC | BootMedia:Check-initrd-data | Abort:Fail