Warning: at the moment it works only for x64 systems.
1- First you should copy and paste the script below and save it as nvidia-driver.sh in any persistent folder. But make sure this path is NOT inside a FAT partition, but a partition that supports symlinks, as NTFS, for example.
2- Then you should download the appropriate Nvidia driver for your card on Nvidia's webiste. Refer to this topic as a guide.
3- Download blacklist.xzm, devel.xzm and crippled_sources.xzm ( http://dl.porteus.org/x86_64/Porteus-v3.2.2/kernel/ ) to your usb stick/porteus/base.
4- If you already have a Nvidia driver xzm module running, remove it or change file location and reboot in order to make a clean installation.
5- Reboot, enter in Text Mode and login as root.
6- Find the driver path and call: sh driver.run
(where 'driver' is the name of the file)
7- Accept the terms and press Enter. After a while it'll ask for generating libs for 32 bits applications. You probably don't want to do that, so choose 'no'. After a few seconds a new question will appear asking something about nvidia-xconfig so you should choose 'yes'. Wait a little bit and then hit Enter to exit.
8- Now find the script path of the first step of this tutorial and execute it: sh nvidia-driver.sh. You have to be patience as it'll create a module with all changes made after the boot, then it'll extract everything, make a clean-up and a few tricks and finally it'll create the new xzm module.
9- After the script finishes you should copy the new module (by default nvidia-cleaned-driver.xzm) to your usb stick/porteus/modules and reboot in Graphics Mode. Also, you don't need to load the modules from step 3 anymore.
10- Once inside the GUI, run nvidia-settings and make sure that there's no error message. Now you can run glxgears and pray for those 3 colored gears to appear.
11- If everything went fine so far, here comes the last and most scary step: still inside the GUI go to a terminal as root and run ldconfig. Now repeat step 10. If there's no error at all, you're finally good to go.
Code: Select all
echo Saving changes after Nvidia driver setup. This may take some time...
save-changes nvidia-driver.xzm
rm -r nvidia-driver &>/dev/null
rm -r nvidia-cleaned-driver &>/dev/null
/opt/porteus-scripts/context-menu/extract-module ./nvidia-driver.xzm &>/dev/null
mv nvidia-driver/ nvidia-cleaned-driver/
cd nvidia-cleaned-driver
echo Main folder cleaning...
rm -fr dev
rm -fr home
rm -fr mnt
rm -fr root
rm -fr tmp
rm -fr var
echo Etc folder cleaning...
rm -f etc/* &>/dev/null
rm -fr etc/gtk-2.0
rm -fr etc/lvm
rm -fr etc/profile.d
rm -fr etc/rc.d
rm -fr etc/udev
echo Lib folder cleaning...
rm -f lib/modules/4.*/* &>/dev/null
echo Usr folder cleaning...
rm -fr usr/src
rm -fr usr/local
rm -fr usr/man
rm -fr usr/share/doc
rm -fr usr/share/mime
rm -fr usr/share/applications/mimeinfo.cache
rm -fr usr/lib64/gio
rm -fr usr/lib64/gtk-2.0
rm -fr usr/lib64/gtk-3.0
rm -fr usr/lib64/gio
rm -f usr/lib64/libEGL.so
rm -f usr/lib64/libEGL.so.1
rm -f usr/lib64/libGL.so
rm -f usr/lib64/libGL.so.1
rm -f usr/lib64/libGLESv1_CM.so
rm -f usr/lib64/libGLESv1_CM.so.1
rm -f usr/lib64/libGLESv2.so
rm -f usr/lib64/libGLESv2.so.2
rm -f usr/lib64/libudev.so.1
rm -f usr/lib64/libunrar.so.5
rm -f usr/lib64/libXvMCgallium.so.1
# this is a trick to avoid ldconfig reseting libGL.so.1 symlink to libGL.so.1.2.0 that comes with Porteus on some configurations
echo Fixing libGL symlinks...
cd usr/lib64/
if [ -f "libGL.so.1.0.0" ]
then
cp libGL.so.1.0.0 libGL.so.1.2.0
cp -s libGL.so.1.2.0 libGL.so
cp -s libGL.so.1.2.0 libGL.so.1
cp libGLESv1_CM_nvidia.so.3* libGLESv1_CM.so.1.1.0
cp -s libGLESv1_CM_nvidia.so.3* libGLESv1_CM.so
cp -s libGLESv1_CM_nvidia.so.3* libGLESv1_CM.so.1
cp libGLESv2_nvidia.so.3* libGLESv2.so.2.0.0
cp -s libGLESv2_nvidia.so.3* libGLESv2.so
cp -s libGLESv2_nvidia.so.3* libGLESv2.so.2
else
cp -s libGL.so.3* libGL.so
cp -s libGL.so.3* libGL.so.1
cp -s libGLESv1_CM.so.3* libGLESv1_CM.so
cp -s libGLESv1_CM.so.3* libGLESv1_CM.so.1
cp -s libGLESv2.so.3* libGLESv2.so
cp -s libGLESv2.so.3* libGLESv2.so.2
fi
echo Disabling nouveau...
cd ../..
mkdir etc/modprobe.d
cp /etc/modprobe.d/nvidia-installer-disable-nouveau.conf etc/modprobe.d
echo Creating module...
cd ..
rm nvidia-cleaned-driver.xzm &>/dev/null
dir2xzm nvidia-cleaned-driver nvidia-cleaned-driver.xzm &>/dev/null
echo Removing temp files...
rm -fr nvidia-cleaned-driver
rm -f nvidia-driver.xzm
echo Finished.