How to make a .pet of a self-compiling Nvidia installer?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

How to make a .pet of a self-compiling Nvidia installer?

#1 Post by 8-bit »

I want to know if it is possible to have a self compiling/ installing package send its files to a directory for use in making a PET from it.
The package is the factory Nvidia installer and I just do not know what files it creates and modifies for including the directory structure and associated files into a directory suitable for making a PET from it.

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#2 Post by JustGreg »

Hi 8-bit,

It seems we may be trying the same project. I am trying to create a pet for Quirky 1.00 to upgrade to the nvidia version 195.36.24 driver. I have check the Puppy forum for information. There is a post: [url]http:/www.murga-linux.com/puppy/viewtopic.php?t=35507[/url]
It helps.

There is a utility called new2dir that appears to do what you want. The problem is the nvidia installer creates the kernel module in manner that does not let you to go back to the old version. The installer over writes existing files without backing them up. So if there is a problem, you have to re-install the distribution.

Where the new files are installed, after running the installer, is documented in /usr/share/doc/NVIDIA_GLX-1.0/html directory. There is a file (installedcomponents.html) with the informtion.

Here are the files needed for a Puppy installation and they are located after installation. I used the html file and pfind to confirm the location.
I have a pet for nvidia-settings tool. I used the information to make that pet.

Xdriver, nvidia_drv.so, /usr/X11R7/lib/modules/drivers

GLX extension module, a library, overwrites the existing library, /usr/X11R7/lib/modules/extensions/

module for wrapped software rendering, libnvidia-wfb.so.version# in /usr/X11R7/lib/modules.

OpenGL library, /usr/lib/

OpenGLcore library, /usr/lib/

Kernel module in /lib/modules/2.6.33.2/kernel/drivers/video/ This is different from the directory that Barry uses for Quirky 1.00.

the local threads storage library goes into /usr/lib. The problem is there are two versions of the same library. I found Quirky 1.0 needs to use the library in /usr/lib/tls/ and not the one in /usr/lib/

The utilities go into /usr/bin.

If you run the nvidia installer then there is a lot of good information in the documentation package.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#3 Post by 8-bit »

In my case of trying, I started the nvidia installer.
Then before accepting anything, and with the splash screen for acceptance showing, I navigated to /tmp and found the uncompressed directory for the install there.
I tried making a pet using it as a guide as to where the installer was putting the files.
When I got the pet created, I tried it of a fresh boot with pfix=ram.
It failed to take me back to the desktop when I typed xwin.
I found that the driver/ nvidia was complaining it could not find the screen.
But with different types of nvidia cards and screens/displays, will a pet for one work for all?
I just got through installing lupu-500 and after installing the kernel.sfs file and devx.sfs file and running xorgwizard, I went ahead and tried the factory install.
The one area where the installer failed, but continued was it's call of "depmod -aq".
I let it complete right down to allowing it to modify /etc/X11/xor.conf.
When it said it was finished with the install, I then typed "depmod -a" followed by typing "modprobe nvidia" and then "xwin".
All went well and back at the desktop, I installed a pet I had made for glxgears.
Everything worked!
But as I said previously, with different processors and monitors, would a PET work for all? Especially since there seems to be no going back as you stated.

Ledster
Posts: 88
Joined: Sat 26 Aug 2006, 15:33
Location: Devon, England

#4 Post by Ledster »

depmod (in /usr/sbin/) is a link to busybox.

I had this problem and did the following:

Rename depmod to depmodbak
create a link to depmod-FULL (also in /usr/bin/) called depmod
ran the install program - no problems

deleted the link
renamed depmodbak to depmod

Worked ok for me.

Ledster

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#5 Post by 8-bit »

I tried your mod on an already working Nvidia factory install.
It failed and I had to reinstall the Nvidia pkg after undoing the mods you suggested.
I guess that shows that what works for some, does not work for all.
But I had to try.
So a reinstall did not work using your method.

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#6 Post by JustGreg »

Hi 8-bit,

One problem is the expand directory does not contained the complied needed kernel module and X driver. I have also ran into the depmod problem. After complied modules are done by the installer, I have used depmod-FULL -a to get things to work.

I have been trying to figure out what files (libraries, etc) are need in addition to the nvidia.ko and nvidia_drv.so. I thought I had it worked out for a pet. But, the pet has failed. I have been looking Quirky 1.00 to see what is needed. Barry is much better at this than I am. But, I will keep trying.

To have the official installer work properly, one needs the devx file and kernel source sfs files.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#7 Post by jamesbond »

I assume you know how to make a pet. Two methods to do it.

Method #1
1. Make sure you have devx and kernel headers installed.
2. Extract the files from the NVIDIA binary bundle:

Code: Select all

./NVIDIA-Linux-x86_64-195.36.15-pkg2.run --x
3. Cd to the extracted directory. In the following, all the directory names are relative to this extracted directory.
4. With the exception of a few shell scripts, you will need everything under usr/bin, usr/lib, usr/X11R6 (rename that usr/X11R6 to usr/X11R7), and /usr/share. If you need the header files (for devx etc), get usr/include as well
5. Go to usr/src and run

Code: Select all

make modules
(you need devx and kernel headers installed to be able to do this)
6. Get the resulting compiled nvidia.ko into your pet as well (perhaps under lib/modules/2.6.28.10/kernel/drivers/video (or whatever your kernel version is).
7. Create a pinstall.sh that will execute "depmod -a" after installation is completed.
8. Use dir2pet to create the pet.
9. Done !
(Obviously, xorg.conf is not touched. There are many ways to get this xorg.conf updated - asking the user to run nvidia-xconfig, running nvidia-settings, or simply get a standard xorg.conf and change the driver from "vesa" or "nv" to "nvidia" and add this into the pet).

Method #2
1. Boot from pfix=ram, and create a fresh save file - make sure you have about 300MB free at least (more is better).
2. Configure to load devx and kernel headers. Don't configure everything else.
3. Reboot, and make sure that your gcc works and /usr/src is not empty,
4. Kill X (make sure X is not running and you're in linux console). Otherwise, you can also boot with pfix=nox.
5. Run the NVIDIA installer from the binary bundle

Code: Select all

./NVIDIA-Linux-x86_64-195.36.15-pkg2.run
. It will install the NVIDIA driver.
6. Test your installation by starting X

Code: Select all

xwin
7. If it works, reboot and go into the system with pfix=ram.
8. Using rox, go into your fresh save file and double-click it (=open it).
9. Examine the files that have been added by the NVIDIA installer. The files would be similar to what you see in method #1 step 4. Copy all this files into some storage directory.
10. Look into /lib/modules/kernel-version/kernel/drivers/video and look for nvidia.ko there. (If it's not there, look around - it must be somewhere in your /lib/modules directory). Copy this file also into that storage directory.
11. Follow step 7 onwards of method #1.
12. If you want, before you run dir2pet, you can also copy the etc/X11/xorg.conf you found in your savefile.

I personally tested Method #2, it works cleanly for me. I believe method #1 should work as well (the files I got from method #2 is a subset of the ones I found in method #1).

BTW - the title of this thread is to create a self-compiling nvidia pet. If you're thinking to create a pet that will work with all kernels, you can do so with method #1 by including the entire /usr/src instead of only the compiled nvidia.ko module. But I think it's rather pointless because for that to happen, you need to have devx and kernel-headers before you can install the pet (as the pet then needs to compile the module on demand).

Alternatively, if you have a lot of time, you can compile the nvidia module a few times on different kernels, and bundle them together into the pet. You can then write a pinstall.sh script which will choose and copy the correct version depending on which kernel is used.

Good luck.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

JustGreg
Posts: 782
Joined: Tue 24 May 2005, 10:55
Location: Connecticut USA

#8 Post by JustGreg »

Thanks for the information, Jamesbond. I have tried method 2 and it works. The official Nvidia 195.36.24 installer does work and the video driver is updated with libraries. I have looked through the directories to find the libraries and driver. I have made a pet. In fact, I first tried with just the nvidia-settings tool. I made a pet and it works.

However, when I made a pet using the results of the installer output, it fails with a fresh save file. The xorg server tries to start displays a mess of colors and nothing works. Thank god for Ctrl-Alt-Backspace to get back to the console. When the official install executes, there is a message about changing out incapable libraries. However, I can not find the new ones. I think it maybe deleting a library or two. I will keep trying to determine what is going on. I have search a clear Quirky 1.00 installation to see what nvidia files Barry has used. Try a Pet based on those files, a little better, but no success. At least now, I can get the official installer to work with kernel sources and devx sfs files. I has been a good learning experience.

Once again, thanks for the information.
Enjoy life, Just Greg
Live Well, Laugh Often, Love Much

Post Reply