Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55080 - SvgaLib does not compile kernel module if kernel is built outside the kernel tree
Summary: SvgaLib does not compile kernel module if kernel is built outside the kernel ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: x86-kernel@gentoo.org (DEPRECATED)
URL:
Whiteboard:
Keywords:
: 55079 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-06-24 13:44 UTC by Paolo Pedroni
Modified: 2004-10-06 15:35 UTC (History)
1 user (show)

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 Paolo Pedroni 2004-06-24 13:44:04 UTC
When emerging svgalib-1.9.19, if the kernel has been built outside the kernel tree (config-kernel --make-koutput=[whatever]), the kernel module is not built.

Reproducible: Always
Steps to Reproduce:
1. config-kernel --make-koutput=2.6.7-gentoo-r5
2. make bzImage && make modules && make modules_install
3. emerge svgalib

Actual Results:  
The libraries are compiled and installed as usual, but the kernel module is 
neither compiled nor installed. This is due to fact that the ebuild looks for 
the .config file in /usr/src/linux to detrmine if the kernel has modules 
enabled, but if the kernel is built outside the kernel tree, the file is not 
there but in /var/tmp/kernel-output/2.6.x-whatever-ry. 

Expected Results:  
It should have checked whether the kernel was built in the source tree or 
outside it and look for the .config file in the proper place. 

Portage 2.0.50-r8 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 
2.6.7-gentoo-r5) 
================================================================= 
System uname: 2.6.7-gentoo-r5 i686 AMD Athlon(tm) XP 3200+ 
Gentoo Base System version 1.4.16 
ccache version 2.3 [enabled] 
Autoconf: sys-devel/autoconf-2.59-r3 
Automake: sys-devel/automake-1.8.3 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-march=athlon-xp -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 /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=athlon-xp -O3 -pipe -fomit-frame-pointer" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs ccache sandbox" 
GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo 
http://gentoo.inode.at/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo 
http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ 
ftp://gentoo.inode.at/source/" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage" 
USE="3dnow X Xaw3d aalib acpi alsa arts avi berkdb bindist bonobo cdr crypt 
cups curl dga divx4linux doc dvd encode esd evo foomaticdb gb gd gdbm gif 
gnome gpm gtk gtk2 gtkhtml imlib ipv6 java joystick jpeg kde libg++ libwww mad 
maildir mbox mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl oss 
pam pdflib perl png python qt quicktime readline scanner sdl slang spell sse 
ssl svga tcltk tcpd tetex threads tiff truetype unicode usb videos wmf x86 
xml2 xmms xosd xv xvid zlib"
Comment 1 Paolo Pedroni 2004-06-24 13:44:22 UTC
Portage 2.0.50-r8 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-gentoo-r5)
=================================================================
System uname: 2.6.7-gentoo-r5 i686 AMD Athlon(tm) XP 3200+
Gentoo Base System version 1.4.16
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -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 /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=athlon-xp -O3 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://gentoo.inode.at/ http://mirrors.sec.informatik.tu-darmstadt.de/gentoo http://www.die.unipd.it/pub/Linux/distributions/gentoo-sources/ ftp://gentoo.inode.at/source/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow X Xaw3d aalib acpi alsa arts avi berkdb bindist bonobo cdr crypt cups curl dga divx4linux doc dvd encode esd evo foomaticdb gb gd gdbm gif gnome gpm gtk gtk2 gtkhtml imlib ipv6 java joystick jpeg kde libg++ libwww mad maildir mbox mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl oss pam pdflib perl png python qt quicktime readline scanner sdl slang spell sse ssl svga tcltk tcpd tetex threads tiff truetype unicode usb videos wmf x86 xml2 xmms xosd xv xvid zlib"
Comment 2 Paolo Pedroni 2004-06-24 13:45:36 UTC
*** Bug 55079 has been marked as a duplicate of this bug. ***
Comment 3 SpanKY gentoo-dev 2004-06-24 16:15:32 UTC
i'm not about to go changing anything in svgalib to support this

i'll leave the kernel team to tackle this since i dont care to
Comment 4 Paolo Pedroni 2004-06-25 03:57:11 UTC
Why not? It should be nothing more than a few lines in the ebuild. I've never written an ebuild, and I'm at work with a WinXP system (so no diffs), but if you rewrite the kernel_supports_modules() function as:

kernel_supports_modules() {
	grep '^CONFIG_MODULES=y$' /usr/src/linux/.config || grep \ '^CONFIG_MODULES=y$' $KBUILD_OUTPUT/$KV/.config >& /dev/null
}

it /should/ work (haven't tried it yet, though).
Comment 5 Paolo Pedroni 2004-06-25 11:17:57 UTC
Make that $KBUILD_OUTPUT in the last comment $KBUILD_OUTPUT_PREFIX
Comment 6 Elan Ruusamäe 2004-07-14 17:00:13 UTC
make symlink /usr/src/linux point to /var/tmp/kernel-output/2.6.x-whatever?
Comment 7 .:deadhead:. 2004-07-20 08:46:18 UTC
>>> emerge (2 of 5) media-libs/svgalib-1.9.19 to /
>>> md5 src_uri ;-) svgalib-1.9.19.tar.gz
 *
 * Could not determine your kernel version.
 * Make sure that you have /usr/src/linux symlink.
 * And that said kernel has been configured.
 * You can also simply run the following command
 * in the kernel referenced by /usr/src/linux:
 *  make include/linux/version.h
 *

!!! ERROR: media-libs/svgalib-1.9.19 failed.
!!! Function check_KV, Line 253, Exitcode 0
!!! (no error message)

emerge --info
Portage 2.0.50-r9 (default-x86-2004.2, gcc-3.3.3, glibc-2.3.3.20040420-r0, 2.6.7-gentoo-r9)
=================================================================
System uname: 2.6.7-gentoo-r9 i686 Intel(R) Pentium(R) M processor 1400MHz
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="-O3 -march=pentium4 -pipe -funroll-loops -ffast-math -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr"
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/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O3 -march=pentium4 -pipe -funroll-loops -ffast-math -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="ftp://ftp.easynet.nl/mirror/gentoo/ ftp://gd.tuwien.ac.at/opsys/linux/gentoo/ ftp://mirror.switch.ch/mirror/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"
USE="X aac aalib acpi acpi4linux alsa arts avi bonobo cdr crypt cups curl dga dvd encode esd fbcon foomatic foomaticdb ggi gif gphoto2 gpm gtk gtk2 gtkhtml icc imagemagick imlib java javascript jpeg kde lcms libg++ libwww linguas_it lirc mad mbox mikmod mmx motif mozilla mpeg ncurses nls oggvorbis opengl oss pam pcmcia pdflib perl png pnp ppds python pyton qt quicktime readline sdl slang spell sse ssl svga tcltk tcpd tiff truetype unicode usb videos wmf wxwindows x86 xml xml2 xmms xosd xv xvid zlib"
Comment 8 .:deadhead:. 2004-07-22 02:35:28 UTC
As written in other BUG reports about svgalib, I solved my problem giving /USE=build/ Honestly now I'm curious to understand why now it works...
Comment 9 Daniel Drake (RETIRED) gentoo-dev 2004-09-27 13:10:14 UTC
Spanky, please look at comments #4 and #5 - probably the best way to examine a kernel .config is to look in $KBUILD_OUTPUT_PREFIX if non-null and the directory exists, and if not, fall back to /usr/src/linux

By the way, a better way might be to check for the presence of /proc/modules as I guess this won't exist if the kernel doesn't support loading modules (but please check this!)
Comment 10 SpanKY gentoo-dev 2004-09-27 13:23:11 UTC
since more than just svgalib will care about checking for kernel features via .config, here's how the 'fix' is going to happen ...

someone from the kernel config team will add a function or two to one of the kernel eclasses ... then they'll tell me what that function is and i'll have svgalib use it

suggested functions:
kernel_supports_modules()
kernel_supports_feature([kernel feature to look for])
Comment 11 SpanKY gentoo-dev 2004-09-27 19:36:18 UTC
oops, i forgot to re-assign to the kernel team

kernel guys: please review comment #10
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2004-10-06 14:32:00 UTC
Since this bug was opened, it has been said that config-kernel and kouput is not ready for use yet so we don't support it. But, good call on the config parsing / module check idea, I've now implemented this.

inherit kernel-mod
And check the return value of kernel-mod_modules_supported 
Comment 13 Daniel Drake (RETIRED) gentoo-dev 2004-10-06 14:54:56 UTC
Further simplification, no need to check return value of that, just include a call to "kernel-mod_check_modules_supported"
Comment 14 SpanKY gentoo-dev 2004-10-06 15:35:58 UTC
thanks guys, fixed svgalib in cvs to use the new kernel-mod function