Building restricted drivers for XBMCbuntu

From XBMC
Revision as of 07:40, 20 February 2009 by L.capriotti (Talk)

Jump to: navigation, search

1 Introduction

The simpler approach to build and install the restricted drivers is to run the driver installer on XBMCLive. The installer will take care of all installations and modify the config files accordingly.

However, this requires that a full build environment has to be available on the system, while the default XBMCLive build does not have the required packages for sake of being as much compact as possible.

As several users have experienced, a full build environment requires around 1 GB of space, and the XBMCLive permanent storage file can be filled up quite easily.

The following procedures are intended to tackle this issue; it has side effects and limitations but once you have a fully working build environment it does not have major disadvantages (IMHO).


2 Building NVIDIA video drivers

  • Method 1: build drivers on XBMCLive
  • Method 2: build drivers in MIC

Assuming you have created a target in MIC for the creation of the XBMCLive image, you need to create a new target having all the necessary development tools ON THE SAME PLATFORM, so that the build target has the same system components as the XBMCLive target.

Once done, copy the driver installer script onto the target and perform the following steps in a chrooted terminal on the build target:

sh ./NVIDIA-Linux-x86-180.29-pkg1.run --extract-only
cd NVIDIA-Linux-x86-180.29-pkg1
mv * usr/bin

Now a few symlinks need to be created in a few library directories:

cd usr/lib

create the following:

lrwxrwxrwx libcuda.so.1 -> libcuda.so.180.29                                         
lrwxrwxrwx libGLcore.so.1 -> libGLcore.so.180.29                                     
lrwxrwxrwx libGL.so -> libGL.so.1                                                    
lrwxrwxrwx libGL.so.1 -> libGL.so.180.29                                             
lrwxrwxrwx 1 libnvidia-cfg.so -> libnvidia-cfg.so.1                                    
lrwxrwxrwx libnvidia-cfg.so.1 -> libnvidia-cfg.so.180.29                             
lrwxrwxrwx libnvidia-tls.so -> libnvidia-tls.so.1                                    
lrwxrwxrwx libnvidia-tls.so.1 -> libnvidia-tls.so.180.29                             
lrwxrwxrwx libvdpau_nvidia.so -> libvdpau_nvidia.so.1                                
lrwxrwxrwx libvdpau_nvidia.so.1 -> libvdpau_nvidia.so.180.29
lrwxrwxrwx libvdpau.so -> libvdpau.so.1
lrwxrwxrwx libvdpau.so.1 -> libvdpau.so.180.29
lrwxrwxrwx libvdpau_trace.so -> libvdpau_trace.so.1
lrwxrwxrwx libvdpau_trace.so.1 -> libvdpau_trace.so.180.29
cd usr/lib/tls

create the following:

lrwxrwxrwx libnvidia-tls.so.1 -> libnvidia-tls.so.180.29

Some files need to be moved to their appropriate place for Ubuntu:

mkdir usr/lib/xorg
mv X11R6/* usr/lib/xorg

and again some symlinks are to be created:

cd usr/lib/xorg
lrwxrwxrwx libXvMCNVIDIA.so -> libXvMCNVIDIA.so.1
lrwxrwxrwx libXvMCNVIDIA.so.1 -> libXvMCNVIDIA.so.180.29
cd usr/lib/xorg/modules

lrwxrwxrwx libnvidia-wfb.so -> libnvidia-wfb.so.1
lrwxrwxrwx libnvidia-wfb.so.1 -> libnvidia-wfb.so.180.29
cd usr/lib/xorg/modules/extensions
lrwxrwxrwx libglx.so -> libglx.so.1
lrwxrwxrwx libglx.so.1 -> libglx.so.180.29


Then, the kernel module needs to be compiled and placed in an appropriate location:

cd usr/src/nv
make module
mkdir ../../../lib
mkdir ../../../lib/modules
mkdir ../../../lib/modules/2.6.2x-yy-generic
mkdir ../../../lib/modules/2.6.2x-yy-generic/updates
mkdir ../../../lib/modules/2.6.2x-yy-generic/dkms
cp nvidia.ko ../../../lib/modules/2.6.2x-yy-generic/dkms

You can now create a new loopfile of a reasonable size (80 MB should work) with:

dd if=/dev/zero of=restrictedDrivers.nvidia.img bs=1M count=80
mkfs.ext3 restrictedDrivers.nvidia.img -F

and populate it by mounting the image file and copying all the files above:

mkdir Image
mount -o loop restrictedDrivers.nvidia.img Image
cp -RP NVIDIA-Linux-x86-180.29-pkg1/* Image
umount Image


There is however a final step, ie. having the new module automatically loaded. For this we need to have an updated modules.dep inside the restrictedDrivers.nvidia.img. My way of doing it is to boot XBMCLive with NVIDIA drivers in safe mode, run a "sudo depmod -a" and copy the resulting /lib/modules/2.6.2X-yy-generic/modules.dep over to the same location in build environment again, and reiterate the population of the .img file.


3 Building ATI/AMD video drivers

  • Method 1: build drivers on XBMCLive
  • Method 2: build drivers in MIC

Assuming you have created a target in MIC for the creation of the XBMCLive image, you need to create a new target having all the necessary development tools ON THE SAME PLATFORM, so that the build target has the same system components as the XBMCLive target.

Once done, copy the driver installer script onto the target and perform the following steps in a chrooted terminal on the build target:

mkdir Files
sh ./ati-driver-installer-9-1-x86.x86_64.run --buildpkg Ubuntu/intrepid                                                                                        
dpkg-deb -x fglrx-amdcccle_8.573-0ubuntu1_i386.deb Files                                                                                                            
dpkg-deb -x fglrx-kernel-source_8.573-0ubuntu1_i386.deb Files                                                                                                       
dpkg-deb -x fglrx-modaliases_8.573-0ubuntu1_i386.deb Files                                                                                                          
dpkg-deb -x libamdxvba1_8.573-0ubuntu1_i386.deb Files                                                                                                               
dpkg-deb -x xorg-driver-fglrx_8.573-0ubuntu1_i386.deb Files                                                                                                         
dpkg-deb -x xorg-driver-fglrx-dev_8.573-0ubuntu1_i386.deb Files 

You have now all the files needed in the "Files" directory, minus the kernel module. In order to create the kernel module we are going to build it manually:

cd ./Files                                                                                                                                                            
pushd .
cd usr/src/fglrx-8.573/
make
popd
mkdir lib
mkdir modules
mkdir 2.6.27-11-generic
mkdir updates
mkdir dkms
mv usr/src/fglrx-8.573/2.6.x/fglrx.ko lib/modules/2.6.27-11-generic/updates/dkms

You can now create a new loopfile of a reasonable size (80 MB should work) with:

dd if=/dev/zero of=restrictedDrivers.amd.img bs=1M count=80
mkfs.ext3 restrictedDrivers.amd.img -F

and populate it by mounting the image file and copying all the files above:

mkdir Image
mount -o loop restrictedDrivers.amd.img Image
cp -RP Files/* Image
umount Image

There is however a final step, ie. having the new module automatically loaded. For this we need to have an updated modules.dep inside the restrictedDrivers.amd.img. My way of doing it is to boot XBMCLive with AMD drivers in safe mode, run a "sudo depmod -a" and copy the resulting /lib/modules/2.6.2X-yy-generic/modules.dep over to the same location in build environment again, and reiterate the population of the .img file.

Personal tools
Namespaces

Variants
Actions
Google Search
Navigation
Wiki help
Toolbox