个人工具

“UbuntuHelp:BuildYourOwnNvidiaGlx”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的11个中间版本)
第1行: 第1行:
 
{{From|https://help.ubuntu.com/community/BuildYourOwnNvidiaGlx}}
 
{{From|https://help.ubuntu.com/community/BuildYourOwnNvidiaGlx}}
 
{{Languages|UbuntuHelp:BuildYourOwnNvidiaGlx}}
 
{{Languages|UbuntuHelp:BuildYourOwnNvidiaGlx}}
 
 
 
== Introduction ==
 
== Introduction ==
''Note:'' The 9755 driver was included with Ubuntu 7.04 and is called nvidia-glx-new. Later versions of Ubuntu may come with more recent drivers. Please see [[UbuntuHelp:BinaryDriverHowto/Nvidia]] for further details.
+
''Note:'' The 9755 driver was included with Ubuntu 7.04 and is called nvidia-glx-new. Later versions of Ubuntu may come with more recent drivers. Please see [[UbuntuHelp:BinaryDriverHowto/Nvidia|BinaryDriverHowto/Nvidia]] for further details.
 
+
 
This page details how to make your own '''nvidia-glx''' with the latest NVIDIA drivers integrated to the linux-restricted-modules package. Why do you want this you could ask? Well, people who have an NVIDIA 8800-series card need the latest driver (97.42) to get working 3D-acceleration. The card is not supported by the driver included in linux-restricted-modules ''(l-r-m)'' at the moment. The more popular reason would be that the 9x.xx drivers support the TFP (texture from pixmap) extension, which '''allows you to run Compiz/Beryl without XGL.'''
 
This page details how to make your own '''nvidia-glx''' with the latest NVIDIA drivers integrated to the linux-restricted-modules package. Why do you want this you could ask? Well, people who have an NVIDIA 8800-series card need the latest driver (97.42) to get working 3D-acceleration. The card is not supported by the driver included in linux-restricted-modules ''(l-r-m)'' at the moment. The more popular reason would be that the 9x.xx drivers support the TFP (texture from pixmap) extension, which '''allows you to run Compiz/Beryl without XGL.'''
 
 
== Setting up repositories ==
 
== Setting up repositories ==
 
 
Add this source entry into your '''/etc/apt/sources.list''':
 
Add this source entry into your '''/etc/apt/sources.list''':
 
<pre><nowiki>
 
<pre><nowiki>
第16行: 第11行:
 
The l-r-m was updated because of a security vulnerability found in the NVIDIA 8774 driver, this is why the source is located on the edgy-security repository.
 
The l-r-m was updated because of a security vulnerability found in the NVIDIA 8774 driver, this is why the source is located on the edgy-security repository.
 
== Getting the source ==
 
== Getting the source ==
 
 
Then change to a directory where you want do to the compiling and get the source by issuing this command:
 
Then change to a directory where you want do to the compiling and get the source by issuing this command:
 
<pre><nowiki>
 
<pre><nowiki>
 
apt-get source nvidia-glx
 
apt-get source nvidia-glx
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Now let's satisfy the build dependencies (If you're building with pbuilder you can skip this step):
 
Now let's satisfy the build dependencies (If you're building with pbuilder you can skip this step):
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo apt-get build-dep nvidia-glx
 
sudo apt-get build-dep nvidia-glx
 
</nowiki></pre>
 
</nowiki></pre>
 
 
== Download the driver packages ==
 
== Download the driver packages ==
 
 
You need both of these packages for the linux-restricted-modules:
 
You need both of these packages for the linux-restricted-modules:
 
 
[http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9742/NVIDIA-Linux-x86-1.0-9742-pkg1.run NVIDIA-Linux-x86-1.0-9742-pkg1.run]
 
[http://us.download.nvidia.com/XFree86/Linux-x86/1.0-9742/NVIDIA-Linux-x86-1.0-9742-pkg1.run NVIDIA-Linux-x86-1.0-9742-pkg1.run]
 
[http://us.download.nvidia.com/XFree86/Linux-x86_64/1.0-9742/NVIDIA-Linux-x86_64-1.0-9742-pkg2.run NVIDIA-Linux-x86_64-1.0-9742-pkg2.run]
 
[http://us.download.nvidia.com/XFree86/Linux-x86_64/1.0-9742/NVIDIA-Linux-x86_64-1.0-9742-pkg2.run NVIDIA-Linux-x86_64-1.0-9742-pkg2.run]
 
 
== Replacing files in the archive ==
 
== Replacing files in the archive ==
 
 
Open ''linux-restricted-modules-2.6.17_2.6.17.6.orig.tar.gz'' in e.g. file-roller.
 
Open ''linux-restricted-modules-2.6.17_2.6.17.6.orig.tar.gz'' in e.g. file-roller.
 
Go to /linux-restricted-modules-2.6.17-2.6.17.6.orig/nvidia/ (in fileroller) and delete the old (8776) driver, which you want to replace, still leaving the nvidia legacy drivers intact. After this, add the files you downloaded [ ''NVIDIA-Linux-x86-1.0-9742-pkg1.run NVIDIA-Linux-x86_64-1.0-9742-pkg2.run'' ] to the archive.
 
Go to /linux-restricted-modules-2.6.17-2.6.17.6.orig/nvidia/ (in fileroller) and delete the old (8776) driver, which you want to replace, still leaving the nvidia legacy drivers intact. After this, add the files you downloaded [ ''NVIDIA-Linux-x86-1.0-9742-pkg1.run NVIDIA-Linux-x86_64-1.0-9742-pkg2.run'' ] to the archive.
 
 
== Editing the .diff file ==
 
== Editing the .diff file ==
 
 
Extract ''linux-restricted-modules-2.6.17_2.6.17.6-1.diff.gz'' and open the .diff file in your favorite text editor.
 
Extract ''linux-restricted-modules-2.6.17_2.6.17.6-1.diff.gz'' and open the .diff file in your favorite text editor.
 
 
1. Find and replace all instances of '''8776''' with '''9742''' (The 8776 in the changelog section you can leave unchanged.)
 
1. Find and replace all instances of '''8776''' with '''9742''' (The 8776 in the changelog section you can leave unchanged.)
 +
2. Find and replace:
  
2. Find and replace:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
$(nv_dirname)/usr/X11R6/lib/modules/drivers/nvidia_drv.o
 
$(nv_dirname)/usr/X11R6/lib/modules/drivers/nvidia_drv.o
第54行: 第39行:
 
</nowiki></pre>
 
</nowiki></pre>
 
3. Find:
 
3. Find:
 +
 
<pre><nowiki>
 
<pre><nowiki>
 
+linux-restricted-modules-2.6.17 (2.6.17.6-1) edgy-security; urgency=low
 
+linux-restricted-modules-2.6.17 (2.6.17.6-1) edgy-security; urgency=low
第67行: 第53行:
 
</nowiki></pre>
 
</nowiki></pre>
 
4. As we have added six (6) lines to the file, the above line must be altered from:
 
4. As we have added six (6) lines to the file, the above line must be altered from:
 +
 
<pre><nowiki>
 
<pre><nowiki>
 
@@ -0,0 +1,1319 @@
 
@@ -0,0 +1,1319 @@
第75行: 第62行:
 
</nowiki></pre>
 
</nowiki></pre>
 
You can of course replace my name and email with your own.
 
You can of course replace my name and email with your own.
 
 
'''Save''' the file. Then rename the file to ''linux-restricted-modules-2.6.17_2.6.17.6-2.diff'' and '''gzip''' it.
 
'''Save''' the file. Then rename the file to ''linux-restricted-modules-2.6.17_2.6.17.6-2.diff'' and '''gzip''' it.
 
 
== Making some final changes (the .dsc file) ==
 
== Making some final changes (the .dsc file) ==
 
 
Edit ''linux-restricted-modules-2.6.17_2.6.17.6-1.dsc'', again, open it with your favorite text editor.
 
Edit ''linux-restricted-modules-2.6.17_2.6.17.6-1.dsc'', again, open it with your favorite text editor.
 +
1. Find and replace:
  
1. Find and replace:
 
 
<pre><nowiki>
 
<pre><nowiki>
 
Version: 2.6.17.6-1.1
 
Version: 2.6.17.6-1.1
第91行: 第75行:
 
</nowiki></pre>
 
</nowiki></pre>
 
2. Replace:
 
2. Replace:
 +
 
<pre><nowiki>
 
<pre><nowiki>
 
linux-restricted-modules-2.6.17_2.6.17.6-1.1.diff.gz
 
linux-restricted-modules-2.6.17_2.6.17.6-1.1.diff.gz
第98行: 第83行:
 
linux-restricted-modules-2.6.17_2.6.17.6-1.2.diff.gz
 
linux-restricted-modules-2.6.17_2.6.17.6-1.2.diff.gz
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Remove the old GnuPG signature header:
 
Remove the old GnuPG signature header:
 
<pre><nowiki>
 
<pre><nowiki>
第104行: 第88行:
 
Hash: SHA1
 
Hash: SHA1
 
</nowiki></pre>
 
</nowiki></pre>
 
 
and footer:
 
and footer:
 
<pre><nowiki>
 
<pre><nowiki>
第115行: 第98行:
 
-----END PGP SIGNATURE-----
 
-----END PGP SIGNATURE-----
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Now we need to replace the MD5SUM's and sizes in the .dsc with new one's. Commands to do this are:
 
Now we need to replace the MD5SUM's and sizes in the .dsc with new one's. Commands to do this are:
<pre><nowiki> md5sum <filename>
+
<pre><nowiki>
 +
md5sum <filename>
 
ls -l <filename> </nowiki></pre>
 
ls -l <filename> </nowiki></pre>
 
 
Be sure you get the MD5SUM's (and sizes) of the correct files; ''linux-restricted-modules-2.6.17_2.6.17.6.orig.tar.gz'' and ''linux-restricted-modules-2.6.17_2.6.17.6-2.diff.gz''
 
Be sure you get the MD5SUM's (and sizes) of the correct files; ''linux-restricted-modules-2.6.17_2.6.17.6.orig.tar.gz'' and ''linux-restricted-modules-2.6.17_2.6.17.6-2.diff.gz''
 
 
Rename the .dsc file
 
Rename the .dsc file
 
<pre><nowiki>
 
<pre><nowiki>
 
mv linux-restricted-modules-2.6.17_2.6.17.6-1.dsc linux-restricted-modules-2.6.17_2.6.17.6-2.dsc
 
mv linux-restricted-modules-2.6.17_2.6.17.6-1.dsc linux-restricted-modules-2.6.17_2.6.17.6-2.dsc
 
</nowiki></pre>
 
</nowiki></pre>
 
 
Sign it the package with '''debsign''':
 
Sign it the package with '''debsign''':
 
<pre><nowiki>
 
<pre><nowiki>
 
debsign -kYOURKEY linux-restricted-modules-2.6.17_2.6.17.6-1.dsc
 
debsign -kYOURKEY linux-restricted-modules-2.6.17_2.6.17.6-1.dsc
 
</nowiki></pre>
 
</nowiki></pre>
 
 
If you don't have a GnuPG key, you can generate one with:
 
If you don't have a GnuPG key, you can generate one with:
 
<pre><nowiki>
 
<pre><nowiki>
 
gpg --gen-key
 
gpg --gen-key
 
</nowiki></pre>
 
</nowiki></pre>
 
 
== Building it ==
 
== Building it ==
 
 
==== To build with pbuilder: ====
 
==== To build with pbuilder: ====
 
 
<pre><nowiki>
 
<pre><nowiki>
 
sudo pbuilder build linux-restricted-modules-2.6.17_2.6.17.6-2.dsc
 
sudo pbuilder build linux-restricted-modules-2.6.17_2.6.17.6-2.dsc
 
</nowiki></pre>
 
</nowiki></pre>
 
 
==== To build without it: ====
 
==== To build without it: ====
 
 
Extract the source with
 
Extract the source with
 
<pre><nowiki>
 
<pre><nowiki>
第155行: 第129行:
 
dpkg-buildpackage -rfakeroot
 
dpkg-buildpackage -rfakeroot
 
</nowiki></pre>
 
</nowiki></pre>
 
 
It takes a while to compile, but hopefully finishes. You can install the packages with '''dpkg''' as usual.
 
It takes a while to compile, but hopefully finishes. You can install the packages with '''dpkg''' as usual.
 
 
=== Related pages ===
 
=== Related pages ===
 
+
[[UbuntuHelp:BinaryDriverHowto/Nvidia]] [[UbuntuHelp:NvidiaTroubleshooting|NvidiaTroubleshooting]] [[UbuntuWiki:PbuilderHowto|PbuilderHowto]]
[[UbuntuHelp:BinaryDriverHowto/Nvidia]] NvidiaTroubleshooting [https://wiki.ubuntu.com/PbuilderHowto PbuilderHowto]
+
 
+
 
== Discussions ==
 
== Discussions ==
 
+
Personally, I find this method is very hacky. Wouldn't be simpler to extract the package and do the changes directly inside its directory, instead of modifying a diff file? What happens if a new version of linux-restricted-modules is released? - [[UbuntuHelp:AlexandreVassalotti|AlexandreVassalotti]]
Personally, I find this method is very hacky. Wouldn't be simpler to extract the package and do the changes directly inside its directory, instead of modifying a diff file? What happens if a new version of linux-restricted-modules is released? - AlexandreVassalotti
+
 
+
 
----
 
----
[[category:CategoryDocumentation]]
 
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2010年5月19日 (三) 21:48的最新版本

Introduction

Note: The 9755 driver was included with Ubuntu 7.04 and is called nvidia-glx-new. Later versions of Ubuntu may come with more recent drivers. Please see BinaryDriverHowto/Nvidia for further details. This page details how to make your own nvidia-glx with the latest NVIDIA drivers integrated to the linux-restricted-modules package. Why do you want this you could ask? Well, people who have an NVIDIA 8800-series card need the latest driver (97.42) to get working 3D-acceleration. The card is not supported by the driver included in linux-restricted-modules (l-r-m) at the moment. The more popular reason would be that the 9x.xx drivers support the TFP (texture from pixmap) extension, which allows you to run Compiz/Beryl without XGL.

Setting up repositories

Add this source entry into your /etc/apt/sources.list:

deb-src http://archive.ubuntu.com/ubuntu edgy-security main restricted universe multiverse

The l-r-m was updated because of a security vulnerability found in the NVIDIA 8774 driver, this is why the source is located on the edgy-security repository.

Getting the source

Then change to a directory where you want do to the compiling and get the source by issuing this command:

apt-get source nvidia-glx

Now let's satisfy the build dependencies (If you're building with pbuilder you can skip this step):

sudo apt-get build-dep nvidia-glx

Download the driver packages

You need both of these packages for the linux-restricted-modules: NVIDIA-Linux-x86-1.0-9742-pkg1.run NVIDIA-Linux-x86_64-1.0-9742-pkg2.run

Replacing files in the archive

Open linux-restricted-modules-2.6.17_2.6.17.6.orig.tar.gz in e.g. file-roller. Go to /linux-restricted-modules-2.6.17-2.6.17.6.orig/nvidia/ (in fileroller) and delete the old (8776) driver, which you want to replace, still leaving the nvidia legacy drivers intact. After this, add the files you downloaded [ NVIDIA-Linux-x86-1.0-9742-pkg1.run NVIDIA-Linux-x86_64-1.0-9742-pkg2.run ] to the archive.

Editing the .diff file

Extract linux-restricted-modules-2.6.17_2.6.17.6-1.diff.gz and open the .diff file in your favorite text editor. 1. Find and replace all instances of 8776 with 9742 (The 8776 in the changelog section you can leave unchanged.) 2. Find and replace:

$(nv_dirname)/usr/X11R6/lib/modules/drivers/nvidia_drv.o

with

$(nv_dirname)/usr/X11R6/lib/modules/drivers/nvidia_drv.so

3. Find:

+linux-restricted-modules-2.6.17 (2.6.17.6-1) edgy-security; urgency=low

Add this section above that line (to bump the version number and update the changelog):

+linux-restricted-modules-2.6.17 (2.6.17.6-2) edgy-security; urgency=low
+
+  * Updated the NVIDIA driver to version 9742.
+
+ -- Christoffer Karvonen <[email protected]>  Mon, 20 Nov 2006 02:46:43 +0200
+

4. As we have added six (6) lines to the file, the above line must be altered from:

@@ -0,0 +1,1319 @@

to

@@ -0,0 +1,1325 @@

You can of course replace my name and email with your own. Save the file. Then rename the file to linux-restricted-modules-2.6.17_2.6.17.6-2.diff and gzip it.

Making some final changes (the .dsc file)

Edit linux-restricted-modules-2.6.17_2.6.17.6-1.dsc, again, open it with your favorite text editor. 1. Find and replace:

Version: 2.6.17.6-1.1

with

Version: 2.6.17.6-1.2

2. Replace:

linux-restricted-modules-2.6.17_2.6.17.6-1.1.diff.gz

with

linux-restricted-modules-2.6.17_2.6.17.6-1.2.diff.gz

Remove the old GnuPG signature header:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

and footer:

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFFP6N5H/9LqRcGPm0RAh+nAJ0Qb7TzsP0s2REbLfFE7E5kA72cSACgmJas
tU/3xuWQZKqSaPzNYhNeccU=
=JWsr
-----END PGP SIGNATURE-----

Now we need to replace the MD5SUM's and sizes in the .dsc with new one's. Commands to do this are:

 md5sum <filename>
ls -l <filename> 

Be sure you get the MD5SUM's (and sizes) of the correct files; linux-restricted-modules-2.6.17_2.6.17.6.orig.tar.gz and linux-restricted-modules-2.6.17_2.6.17.6-2.diff.gz Rename the .dsc file

mv linux-restricted-modules-2.6.17_2.6.17.6-1.dsc linux-restricted-modules-2.6.17_2.6.17.6-2.dsc

Sign it the package with debsign:

debsign -kYOURKEY linux-restricted-modules-2.6.17_2.6.17.6-1.dsc

If you don't have a GnuPG key, you can generate one with:

gpg --gen-key

Building it

To build with pbuilder:

sudo pbuilder build linux-restricted-modules-2.6.17_2.6.17.6-2.dsc

To build without it:

Extract the source with

dpkg-source -x <filename>.dsc

Change to the directory it was extracted to and run

dpkg-buildpackage -rfakeroot

It takes a while to compile, but hopefully finishes. You can install the packages with dpkg as usual.

Related pages

UbuntuHelp:BinaryDriverHowto/Nvidia NvidiaTroubleshooting PbuilderHowto

Discussions

Personally, I find this method is very hacky. Wouldn't be simpler to extract the package and do the changes directly inside its directory, instead of modifying a diff file? What happens if a new version of linux-restricted-modules is released? - AlexandreVassalotti