Bug 179739 - sys-kernel/genkernel does not recognize kernel config change when using --kernel-config
|
Bug#:
179739
|
Product: Gentoo Hosted Projects
|
Version: unspecified
|
Platform: All
|
|
OS/Version: Linux
|
Status: RESOLVED
|
Severity: normal
|
Priority: P2
|
|
Resolution: FIXED
|
Assigned To: genkernel@gentoo.org
|
Reported By: gentoo@patdouble.com
|
|
Component: genkernel
|
|
|
URL:
|
|
Summary: sys-kernel/genkernel does not recognize kernel config change when using --kernel-config
|
|
Keywords:
|
|
Status Whiteboard:
|
|
Opened: 2007-05-25 12:06 0000
|
catalyst 2.0.4 does not recognize kernel config change. I have already built a
livecd-stage2 and later modify my kernel config. When building livecd-stage2
again a message states that no kernel config change has been detected. If I
remove /var/tmp/catalyst/kerncache and build, the kernel indeed has my new
config.
Reproducible: Always
Steps to Reproduce:
1. build livecd-stage2
2. change kernel config
3. build livecd-stage2
4. notice kernel is not rebuilt
Actual Results:
Stale kernel cache is usage.
Expected Results:
Kernel should be rebuilt.
It looks like this bug is actually in genkernel. I am seeing it when using
catalyst though. My machine doesn't use cache when building the kernel so I
cannot comment on that setup.
Please verify whether this is genkernel or catalyst's fault. Run genkernel a
few times locally with the proper options for kerncache. That should tell you.
Also, we just need more information in general. There is very little here to go
on. It seems to work just fine for everyone else.
I'll change summary back to catalyst until I can verify what's really going on
here
I added a patch to display the md5sum and head of the kernel configs when
genkernel checks if the cache is valid. Here's what I get:
* Linux Kernel 2.6.20-gentoo-r8 for x86...
* WARNING: No mounted /boot partition detected!
* Run mount /boot to mount it!
* Kernel config
(/var/tmp/genkernel/30832.1015.13720.30639/config-x86-2.6.20-gentoo-r8) MD5:
a46b89c1bc1c38887562d6eef70954d8
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.20-gentoo-r8
# Sun Jun 3 19:43:54 2007
#
* Kernel cached (//usr/src/linux/.config) config MD5:
a46b89c1bc1c38887562d6eef70954d8
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.20-gentoo-r8
# Sun Jun 3 19:43:54 2007
#
* No kernel configuration change, skipping kernel build...
Yet my kernel config starts like (notice the date is missing, this is only for
testing and it looks from the code that comments are considered in the md5
sum):
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.20-gentoo-r8
#
#
I'm not sure what's happening here. Either genkernel is not checking the right
file, or catalyst is putting the config in the wrong, or whatever, I don't
really know. But I do know if I clear the kernel cache the new kernel does use
the correct config.
Perhaps this code in /usr/share/genkernel/gen_configkernel.sh
# If we're not cleaning, then we don't want to try to overwrite the
configs there
# or we might remove configurations someone is trying to test.
if isTrue "${CLEAN}"
then
print_info 1 "config: Using config from ${KERNEL_CONFIG}"
print_info 1 ' Previous config backed up to .config.bak'
cp "${KERNEL_CONFIG}" "${KERNEL_DIR}/.config" || gen_die 'Could
not copy configuration file!'
fi
That seems to prevent the kernel specified on the command line from being used
if we're not cleaning. However, if --clean is given then will the cache be used
at all??
Unless I'm really mistaken, this time I think it is genkernel. It appears it
does not detect kernel config changes correctly when the config is specified
using "--kernel-config". It always checks the .config in the kernel source
directory. The config check is done before config_kernel is called, so the
config file specified by --kernel-config is not copied to t
I cannot upload, bugzilla error, here is the patch:
Index: gen_package.sh
===================================================================
--- gen_package.sh (revision 508)
+++ gen_package.sh (working copy)
@@ -150,12 +150,18 @@
else
if [ -e "${KERNCACHE}" ]
then
+ KERNEL_CONFIG="/${KERNEL_DIR}/.config"
+ if [ "${CMD_KERNEL_CONFIG}" != '' ]
+ then
+ KERNEL_CONFIG="${CMD_KERNEL_CONFIG}"
+ fi
+
/bin/tar -xj -f ${KERNCACHE} -C ${TEMP}
- if [ -e ${TEMP}/config-${ARCH}-${KV} -a -e
/${KERNEL_DIR}/.config ]
+ if [ -e ${TEMP}/config-${ARCH}-${KV} -a -e
${CMD_KERNEL_CONFIG} ]
then
test1=$(md5sum ${TEMP}/config-${ARCH}-${KV} |
cut -d " " -f 1)
- test2=$(md5sum /${KERNEL_DIR}/.config | cut -d
" " -f 1)
+ test2=$(md5sum ${CMD_KERNEL_CONFIG} | cut -d "
" -f 1)
if [ "${test1}" == "${test2}" ]
then
Created an attachment (id=121340) [details]
patch for gen_package.sh
This patch ignores comments in the kernel config when doing the md5sum. I need
this as the config has the current date put into it which causes the cache to
also look invalid.
Most of the caching code was written before my time as genkernel maintainer, so
I'm not very familiar with it. I honestly don't know what it is supposed to do
and it would require me to get up-to-speed on that portion of the code. I am
working towards a 3.5 release for genkernel and would love to get this fixed
before then. Unfortunately, my time is still very scarce, due to my taking a
one-month "semi-vacation" from Gentoo where I was only working on the most
important of things and my workload piling up on me. If I were to roll up a
new genkernel version with your patch from current SVN, would you test it for
me and see if this problem is fixed?
I'd trust you on this and just don't have the time to spend for a still
indeterminate amount of time to test this. Knowing you've tested it (and maybe
someone else, if someone volunteers) and the problem is resolved will help me
out greatly and will allow me to focus on other bugs that will likely require
more of my direct energy.
Yes, I'd be happy to test it.
This patch looks simple and relatively harmless. In SVN!
Please test genkernel 3.4.9_prer1 or better. This should be fixed now.