PDA

View Full Version : RedHat 7.1 - cannot build NVdriver


akozakie
11-04-02, 08:14 AM
Hi. I hope someone here can help me, I'm completely out of ideas.

After testing the driver on RedHat 7.2 (kernel 2.4.9-something) at home for a few months I decided to install it on my more important machine, running RedHat 7.1. A few days earlier I installed the newest errata kernel, 2.4.18-17.7.x. A mistake?

I just can't make NVdriver from tarball. I get a lot of weird compilation errors and warnings (nv.c->nv.o), mostly "nondigits in number" and "parse error" in the kernel headers. As far as I can tell, the headers are where they should be, undamaged, the right version (unless it's a mix), and quite readable C, no reason for such errors, but they're very #define-heavy and preprocessed nv.c does have errors. For example, the first two "nondigits", a "parse error" and
"panic_R_ver_str declared as a function returning a function" are caused by the following lines, included from kernel.h, and preprocessed:
void panic_R_ver_str(01075bf0)(const char * fmt, ...)
__attribute__ ((noreturn, format (printf, 1, 2)));
well, I can't parse this either. I have used gcc for years, but with pure ANSI code, long, complicated, but not very advanced, nothing GNU-specific. What's
wrong? Missing/superfluous #define springs to mind, but I can only guess. BTW, in the kernel.h those lines look as follows:
NORET_TYPE void panic(const char * fmt, ...)
__attribute__ ((NORET_AND format (printf, 1, 2)));

Are there any success stories with RedHat 7.1 + errata + kernel 2.4.18-17 + gcc 2.96-85 (or 2.96-108, upgrade didn't help)? Am I doing something wrong? What else should I check?

For now I just use nv. I decided not to upgrade the kernel at home yet, just in case.

Adam K.

bwkaz
11-04-02, 09:47 AM
If you've upgraded the kernel you're running, you have to install the matching kernel-source. I don't know if this was causing the errors you've quoted (probably was -- kernel-headers are for glibc and userspace to use, not real kernel-mode modules, and an error to that effect usually accompanies errors like what you've quoted), but you will need the kernel's source installed eventually.

Once it's installed, you have to make sure /lib/modules/$(uname -r)/build (which is, in this case, /lib/modules/2.4.18-17.7.x/build, because that's what uname -r would be) is a symlink to wherever they got installed to (probably /usr/src/linux-2.4.18-17.7.x). Then, you have to find the appropriate config file (under /usr/src/linux-2.4.18-17.7.x/configs), copy it to /usr/src/linux-2.4.18-17.7.x/.config, and run make mrproper oldconfig dep from the linux-2.4.18-17.7.x directory.

Then try to recompile the NVIDIA_kernel -- but you may have to make clean in the NVIDIA_kernel directory first.

akozakie
11-04-02, 10:37 AM
Thanks.

By "kernel headers" I meant headers (.h) from the kernel source, of course, not kernel-headers. The kernel-source package is installed, and the headers are in /lib/modules/...

However, I did not meddle with .config yet. Since I'm using the default kernel (.athlon.rpm, I didn't have enough time to reconfigure and recompile it yet), I presumed the kernel-source would be fine the way it is. I'll try this in a moment. Thanks for advice!

EDIT: Thank you very, very much! 800Kb of NVdriver made and ready. We'll soon see if it works...