Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 155332 - module-rebuild rebuilds for wrong kernel version
Summary: module-rebuild rebuilds for wrong kernel version
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-16 01:43 UTC by Paul Hewlett
Modified: 2006-11-21 02:32 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 Paul Hewlett 2006-11-16 01:43:47 UTC
When a new kernel is downloaded after an update, I rebuild the kernel by relinking the symbolic link /usr/src/linux and then executing 'genkernel --menuconfig all'. After this has finished I issue the command 'module-rebuild rebuild' to rebuild any modules (such as unionfs,fritzcapi etc) that exist outside the main kernel tree. The messages generated indicate that the module-rebuild' command has found '/usr/src/linux' and that it corresponds to '2.6.18-gentoo-r2'. However after compilation the log indicates that the newly built module is being built for the currently running kernel (e.g. 2.6.17-gentoo-r7) and not the new kernel. The messages are something like :

   cfgpro .../2.6.17-gentoo-r7/....

The workaround is to reboot into the new kernel before issuing the 'module-rebuild' command. This is less than  ideal because there may be modules required for a functioning boot and it also means an extra reboot.

emerge --info ==

Portage 2.1.1-r1 (default-linux/x86/2006.0, gcc-4.1.1, glibc-2.4-r4, 2.6.18-gentoo-r2 i686)
=================================================================
System uname: 2.6.18-gentoo-r2 i686 Intel(R) Celeron(R) CPU 2.53GHz
Gentoo Base System version 1.12.6
Last Sync: Tue, 14 Nov 2006 21:50:01 +0000
ccache version 2.3 [enabled]
app-admin/eselect-compiler: [Not Present]
dev-java/java-config: 1.3.7, 2.0.30
dev-lang/python:     2.4.3-r4
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     2.3
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.13, 2.60
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r3
sys-devel/gcc-config: 1.3.13-r4
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.17-r1
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/lib/fax /usr/share/X11/xkb /usr/share/config /var/bind /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks metadata-transfer parallel-fetch sandbox sfperms strict"
GENTOO_MIRRORS="http://mirror.datapipe.net/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo http://85.25.128.62"
MAKEOPTS="-j2"
PKGDIR="/usr/src/asterisk"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsyncproxy/gentoo-portage"
USE="x86 X alsa apache2 apm arts berkdb bitmap-fonts cgi cli cracklib crypt cups dlloader dri dvd eds elibc_glibc emboss encode esd foomaticdb fortran fritzcapi_cards_fcpci fritzcapi_cards_fcusb2 gdbm gif gpm gstreamer gtk2 iconv imlib input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 isdnlog jpeg kerberos kernel_linux libg++ libwww mad mbrola mikmod misdn_cards_avmfritz misdn_cards_hfcmulti misdn_cards_hfcpci misdn_cards_hfcsusb misdn_cards_sedlfax misdn_cards_w6692pci motif mp3 mpeg ncurses nls nptl nptlonly ogg opengl oss pam pcre perl png ppds pppd python qt3 qt4 quicktime readline reflection sdl session spell spl ssl tcpd truetype truetype-fonts type1-fonts udev userland_GNU video_cards_apm video_cards_ark video_cards_ati video_cards_chips video_cards_cirrus video_cards_cyrix video_cards_dummy video_cards_fbdev video_cards_glint video_cards_i128 video_cards_i740 video_cards_i810 video_cards_imstt video_cards_mga video_cards_neomagic video_cards_nsc video_cards_nv video_cards_rendition video_cards_s3 video_cards_s3virge video_cards_savage video_cards_siliconmotion video_cards_sis video_cards_sisusb video_cards_tdfx video_cards_tga video_cards_trident video_cards_tseng video_cards_v4l video_cards_vesa video_cards_vga video_cards_via video_cards_vmware video_cards_voodoo vorbis xml xorg xv zlib"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-11-16 01:55:50 UTC
Eh, post some complete merge output which makes you think that it builds for the old kernel. Because it definitely doesn't do any such thing here.

Comment 2 Bo Ørsted Andresen (RETIRED) gentoo-dev 2006-11-16 01:57:30 UTC
(In reply to comment #0)
>    cfgpro .../2.6.17-gentoo-r7/....

Actually those lines tell you that the old kernel modules for your running kernel won't be removed due to CONFIG_PROTECT.
Comment 3 Paul Hewlett 2006-11-21 02:32:36 UTC
(In reply to comment #1)
> Eh, post some complete merge output which makes you think that it builds for
> the old kernel. Because it definitely doesn't do any such thing here.
> 

OK I did it again on another machine (it took longer because KDE is broken requiring an unmerge and re-remerge ) and sure enough the bug has disappeared and you are right - it does not do it so I must have been seeing things. However after some thought I realised that the error occurred when emerging ndiswrapper. Inspection of the ndiswrapper make process reveals 2 bugs viz :

    - the Makefile gets the kernel version by `uname -r` so it will build for the wrong kernel if you are still running the old kernel before rebooting into the new kernel

    - as a side issue the logic to chjeck for CONFIG_4KSTACKS is broken - it always reports that the kernel is using 4KSTACKS even when CONFIG_4KSTACKS is not defined.

Do you want me to open a new bug for this ?