Bug 197220

Summary: kernel-devel needs to make prepare for kernel modules building
Product: [Fedora] Fedora Reporter: sangu <sangu.fedora>
Component: kernelAssignee: Jon Masters <jcm>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: high    
Version: rawhideCC: andreas, ezannoni, oliva, wcohen, wtogami
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-04 02:13:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 201096    

Description sangu 2006-06-29 12:24:53 UTC
Description of problem:
$rpmbuild --rebuild --target i686 --define "kversion 2.6.17-1.2328.fc6" --define
"kvariants \""\" nvidia-kmod-1.0.8762-2.2.6.17_1.2307_FC6.src.rpm
[...]
+ make SYSSRC=/usr/src/kernels/2.6.17-1.2328.fc6-i686 module

NVIDIA: calling KBUILD...
make CC=cc  KBUILD_VERBOSE=1 -C /usr/src/kernels/2.6.17-1.2328.fc6-i686
SUBDIRS=/usr/src/redhat/BUILD/nvidia-kmod-1.0.8762/_kmod_build_/usr/src/nv modules
Makefile:452: *** kernel configuration not valid - run 'make prepare' in
/usr/src/kernels/2.6.17-1.2328.fc6-i686 to update it.  Stop.
NVIDIA: left KBUILD.
nvidia.ko failed to build!
make[1]: *** [mdl] Error 1
make: *** [module] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.24291 (%build)

but After doing make prepare in /usr/src/kernels/2.6.17-1.2328.fc6-i686, this
problem doesn't happen.

Version-Release number of selected component (if applicable):
2.6.17-1.2328.fc6

How reproducible:
always

Steps to Reproduce:
1. build kernel module package
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 William Cohen 2006-07-06 17:50:14 UTC
This problem also appears on x86_64 machine running the 2.6.17-1.2356.fc6. Can
demonstrate the problem with installing the appropriate kernel-debuginfo and
systemtap rpms, then run a very simple systemtap probe from the commandline:

# /usr/bin/stap -vv -e 'probe begin { log ("hello world") }'

End up getting the following when trying to compile the resulting C code of the
systemtap module:


Running make -C "/lib/modules/2.6.17-1.2356.fc6/build" M="/tmp/stapfSW0Zy"
modules V=1
make: Entering directory `/usr/src/kernels/2.6.17-1.2356.fc6-x86_64'
Makefile:452: *** kernel configuration not valid - run 'make prepare' in
/usr/src/kernels/2.6.17-1.2356.fc6-x86_64 to update it.  Stop.
make: Leaving directory `/usr/src/kernels/2.6.17-1.2356.fc6-x86_64'
Pass 4: compiled C into "stap_20491.ko" in 190usr/230sys/412real ms.
Pass 4: compilation failed.  Try again with more '-v' (verbose) options.
Running rm -rf /tmp/stapfSW0Zy




Comment 2 William Cohen 2006-07-11 14:40:46 UTC
Did some more searching to figure out what is going on. Newer kernel have the
following rule in the Makefile:

# If .config is newer than include/config/auto.conf, someone tinkered
# with it and forgot to run make oldconfig.
# if auto.conf.cmd is missing then we are probably in a cleaned tree so
# we execute the config step to be sure to catch updated Kconfig files
include/config/auto.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
ifeq ($(KBUILD_EXTMOD),)
	$(Q)$(MAKE) -f $(srctree)/Makefile silentoldconfig
else
	$(error kernel configuration not valid - run 'make prepare' in $(srctree) to
update it)
endif

The problem is the timestamps of the files for this rule:

$ ls -l include/config/auto.conf .config include/config/auto.conf.cmd
-rw-r--r-- 1 root root 61870 Jul  7 04:18 .config
-rw-r--r-- 1 root root 43721 Jul  7 03:59 include/config/auto.conf
-rw-r--r-- 1 root root  6923 Jul  7 03:59 include/config/auto.conf.cmd

I was able to do the following in the /usr/src/kernel/2.6.17-1.2358.fc6-x86_64
directory and this cleared up the problem:

 touch include/config/auto.conf


Comment 3 Andreas Thienemann 2006-07-18 15:51:53 UTC
touching include/config/auto.conf makes the "make prepare" message go away alright.
However, depending on the kernel module I'm trying to build I'm quite often
seeing the following message:

 /bin/sh: line 1: 12162 Floating point exceptionscripts/basic/fixdep
/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_/.i4l_idi.o.d
/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_/i4l_idi.o 'gcc
-m32
-Wp,-MD,/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_/.i4l_idi.o.d
 -nostdinc -isystem /usr/lib/gcc/i386-redhat-linux/4.1.1/include -D__KERNEL__
-Iinclude  -include include/linux/autoconf.h -Wall -Wundef -Wstrict-prototypes
-Wno-trigraphs -fno-strict-aliasing -fno-common -Wstrict-prototypes -Wundef
-Werror-implicit-function-declaration  -Os -fno-omit-frame-pointer
-fno-optimize-sibling-calls -fasynchronous-unwind-tables -g -pipe -msoft-float
-fno-builtin-sprintf -fno-builtin-log2 -fno-builtin-puts 
-mpreferred-stack-boundary=2  -march=i586 -mtune=generic -mregparm=3
-ffreestanding -Iinclude/asm-i386/mach-default -Wdeclaration-after-statement
-Wno-pointer-sign   -DMODULE -D"KBUILD_STR(s)=\#s"
-D"KBUILD_BASENAME=KBUILD_STR(i4l_idi)"  -D"KBUILD_MODNAME=KBUILD_STR(diva2i4l)"
-c -o
/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_/.tmp_i4l_idi.o
/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_/i4l_idi.c'
>/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_/.i4l_idi.o.tmp
make[1]: ***
[/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_/i4l_idi.o]
Error 136
make: ***
[_module_/home/andreas/fedora/redhat/BUILD/diva2i4l-kmod-1.0/_kmod_build_] Error 2
make: Leaving directory `/usr/src/kernels/2.6.17-1.2405.fc6-i586'
error: Bad exit status from /var/tmp/rpm-tmp.78057 (%build)


I'm wondering if this is related to the changed makefile.

Comment 4 Elena Zannoni 2006-08-01 15:49:16 UTC
Any news on this bug? Is it fixed in rawhide yet?


Comment 5 Jon Masters 2006-08-03 07:39:07 UTC
You can't just touch include/config/auto.conf because that file isn't a current
copy of the .config - so building modules might well go awry.

I just committed a fix which copies the .config file into
include/config/auto.conf instead - that way they really are both the same.
Hopefully this fixes the issue and we can avoid a call to make prepare in the
spec file (that breaks some of the custom links setup for powerpc arches).

Jon.

Comment 6 Jon Masters 2006-08-04 02:13:50 UTC
I'm going to go ahead and close this BZ now since the test kernel I built
earlier (2.6.17-1.2517) works for me now - if necessary it can be reopened again
later.