<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>179739</bug_id>
          
          <creation_ts>2007-05-25 12:06 0000</creation_ts>
          <short_desc>sys-kernel/genkernel does not recognize kernel config change when using --kernel-config</short_desc>
          <delta_ts>2007-08-28 19:42:51 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Hosted Projects</product>
          <component>genkernel</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>gentoo@patdouble.com</reporter>
          <assigned_to>genkernel@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-05-25 12:06:03 0000</bug_when>
            <thetext>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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-04 14:02:38 0000</bug_when>
            <thetext>It looks like this bug is actually in genkernel. I am seeing it when using catalyst though. My machine doesn&apos;t use cache when building the kernel so I cannot comment on that setup.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>agaffney@gentoo.org</who>
            <bug_when>2007-06-04 14:26:06 0000</bug_when>
            <thetext>Please verify whether this is genkernel or catalyst&apos;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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-04 15:15:57 0000</bug_when>
            <thetext>I&apos;ll change summary back to catalyst until I can verify what&apos;s really going on
here</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-05 16:25:39 0000</bug_when>
            <thetext>I added a patch to display the md5sum and head of the kernel configs when genkernel checks if the cache is valid. Here&apos;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&apos;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&apos;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&apos;t edit
# Linux kernel version: 2.6.20-gentoo-r8
#
#


I&apos;m not sure what&apos;s happening here. Either genkernel is not checking the right file, or catalyst is putting the config in the wrong, or whatever, I don&apos;t really know. But I do know if I clear the kernel cache the new kernel does use the correct config.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-05 19:11:21 0000</bug_when>
            <thetext>Perhaps this code in /usr/share/genkernel/gen_configkernel.sh

        # If we&apos;re not cleaning, then we don&apos;t want to try to overwrite the configs there
        # or we might remove configurations someone is trying to test.

        if isTrue &quot;${CLEAN}&quot;
        then
                print_info 1 &quot;config: Using config from ${KERNEL_CONFIG}&quot;
                print_info 1 &apos;        Previous config backed up to .config.bak&apos;
                cp &quot;${KERNEL_CONFIG}&quot; &quot;${KERNEL_DIR}/.config&quot; || gen_die &apos;Could not copy configuration file!&apos;
        fi


That seems to prevent the kernel specified on the command line from being used if we&apos;re not cleaning. However, if --clean is given then will the cache be used at all??</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-05 19:37:42 0000</bug_when>
            <thetext>Unless I&apos;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 &quot;--kernel-config&quot;. 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</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-05 19:40:13 0000</bug_when>
            <thetext>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 &quot;${KERNCACHE}&quot; ]
                then
+                       KERNEL_CONFIG=&quot;/${KERNEL_DIR}/.config&quot;
+                       if [ &quot;${CMD_KERNEL_CONFIG}&quot; != &apos;&apos; ]
+                       then
+                               KERNEL_CONFIG=&quot;${CMD_KERNEL_CONFIG}&quot;
+                       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 &quot; &quot; -f 1)
-                               test2=$(md5sum /${KERNEL_DIR}/.config | cut -d &quot; &quot; -f 1)
+                               test2=$(md5sum ${CMD_KERNEL_CONFIG} | cut -d &quot; &quot; -f 1)
                                if [ &quot;${test1}&quot; == &quot;${test2}&quot; ]
                                then
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-06 18:00:02 0000</bug_when>
            <thetext>Created an attachment (id=121340)
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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-07 15:50:02 0000</bug_when>
            <thetext>Created an attachment (id=121415)
gen_package.patch

Replaces previously bad patch that used the wrong env var for the new kernel config.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2007-06-23 14:04:48 0000</bug_when>
            <thetext>Most of the caching code was written before my time as genkernel maintainer, so I&apos;m not very familiar with it.  I honestly don&apos;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 &quot;semi-vacation&quot; 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&apos;d trust you on this and just don&apos;t have the time to spend for a still indeterminate amount of time to test this.  Knowing you&apos;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.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-06-23 14:11:33 0000</bug_when>
            <thetext>Yes, I&apos;d be happy to test it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>agaffney@gentoo.org</who>
            <bug_when>2007-07-26 02:53:17 0000</bug_when>
            <thetext>This patch looks simple and relatively harmless. In SVN!</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>wolf31o2@gentoo.org</who>
            <bug_when>2007-08-22 19:54:09 0000</bug_when>
            <thetext>Please test genkernel 3.4.9_prer1 or better.  This should be fixed now.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gentoo@patdouble.com</who>
            <bug_when>2007-08-28 19:42:51 0000</bug_when>
            <thetext>Works for me. Thanks.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>121340</attachid>
            <date>2007-06-06 18:00 0000</date>
            <desc>patch for gen_package.sh</desc>
            <filename>gen_package.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IGdlbl9wYWNrYWdlLnNoCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGdlbl9wYWNrYWdlLnNoCShyZXZp
c2lvbiA1MDgpCisrKyBnZW5fcGFja2FnZS5zaAkod29ya2luZyBjb3B5KQpAQCAtMTUwLDEyICsx
NTAsMTggQEAKICAgICAgICAgZWxzZQogCQlpZiBbIC1lICIke0tFUk5DQUNIRX0iIF0gCiAJCXRo
ZW4KKwkJCUtFUk5FTF9DT05GSUc9Ii8ke0tFUk5FTF9ESVJ9Ly5jb25maWciCisJCQlpZiBbICIk
e0NNRF9LRVJORUxfQ09ORklHfSIgIT0gJycgXQorCQkJdGhlbgorCQkJCUtFUk5FTF9DT05GSUc9
IiR7Q01EX0tFUk5FTF9DT05GSUd9IgorCQkJZmkKKwogCQkJL2Jpbi90YXIgLXhqIC1mICR7S0VS
TkNBQ0hFfSAtQyAke1RFTVB9Ci0JCQlpZiBbIC1lICR7VEVNUH0vY29uZmlnLSR7QVJDSH0tJHtL
Vn0gLWEgLWUgLyR7S0VSTkVMX0RJUn0vLmNvbmZpZyBdCisJCQlpZiBbIC1lICR7VEVNUH0vY29u
ZmlnLSR7QVJDSH0tJHtLVn0gLWEgLWUgJHtDTURfS0VSTkVMX0NPTkZJR30gXQogCQkJdGhlbgog
CQotCQkJCXRlc3QxPSQobWQ1c3VtICR7VEVNUH0vY29uZmlnLSR7QVJDSH0tJHtLVn0gfCBjdXQg
LWQgIiAiIC1mIDEpCi0JCQkJdGVzdDI9JChtZDVzdW0gLyR7S0VSTkVMX0RJUn0vLmNvbmZpZyB8
IGN1dCAtZCAiICIgLWYgMSkKKwkJCQl0ZXN0MT0kKGdyZXAgLXYgIl4jIiAke1RFTVB9L2NvbmZp
Zy0ke0FSQ0h9LSR7S1Z9IHwgbWQ1c3VtIHwgY3V0IC1kICIgIiAtZiAxKQorCQkJCXRlc3QyPSQo
Z3JlcCAtdiAiXiMiICR7Q01EX0tFUk5FTF9DT05GSUd9IHwgbWQ1c3VtIHwgY3V0IC1kICIgIiAt
ZiAxKQogCQkJCWlmIFsgIiR7dGVzdDF9IiA9PSAiJHt0ZXN0Mn0iIF0KIAkJCQl0aGVuCiAJCg==
</data>        

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>121415</attachid>
            <date>2007-06-07 15:50 0000</date>
            <desc>gen_package.patch</desc>
            <filename>gen_package.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">SW5kZXg6IGdlbl9wYWNrYWdlLnNoCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGdlbl9wYWNrYWdlLnNoCShyZXZp
c2lvbiA1MDgpCisrKyBnZW5fcGFja2FnZS5zaAkod29ya2luZyBjb3B5KQpAQCAtMTUwLDEyICsx
NTAsMTggQEAKICAgICAgICAgZWxzZQogCQlpZiBbIC1lICIke0tFUk5DQUNIRX0iIF0gCiAJCXRo
ZW4KKwkJCUtFUk5FTF9DT05GSUc9Ii8ke0tFUk5FTF9ESVJ9Ly5jb25maWciCisJCQlpZiBbICIk
e0NNRF9LRVJORUxfQ09ORklHfSIgIT0gJycgXQorCQk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