Since remerging the current kernel also does a complete clean all dependent packages fail to compile because the architecture link is missing. This causes an 'emerge -e world' to fail when reaching the first kernel dependent package. After compiling the kernel everthing works fine again. On my system several packages are affected e.g. pcmcia-cs Here is what pcmcia-cs throws: # emerge --oneshot sys-apps/pcmcia-cs Calculating dependencies ...done! >>> emerge (1 of 1) sys-apps/pcmcia-cs-3.2.8-r2 to / >>> md5 files ;-) pcmcia-cs-3.2.8-r2.ebuild >>> md5 files ;-) pcmcia-cs-3.2.7-r3.ebuild >>> md5 files ;-) pcmcia-cs-3.2.8.ebuild >>> md5 files ;-) files/pcmcia-cs-3.2.8-gcc4.patch >>> md5 files ;-) files/digest-pcmcia-cs-3.2.8-r2 >>> md5 files ;-) files/pcmcia-cs-3.2.8-CS_EVENT_RESET_COMPLETE.patch >>> md5 files ;-) files/ppc.config.opts >>> md5 files ;-) files/network >>> md5 files ;-) files/pcmcia.conf >>> md5 files ;-) files/pcmcia.rc >>> md5 files ;-) files/pcmcia-cs-3.2.7-move-pnp-ids-to-usr-share-misc.patch >>> md5 files ;-) files/pcmcia-cs-3.2.8-includes.patch >>> md5 files ;-) files/digest-pcmcia-cs-3.2.7-r3 >>> md5 files ;-) files/digest-pcmcia-cs-3.2.8 >>> md5 files ;-) files/pcmcia-cs-3.2.8-conf.d >>> md5 files ;-) files/pcmcia-cs-3.2.8-ldflags.patch >>> md5 files ;-) files/pcmcia-cs-3.2.8-init.d >>> md5 files ;-) files/pcmcia-cs-3.2.8-move-pnp-ids.patch >>> md5 files ;-) files/pcmcia-cs-3.2.8-ppc.config.opts >>> md5 files ;-) files/pcmcia-cs-3.2.8-network >>> md5 files ;-) files/pcmcia-cs-3.2.8-tools-only.patch >>> md5 files ;-) files/pcmcia-cs-3.2.8-x11.patch >>> md5 src_uri ;-) pcmcia-cs-3.2.8.tar.gz * Determining the location of the kernel source code * Found kernel source directory: * /usr/src/linux * Found sources for kernel version: * 2.6.11.11 * getfilevar requires 2 variables, with the second a valid file. * getfilevar <VARIABLE> <CONFIGFILE> * Could not find a usable .config in the kernel source directory. * Please ensure that /usr/src/linux points to a configured set of Linux sources. * If you are using KBUILD_OUTPUT, please set the environment var so that * it points to the necessary object directory so that it might find .config. !!! ERROR: sys-apps/pcmcia-cs-3.2.8-r2 failed. !!! Function linux-info_pkg_setup, Line 521, Exitcode 1 !!! Unable to calculate Linux Kernel version !!! If you need support, post the topmost build error, NOT this status message. Reproducible: Always Steps to Reproduce: 1.emerge --oneshot sys-kernel/vanilla-sources 2.emerge --oneshot sys-apps/pcmcia-cs Portage 2.0.51.22-r2 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.5-r0, 2.6.11.11 i686) ================================================================= System uname: 2.6.11.11 i686 Pentium III (Coppermine) Gentoo Base System version 1.6.13 distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled] dev-lang/python: 2.3.5 sys-apps/sandbox: 1.2.11 sys-devel/autoconf: 2.13, 2.59-r6 sys-devel/automake: 1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5 sys-devel/binutils: 2.15.92.0.2-r10 sys-devel/libtool: 1.5.18-r1 virtual/os-headers: 2.6.11-r2 ACCEPT_KEYWORDS="x86" AUTOCLEAN="yes" CBUILD="i686-pc-linux-gnu" CFLAGS="-O3 -march=pentium3 -fomit-frame-pointer" CHOST="i686-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /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/bind /var/qmail/control" CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d" CXXFLAGS="-O3 -march=pentium3 -fomit-frame-pointer" DISTDIR="/usr/portage/distfiles" FEATURES="autoconfig ccache distlocks sandbox sfperms strict" GENTOO_MIRRORS="http://pandemonium.tiscali.de/pub/gentoo/ ftp://pandemonium.tiscali.de/pub/gentoo/ http://gentoo.mirror.icd.hu/" LINGUAS="de us" PKGDIR="/usr/portage/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/usr/local/portage" SYNC="rsync://rsync.de.gentoo.org/gentoo-portage" USE="x86 X X509 Xaw3d a52 aac accessibility acl acpi alsa apache2 arts audiofile avi berkdb big-tables bitmap-fonts bonobo browserplugin bzip2 cairo cdparanoia cgi chroot clamav cpdflib cpudetection crypt cups curl dbm dbus divx4linux doc dts dv dvd dvdread eds emacs emboss encode esd expat fam fame ffmpeg firefox fits flac flash font-server foomaticdb fortran ftp gd gdbm gif gmp gnome gnutls gpm gstreamer gtk gtk2 gtkhtml guile gzip hpn icq id3 idn imagemagick imap imlib ipppd isdn java jbig jpeg kde kdeenablefinal lame latex lcms ldap leim libg++ libwww live lzo mad maildir mailwrapper matroska mhash mikmod milter mime ming mjpeg mmx mng motif mozdevelop mozilla moznocompose moznoirc moznomail mozsvg mp3 mp4live mpeg mpeg2 mplayer musicbrainz mysql mysqli ncurses network nls no-old-linux no_wxgtk1 nocardbus nsplugin nvidia objc ocaml octave ofx ogg oggvorbis openal openexr opengl osc oss pam pcmcia pcre pda pdf pdflib perl php player png posix povray ppds profile python qt quicktime readline real recode rtc ruby sasl scanner sdl seti sftplogging sharedmem shorten simplexml slp sndfile soap sockets sox spell spl sse ssl subp subtitles subversion svg svga szip tcltk tcpd tetex theora threads tidy tiff tokenizer transcode truetype truetype-fonts type1-fonts unicode usb utf8 v4l2 vcd vorbis win32codecs wmf wxwindows xanim xml xml2 xmlrpc xmms xpm xsl xv xvid yv12 zlib linguas_de linguas_us userland_GNU kernel_linux elibc_glibc" Unset: ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, MAKEOPTS
(In reply to comment #0) > * Could not find a usable .config in the kernel source directory. > * Please ensure that /usr/src/linux points to a configured set of Linux sources. Error message says everything. You have to configure your kernel first.
The error messages are there for a reason, they tell you how to solve it... This can't be compiled with an unconfigured kernel.
Sorry, the kernel was configured! The problem is, that the config file and the architecture link is removed during remerging of this kernel. So even with an configured kernel an 'emerge -e world' WILL NOT WORK! Ok, maybe this is not really a bug, but it is a not very handy way for the administrator. 'emerge -e world' is losing its right to exist since its not working anyway. I'm avoiding the problem by putting the output of 'emerge -ep world' into a file, changing each line to 'emerge --oneshot ...' and removing the kernel line. Then I've no problem. So, a possible solution would be to remove the kernel from world rebuild. But I'm not sure, if this would harm something else.
Why was mobile@ added to CC: on this (non-)bug?
Created attachment 65224 [details, diff] kernel-2.eclass.patch (In reply to comment #3) > Sorry, the kernel was configured! The problem is, that the config file and > the architecture link is removed during remerging of this kernel. > So even with an configured kernel an 'emerge -e world' WILL NOT WORK! Does the attached patch solve the problem?
Nearly! Only the architecture link is missing. So, on my system this whould be cd /usr/src/linux/include ln -s asm-i386 asm After that, everything is fine...
Created attachment 65250 [details, diff] kernel-2.eclass.patch (In reply to comment #6) > Only the architecture link is missing. Ok, should work now.
Confirmed! Works fine here. Thank you for fixing this fast!
Created attachment 65291 [details, diff] kernel-2.eclass.patch merging svgalib produced another problem: * These sources have not yet been prepared. * We cannot build against an unprepared tree. * To resolve this, please type the following: * * # cd /usr/src/linux * # make oldconfig * # make modules_prepare * * Then please try merging this module again. So, I did more changes to kernel-2.eclass which solved the problem on my system. Please check if this is ok for others. There is one more warning left but I don't know if this harms the system: * /usr/src/linux/System.map not found. * You must manually update the kernel module dependencies using depmod. [ !! ]
Created attachment 65392 [details, diff] kernel-2.eclass.patch (should work) (In reply to comment #9) Try the new version, should solve both problems.
For now, this is the best version. The depmod message is still there, but I think this is ok by now. Packages svgalib and nvidia-kernel are throwing this: * /usr/src/linux/System.map not found. * You must manually update the kernel module dependencies using depmod. [ !! ] I looked at the patch and found the following line that is probably false: local KV_DIR=${ROOT}/usr/src/linux-${KV_FULL} should look like this local KV_DIR=${ROOT}usr/src/linux-${KV_FULL} Correct me, if I'm wrong. Anyway, I'd like to suggest to put this version into CVS.
I just added myself to the bug, as I need to properly review what has been covered and it likely wont be tonight. at first glace I'm not convinced the eclass changes is the cause of your problem and although effective, not the best solution. I have never seen this before so bare with me. I'll take a good look some time over the next few days.
This whole "bug" is caused by people not compiling their new kernel after having upgraded a sys-kernel/*-sources package with USE="symlink". The correct "fix" for this "bug" would be for the end-user to configure and compile his/her new kernel before merging any dependent packages. I do not think the approach taken in the proposed patches is correct.
You might be right, but what are you doing with 'emerge -e world'? This command installs the kernel sources without compiling it and afterwards tries to install the dependent packages... I'm open to better solutions!
Why would you want to run `emerge -e world`?
Because it exists. And there are cases where it really makes sense to run it. E.g. to compile packages with newly installed libraries. I'm simply feeling better running it once a month or so. But most users may also feel good with running 'emerge -DuN world'... Anyway, as long as 'emerge -e world' is a legal command it should run properly.
(In reply to comment #13) > This whole "bug" is caused by people not compiling their new kernel after having > upgraded a sys-kernel/*-sources package with USE="symlink". > > The correct "fix" for this "bug" would be for the end-user to configure and > compile his/her new kernel before merging any dependent packages. With 'emerge -e world' it's very inconvenient - see comment #3. > I do not think the approach taken in the proposed patches is correct. make modules_prepare etc. stuff is used only when existing config for exact same package version is detected. This happens only when package is re-emerged. I don't see anything bad here.
Looking through the problem, and also taking on board a mention Dan (dsd) had about it... The problem is caused by the unmerge of the package when it runs a make mrproper, OR when the sources are installed (and upgraded) via USE="symlink" the USE="symlink" was actually put in place for some future automation, which may or may not happen anymore anyways. An option for this is to remove the make mrproper from the uninstall portion of the eclass (which dsd mentioned). The downside to this is that an unmerge wont remove all the files, and ytou will be left with cruft. (the reason it was added in the first place) The other option is to look at this patch as a work-around. The thing is, this really to me only is a work around. In all honesty, emerge -e world should really only be used when major changes are made, such as to glibc. Whenever libraries change which are not as important, I dont see the problem with running revdep-rebuild. Thats why it is there. To rebuild packages which have broken due to library ABI changes. Something which is possible is to look to change the logic so it doesnt remove cruft IF there is already a package of the same name/version installed. but I need to clarify if thats known or not by portage at the clean phase.
John, any update on this? Maybe it would be a good idea to revert the offending change while we figure out if anything can be done?
*** Bug 104359 has been marked as a duplicate of this bug. ***
In digging through a users log for this, I noticed a few things. First off, I can't find any indication this tells the user it's even doing this. Second, the make clean within the livefs is rather iffy from where I'm sitting. Third, I'm kind of curious why I can't duplicate nuking of the config. Either way, we've had people poking us asking why portage nuked their .config; first I've seen of this bug, but it explains the issue (since portage is incapable of it).
I've removed the call to `make mrproper` from kernel-2.eclass now.