Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 76403 - nvidia-kernel-1.0.6629-r1 fails to determine kernel version
Summary: nvidia-kernel-1.0.6629-r1 fails to determine kernel version
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-02 06:24 UTC by Jan Callewaert
Modified: 2005-01-18 03:12 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Callewaert 2005-01-02 06:24:39 UTC
the ebuild fails to find the kernel version.

x86
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     2.6.9-gentoo-r13
 * Checking for suitable kernel configuration options
 * Using KV_OBJ=ko
 * Checking for MTRR support...
                                                                                                                  [ ok ]
x86
>>> Unpacking source...
Creating directory NVIDIA-Linux-x86-1.0-6629-pkg1
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86 1.0-6629.................................................
........................................................................................................................
................................
x86
<snip: patching>
 * Converting NVIDIA-Linux-x86-1.0-6629-pkg1/usr/src/nv/Makefile.kbuild to use M= instead of SUBDIRS=...          [ ok ]
>>> Source unpacked.
x86
 * Preparing nvidia module
If you are using a Linux 2.4 kernel, please make sure
you either have configured kernel sources matching your
kernel or the correct set of kernel headers installed
on your system.

If you are using a Linux 2.6 kernel, please make sure
you have configured kernel sources matching your kernel
installed on your system. If you specified a separate
output directory using either the "KBUILD_OUTPUT" or
the "O" KBUILD parameter, make sure to specify this
directorys _PARENT_ with the KBUILD_OUTPUT_PREFIX
environment variable, (or see /etc/env.d/05kernel)

*** Unable to determine the target kernel version. ***

/usr/src/linux is properly symlinked:
# ls -l /usr/src/linux
lrwxrwxrwx  1 root root 22 Jan  2 15:01 /usr/src/linux -> linux-2.6.9-gentoo-r13


Reproducible: Always
Steps to Reproduce:





# emerge --info
Portage 2.0.51-r3 (default-linux/x86/2004.2, gcc-3.4.3, glibc-2.3.4.20040808-r1,
2.6.9-gentoo-r13 i686)
=================================================================
System uname: 2.6.9-gentoo-r13 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.90.0.1.1-r3
Headers:  sys-kernel/linux26-headers-2.6.8.1,sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O2 -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/
/usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/
/usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks fixpackages sandbox sfperms
userpriv usersandbox"
GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/
ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X acl acpi4linux alsa apache2 apm arts audiofile avi bash-completion
berkdb bitmap-fonts blender-game bootsplash cdparanoia cdr cdrom clamav clisp
codecs crypt cups divx4linux dvd dvdr emacs encode fam flac foomaticdb fortran
gdbm gif gimp gimpprint gkrellm gpm gtk gtk2 imagemagick imap imlib imlib2 ipv6
java javadoc javascript jce jp2 jpeg jpeg2k junit kde libwww mad maildir mikmod
mmx mozilla moznocompose moznoirc moznomail mp3 mpeg mplayer msn ncurses nls
no_wxgtk1 nptl nvidia oav oggvorbis opengl pam pdflib perl php png python qt
quicktime readline samba sasl sdl slang spell sse ssl svga tcpd tetex tiff
truetype truetype-fonts unicode usb xine xml2 xmms xprint xv xvid zlib linguas_nl"
Comment 1 Andrew Bevitt 2005-01-02 16:06:40 UTC
Well this is caused by the select_makefile function in usr/src/nv/conftest.sh

The most likely reason is that you dont actually have a built kernel source, but your emerge info says you are running the kernel that is detected. Did you clean your kernel source after build/install?

If you have your sources built then try this
cd /usr/portage/media-video/nvidia-kernel/
ebuild nvidia-kernel-1.0.6629-r1.ebuild clean unpack
(Get this patch http://dev.gentoo.org/~cyfred/tmp/conftest.patch)
cd /var/tmp/portage/nvidia-kernel-1.0.6629-r1/work/NVIDIA-Linux-x86-1.0-6629-pkg1/usr/src/nv/
patch -Np0 < /path/to/patch
cd /usr/portage/media-video/nvidia-kernel/
ebuild nvidia-kernel-1.0.6629-r1.ebuild merge

You should get one extra line in the error message, can you paste that line.
Comment 2 Jan Callewaert 2005-01-03 01:16:05 UTC
I didn't do a make clean after I build my kernel. The extra message I get is this one:

select_makefile failed with RET=1 post this value
Comment 3 Andrew Bevitt 2005-01-03 01:46:06 UTC
Are you using koutput? Make sure you have no KBUILD* environment variables set if you arent. 

If you are not using kouput/kbuild then this has to be something to do with either your gcc path, gcc executable or CFLAGS...
Your cflags : CFLAGS="-march=pentium4 -O2 -fomit-frame-pointer -pipe"
my cflags : CFLAGS="-march=athlon64 -O2 -fomit-frame-pointer -pipe"

It works for me with gcc-3.4.3 so maybe try -march=pentium3 ... not really sure.
Comment 4 Jan Callewaert 2005-01-03 02:12:57 UTC
I have never used koutput (not as far as I know), so I don't think that's the problem. I have this problem for gcc-3.3.4 and gcc-3.4.3

I have tried to emerge with empty CFLAGS, but the problem stays. I find it hard to believe that this is caused by gcc, ... since it occurs for both 3.3.4 and 3.4.3. I did however had a problem with gcc that emerged all my executables with i686-pc-gnu-linux in front of them with gcc-3.4.3, but that problem is fixed and didn't occur with 3.3.4.
Comment 5 Jan Callewaert 2005-01-04 02:05:32 UTC
The problem seems to be the kernel. I can compile everything fine with kernel-2.6.9-r9 but it fails with 2.6.9-r13. I did a make mrproper and recompiled everything from scratch, to no avail. That counts for both 1.0.6111-r3 and 1.0.6629-r1. The version of gcc has nothing to do with it. 
Comment 6 Andrew Bevitt 2005-01-04 02:22:37 UTC
Hmm... Well personally if it only happens with r13 and since there are 2.6.10 and other 2.6.9 kernels available im not going to worry about it ... If you have a reason that you MUST use 2.6.9-gentoo-r13 then reopen this.
Comment 7 Jan Callewaert 2005-01-04 03:11:50 UTC
I tried gentoo-dev-sources-2.6.10-r2 and it still gives me the same error. I have reapplied the patch, and the message is the same.
Comment 8 Andrew Bevitt 2005-01-08 06:30:21 UTC
Somewhere im pretty sure I saw johnm talk about gentoo-dev-sources being a little bit wrong or difficult for linux-* eclasses, can you try a different kernel source?
Comment 9 Jan Callewaert 2005-01-09 08:36:53 UTC
I fetched the sources from kernel.org en tried it. Same thing. The strange thing is I cannot compile them anymore with the kernel I compiled them the lat time successfully. There must have changed something on my system that causes this. If only I would know what.
Comment 10 Fernando Tarlá Cardoso Lemos 2005-01-10 12:51:18 UTC
It doesn't work here either. I don't have portage info in hands, but I'd like to add that both 6111 and 6629 gives me that error message. Kernel 2.6.10-r4. I'm going to downgrade it to 2.6.9.
Comment 11 Fernando Tarlá Cardoso Lemos 2005-01-10 14:13:21 UTC
Nevermind. I just noticed that nvidia-kernel didn't compile because i didn't have a cc link to gcc.
Comment 12 Jan Callewaert 2005-01-11 02:43:40 UTC
I have tried to install the nvidia driver without the ebuild, and what I get is permission denied:

# sh NVIDIA-Linux-x86-1.0-6629-pkg1.run
Verifying archive integrity... OK
Uncompressing NVIDIA Accelerated Graphics Driver for Linux-x86 1.0-6629.........................................................................................................................................................................................................
NVIDIA-Linux-x86-1.0-6629-pkg1.run: line 754: ./nvidia-installer: Permission denied

Maybe this has something to do with it, or is this another thing?

I am right know recompiling my entire system, to see if that helps. Maybe adding that I also have problems with kde apps crashing all the time, which made me switch to gnome for the moment.
Comment 13 Jan Callewaert 2005-01-13 01:55:54 UTC
Having recompiled my entire system, the problem persists. It seems to me that this problem is related to the kernel and not to nvidia-kernel. If I try to emerge another ebuild that builds a module, this fails to:

# ACCEPT_KEYWORDS="~x86" emerge madwifi-driver
Calculating dependencies ...done!
>>> emerge (1 of 1) net-wireless/madwifi-driver-0.1_pre20050107 to /
>>> md5 src_uri ;-) madwifi-cvs-snapshot-2005-01-07.tar.bz2
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     2.6.10-gentoo-r4
 * Using KV_OBJ=ko
x86
>>> Unpacking source...
>>> Unpacking madwifi-cvs-snapshot-2005-01-07.tar.bz2 to /var/tmp/portage/madwifi-driver-0.1_pre20050107/work
 * Converting madwifi/ath/Makefile to use M= instead of SUBDIRS=...                                                  [ ok ]
 * Converting madwifi/ath_hal/Makefile to use M= instead of SUBDIRS=...                                              [ ok ]
 * Converting madwifi/ath_rate/amrr/Makefile to use M= instead of SUBDIRS=...                                        [ ok ]
 * Converting madwifi/ath_rate/onoe/Makefile to use M= instead of SUBDIRS=...                                        [ ok ]
 * Converting madwifi/net80211/Makefile to use M= instead of SUBDIRS=...                                             [ ok ]
>>> Source unpacked.
 * Preparing ath_hal module
cp ./../hal/linux/ah_osdep.c ah_osdep.c
uudecode ./../hal/linux/i386-elf.hal.o.uu
cp ./../hal/linux/i386-elf.opt_ah.h opt_ah.h
make -C //usr/src/linux M=/var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal MODVERDIR=/var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/../symbols modules
make[1]: Entering directory `/usr/src/linux-2.6.10-gentoo-r4'
Makefile:484: .config: Permission denied
Makefile:1235: ..tmp_kallsyms1.o.cmd: Permission denied
Makefile:1235: ..tmp_kallsyms2.o.cmd: Permission denied
Makefile:1235: .config.cmd: Permission denied
  CC [M]  /var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/ah_osdep.o
In file included from include/asm/page.h:15,
                 from /var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/../include/compat.h:71,
                 from <command line>:6:
include/linux/config.h:4:28: warning: include/linux/autoconf.h: Permission denied
include/linux/config.h:4:28: linux/autoconf.h: No such file or directory
/var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/ah_osdep.c:45:27: warning: include/linux/version.h: Permission denied
/var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/ah_osdep.c:45:27: linux/version.h: No such file or directory
In file included from include/asm/thread_info.h:17,
                 from include/linux/thread_info.h:21,
                 from include/linux/spinlock.h:12,
                 from include/linux/capability.h:45,
                 from include/linux/sched.h:7,
                 from include/linux/module.h:10,
                 from /var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/ah_osdep.c:46:
include/asm/processor.h:68: error: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (not in a function)
include/asm/processor.h:68: error: requested alignment is not a constant
In file included from include/linux/module.h:23,
                 from /var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/ah_osdep.c:46:
include/asm/module.h:56:2: #error unknown processor family
make[2]: *** [/var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal/ah_osdep.o] Error 1
make[1]: *** [_module_/var/tmp/portage/madwifi-driver-0.1_pre20050107/work/madwifi/ath_hal] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.10-gentoo-r4'
make: *** [all] Error 2

!!! ERROR: net-wireless/madwifi-driver-0.1_pre20050107 failed.
!!! Function linux-mod_src_compile, Line 284, Exitcode 2
!!! Unable to make KERNELPATH=//usr/src/linux KERNELRELEASE=2.6.10-gentoo-r4 TARGET=i386-elf TOOLPREFIX=/usr/bin/ all.
!!! If you need support, post the topmost build error, NOT this status message.

Any tips to resolve this, because I really would like this to work.
Comment 14 John Mylchreest (RETIRED) gentoo-dev 2005-01-16 08:15:49 UTC
looks to me like the build isnt using SRCDIR

make[1]: Entering directory `/usr/src/linux-2.6.10-gentoo-r4'
Makefile:484: .config: Permission denied
Makefile:1235: ..tmp_kallsyms1.o.cmd: Permission denied
Makefile:1235: ..tmp_kallsyms2.o.cmd: Permission denied
Makefile:1235: .config.cmd: Permission denied

however, works for me.
Do you ever come on IRC?
if so, can you come to freenode, channel #gentoo-dev and msg me. (johnm)
Comment 15 Jan Callewaert 2005-01-18 03:12:11 UTC
We fixed it by removing all linux folders in /usr/src:
rm -Rf /usr/src/linux*
and reemerging gentoo-dev-sources. So closing this bug.