When we either are using a persistent Live USB or Live CD, we run into the problem of being unable to use propritary drivers such as Nvidia, because the "xorg.conf" is getting reverted on reboot. I've created a workaround that overwrites the "xorg.conf" with a configured one, before the X Window System starts. The script do also check for existing Nvidia cards and drivers, to avoid conflict with other video drivers, because it's not necessary the same machine you always are using your medium with. You have two procedures for installing the workaround.
The automatic way
I've create a DEB package that sets up the whole thing for you. 
=======
Installing
=======
Just download it from here: http://uploadmirrors.com/download/L9...workaround.deb
========
Uninstalling
========
Just execute this:
Code:
sudo dpkg -r nvidia-xorg-workaround
The manual way
For those who wants to do it all by themselfs. 
==========
1. Preparation
==========
We are going to need root access the whole way. After you type this, don't close the terminal:
We need to install the dependencies for Nvidia components:
Code:
apt-get install dkms nvidia-180-libvdpau
=============
2. Driver Packages
=============
We need to create a directory for the packages:
Code:
mkdir /opt/nvidia
cd /opt/nvidia
When we need to retrieve the packages:
Code:
wget http://ftp.osuosl.org/pub/ubuntu/pool/restricted/n/nvidia-graphics-drivers-180/nvidia-180-kernel-source_180.44-0ubuntu1_i386.deb
wget http://ftp.osuosl.org/pub/ubuntu/pool/restricted/n/nvidia-graphics-drivers-180/nvidia-glx-180_180.44-0ubuntu1_i386.deb
wget http://ftp.osuosl.org/pub/ubuntu/pool/main/n/nvidia-settings/nvidia-settings_180.25-0ubuntu1_i386.deb
wget http://ftp.osuosl.org/pub/ubuntu/pool/main/n/nvidia-common/nvidia-common_0.2.11_i386.deb
===============
3. Video Configuration
===============
Now you'll have to edit the xorg.conf file. We are going to open it in gedit:
Code:
gedit /etc/X11/xorg.conf
Now you have to add the highlighted line, so it will look like this:
Code:
# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# Note that some configuration settings that could be done previously
# in this file, now are automatically configured by the server and settings
# here are ignored.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg
Section "Device"
Identifier "Configured Video Device"
Driver "nvidia"
EndSection
Section "Monitor"
Identifier "Configured Monitor"
EndSection
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
EndSection
Save it as "xorg.conf.nvidia" on the X11 directory.
===============
4. Workaround Script
===============
We are going to create a file, that contains the script:
Code:
touch /etc/init.d/nvidiaxorg
chmod +x /etc/init.d/nvidiaxorg
gedit /etc/init.d/nvidiaxorg
Paste this into the text editor and save it:
Code:
#!/bin/bash
load_check() {
if [ -f /usr/bin/nvidia-settings ]
then
echo "### Nvidia drivers are found, proceeding"
else
echo "### Nvidia drivers not found, processing"
dpkg -i /opt/nvidia/nvidia-common_0.2.11_i386.deb
dpkg -i /opt/nvidia/nvidia-180-kernel-source_180.44-0ubuntu1_i386.deb
dpkg -i /opt/nvidia/nvidia-settings_180.25-0ubuntu1_i386.deb
dpkg -i /opt/nvidia/nvidia-glx-180_180.44-0ubuntu1_i386.deb
fi
}
unload_check() {
if [ -f /usr/bin/nvidia-settings ]
then
echo "### Nvidia drivers are found, processing"
dpkg -r nvidia-glx-180
dpkg -r nvidia-settings
dpkg -r nvidia-180-kernel-source
dpkg -r nvidia-common
else
echo "### Nvidia drivers not found, proceeding"
fi
}
if [[ `lspci |grep VGA` == *nVidia* ]]
then
echo "### Nvidia devices are found, proceeding"
cp /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf
load_check
else
echo "### Nvidia devices not found, proceeding"
unload_check
fi
Now we need to add the script to the runlevels:
Code:
update-rc.d -f nvidiaxorg start 20 S .
Congratulations, you're done.
Bookmarks