When you try to emerge it with a badly set /usr/src/linux (mine was to an older kernel), you get this: * * The kernel Makefile says that this is a .. kernel * but the source is in a directory for a 2.6.7 kernel. * * This goes against the recommended Gentoo naming convention. * Please rename your source directory to 'linux-..' * /usr/sbin/ebuild.sh: line 157: [: : integer expression expected * Building for Linux .. found in /usr/src/linux * /usr/src/linux is a symbolic link * Determining the real directory of the Linux kernel source code grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory * * The kernel Makefile says that this is a .. kernel * but the source is in a directory for a 2.6.7 kernel. * * This goes against the recommended Gentoo naming convention. * Please rename your source directory to 'linux-..' * Over and over and over till you go mental and hit the Ctrl+C Reproducible: Always Steps to Reproduce: 1.set up ur /usr/src/linux to a bad place.. linux -> linux-2.6.7 is mine, and that target directory doesn't exist 2. ebuild kdrive Actual Results: * * The kernel Makefile says that this is a .. kernel * but the source is in a directory for a 2.6.7 kernel. * * This goes against the recommended Gentoo naming convention. * Please rename your source directory to 'linux-..' * /usr/sbin/ebuild.sh: line 157: [: : integer expression expected * Building for Linux .. found in /usr/src/linux * /usr/src/linux is a symbolic link * Determining the real directory of the Linux kernel source code grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory grep: //usr/src/linux/Makefile: No such file or directory * * The kernel Makefile says that this is a .. kernel * but the source is in a directory for a 2.6.7 kernel. * * This goes against the recommended Gentoo naming convention. * Please rename your source directory to 'linux-..' * over and over and over Expected Results: Preferably, it should have installed Portage 2.0.50-r9 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.8-rc1) ================================================================= System uname: 2.6.8-rc1 i686 Pentium III (Coppermine) Gentoo Base System version 1.4.16 Autoconf: sys-devel/autoconf-2.59-r3 Automake: sys-devel/automake-1.8.3 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" COMPILER="gcc3" CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-march=pentium3 -O3 -pipe -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoaddcvs ccache sandbox" GENTOO_MIRRORS="ftp:///ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/ ftp://mirror.pacific.net.au/linux/Gentoo http://gentoo.gg3.net/ http://mirror.gentoo.gr.jp http://ftp.ntua.gr/pub/linux/gentoo/" MAKEOPTS="-j2" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/bmg-main" SYNC="rsync://rsync.au.gentoo.org/gentoo-portage" USE="X aac acpi alsa apm arts avi berkdb cap chroot clanJavaScript crypt cscope cups curl dga distribution divx4linux dnd dumb-allegro encode esd faac flac flash foomaticdb gdbm gif gimpprint glade gnome gphoto2 gpm gstreamer gtk gtk2 gtkhtml imagemagick imlib ipv6 jabber java javascript jpeg kde libg++ libwww mad mikmod mmx mng mono mozilla moznocompose moznoirc moznomail mozp3p mozsvg mpeg mpeg4 msn ncurses net nls offensive oggvorbis openal opengl oss pam pcap pcmcia pcre pdflib perl png pthreads python qt quicktime readline sdl slang spell sse ssl svg svga tcpd theora tiff truetype usb x86 xml2 xmms xrandr xv yahoo zlib"
What kernel version did you have the symlink set to? Does /usr/src/<kernel-tree>/Makefile exist? You should have the symlink setup properly, it is assumed for some ebuilds, however I dont like the fact that it did not work out your kernel properly so the answers to the above questions would be nice :)
I'll do an example of my symlink cd /usr/src mkdir delete-me ln -s delete-me linux rm -rf delete-me /usr/src/linux is left as a dangling pointer.. A more realistic scenerio would be a case where the user updates his kernel, wants to save memory so deletes his old kernel source, and forgets to update /usr/src/linux to point to the new directory. its not really a critical bug anyway.. Just if someone does emerge kdrive 1>>log 2>>log; halt; or something like that, they will wake up and find their harddisk full, probably shut down too because they are out of harddisk, and have problems starting back up. I'm just proposing its fixed to prevent cases like that (it would probably fail anyway). This bug only happens when the user screwed up anyway. It might be a good thing to use /lib/modules/`uname -r`/build instead of /usr/src/linux for starters, because that means that it doesn't run into problems if the kernel source exists, but the /usr/src/linux pointer is set to a removed directory. If the source doesn't exist though, then the ebuild should just bomb out with an error, instead of looping until the user kills it.
Nah, uname -r locks you into the running kernel. The whole point of using /usr/src/linux is to allow building modules for non-running kernels.
Created attachment 35477 [details, diff] suggested ebuild patch Spyderous: will this break the livecd ??? Patch checks wether /usr/src/linux/Makefile exists, dies if it doesn't -- which is certainly kernel compatible.
Frankly is_kernel() should be catching this. That's where a change will be needed. See this in xfree.eclass (I don't know why it doesn't seem to be working): check_version_h() { if [ ! -f "${ROOT}/usr/src/linux/include/linux/version.h" ] then eerror "Please verify that your /usr/src/linux symlink is pointing" eerror "to your current kernel sources, and that you did run:" eerror eerror " # make dep" die "/usr/src/linux symlink not setup!" fi }
Fixed in cvs, the new linux-info eclass took care of it.