Kodi Community Forum
auto detection of video card for live CD boot up - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Linux (https://forum.kodi.tv/forumdisplay.php?fid=52)
+---- Thread: auto detection of video card for live CD boot up (/showthread.php?tid=41445)



auto detection of video card for live CD boot up - crackerbox - 2008-12-02

Let me be more clear... this would eliminate the need to choose 1 for nvidia, 2 for ati, 3 for intel (and 4 for the show? jk)

This is possible.

the following command will output the mgf of the video card:

lspci|grep VGA|grep -Ewo '(Intel|ATI|nVidia)'


now a simple if / then statement can be used inside of the initramfs loading scripts that is called before any script that configures X

basically you say (this is psudeo code):

if lspci|grep VGA|grep -Ewo '(Intel|ATI|nVidia)' == Intel
then (perform the same tasks as if the user hit #3 during boot process)
if lspci|grep VGA|grep -Ewo '(Intel|ATI|nVidia)' == ATI
then (perform the same tasks as if the user hit #2 during boot process)
if lspci|grep VGA|grep -Ewo '(Intel|ATI|nVidia)' == nVidia
then (perform the same tasks as if the user hit #1 during boot process)
else echo "buy a real video card. press any key to restart."
halt
end if

-CB