<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>7441</bug_id>
          
          <creation_ts>2015-03-10 15:25:24 +0000</creation_ts>
          <short_desc>do_kernel_configme fails when patches create directories</short_desc>
          <delta_ts>2015-05-12 20:17:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>kernel</component>
          <version>1.7.1</version>
          <rep_platform>Other</rep_platform>
          <op_sys>arm</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>1.9</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeff Melville">dev</reporter>
          <assigned_to name="Bruce Ashfield">bruce.ashfield</assigned_to>
          <cc>bruce.ashfield</cc>
    
    <cc>dev</cc>
    
    <cc>tom.zanussi</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>49341</commentid>
    <comment_count>0</comment_count>
    <who name="Jeff Melville">dev</who>
    <bug_when>2015-03-10 15:25:24 +0000</bug_when>
    <thetext>Hardware: Zynq (via meta-xilinx)

I&apos;m using a Yocto flow to build for the Zynq with the meta-xilinx with
some customizations:
- I&apos;m using a bbappend to replace the linux-xlnx 3.14 kernel with one
that has had mainline changes from 3.14.17 merged in.
- I added a task between patch and configure for applying the Xenomai
kernel patches and running the Xenomai prepare_kernel script.

All layers are on the dizzy branch. The linux-xlnx recipe inherits
from linux-yocto but obtains the metadeta from an out of tree source
using a SRC_URI append with type=kmeta. This ends up getting copied
into the kernel tree with during the kernel_configme task. This is my
first time working with a kernel recipe in the linux-yocto style so
I&apos;m still coming up to speed a bit.

The problem arises because the Xenomai patch process creates
additional directories in the Linux tree. As part of the
kernel_configme task, the kgit-meta script will attempt to use the
last unversioned directory returned by &apos;git ls-files -o --directory&apos;
as the metadata directory, which does not work.

Maybe it is possible to update the directory detection logic in kgit-meta to look for another file within the candidate meta directory? I don&apos;t know enough about the general design to determine what should always be there.

Thanks,
Jeff


Build output (note, I removed information about a proprietary layer):

Build Configuration:
BB_VERSION        = &quot;1.24.0&quot;
BUILD_SYS         = &quot;x86_64-linux&quot;
NATIVELSBSTRING   = &quot;Ubuntu-14.04&quot;
TARGET_SYS        = &quot;arm-poky-linux-gnueabi&quot;
MACHINE           = &quot;zc706-zynq7&quot;
DISTRO            = &quot;poky&quot;
DISTRO_VERSION    = &quot;1.7.1&quot;
TUNE_FEATURES     = &quot; arm armv7a vfp neon zynq&quot;
TARGET_FPU        = &quot;vfp-neon&quot;
meta
meta-yocto
meta-yocto-bsp    = &quot;dizzy:6e9632e9798d78587c9317554c5547ab3b53837c&quot;
meta-oe
meta-networking
meta-python       = &quot;dizzy:853dcfa0d618dc26bd27b3a1b49494b98d6eee97&quot;
meta-xilinx       = &quot;dizzy:7f759048bb0aeef3c0b3938be81d2bcade7acb7e&quot;
meta-xenomai      = &quot;dizzy:8d070b7bb47e09616d07437cf0bd0ed0356b9d61&quot;


NOTE: Preparing runqueue
NOTE: Executing SetScene Tasks
NOTE: Executing RunQueue Tasks
ERROR: Function failed: do_kernel_configme (log file is located at /home/jmelville/yocto_dizzy/poky/build/tmp/work/zc706_zynq7-poky-linux-gnueabi/linux-xlnx/3.14.17-xilinx+gitAUTOINC+1bcd414b16_4f349cf055-r0/temp/log.do_kernel_configme.17708)
ERROR: Logfile of failure stored in: /home/jmelville/yocto_dizzy/poky/build/tmp/work/zc706_zynq7-poky-linux-gnueabi/linux-xlnx/3.14.17-xilinx+gitAUTOINC+1bcd414b16_4f349cf055-r0/temp/log.do_kernel_configme.17708
Log data follows:
| DEBUG: Executing shell function do_kernel_configme
| NOTE: kernel configme
| [INFO] Configuring target/machine combo: &quot;standard/zynq&quot;
| cp: cannot create regular file &apos;kernelxenomai//meta-series&apos;: No such file or directory
| [ERROR] cant copy ./.meta/meta-series to kernelxenomai//meta-series
| Error running the meta series for collecting config data
| config of &quot;standard/zynq&quot; failed
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_kernel_configme (log file is located at /home/jmelville/yocto_dizzy/poky/build/tmp/work/zc706_zynq7-poky-linux-gnueabi/linux-xlnx/3.14.17-xilinx+gitAUTOINC+1bcd414b16_4f349cf055-r0/temp/log.do_kernel_configme.17708)
ERROR: Task 8 (/home/jmelville/yocto_dizzy/meta-xilinx/recipes-kernel/linux/linux-xlnx_3.14.bb, do_kernel_configme) failed with exit code &apos;1&apos;
NOTE: Tasks Summary: Attempted 403 tasks of which 401 didn&apos;t need to be rerun and 1 failed.
No currently running tasks (403 of 420)

Summary: 1 task failed:
  /home/jmelville/yocto_dizzy/meta-xilinx/recipes-kernel/linux/linux-xlnx_3.14.bb, do_kernel_configme
Summary: There was 1 ERROR message shown, returning a non-zero exit code.


Output from git ls-files -o --directory in the Linux kernel dir:
.meta/
arch/arm/boot/dts/omap3-igep0020-3430.dts
arch/arm/boot/dts/omap3430-igep.dtsi
arch/arm/include/asm/fcse.h
arch/arm/include/asm/hardware/cache-l2x0.h.orig
arch/arm/include/asm/ipipe.h
arch/arm/include/asm/ipipe_base.h
arch/arm/include/asm/ipipe_hwirq.h
arch/arm/include/asm/resource.h
arch/arm/include/asm/xenomai/
arch/arm/kernel/ipipe.c
arch/arm/kernel/ipipe_tsc.c
arch/arm/kernel/ipipe_tsc_asm.S
arch/arm/mach-at91/at91_ipipe.c
arch/arm/mach-at91/at91_ipipe.h
arch/arm/mm/fcse.c
arch/arm/xenomai/
drivers/xenomai/
include/asm-generic/xenomai/
include/ipipe/
include/linux/ipipe.h
include/linux/ipipe_base.h
include/linux/ipipe_compat.h
include/linux/ipipe_debug.h
include/linux/ipipe_domain.h
include/linux/ipipe_lock.h
include/linux/ipipe_tickdev.h
include/linux/ipipe_trace.h
include/xenomai/
init/Kconfig.orig
kernel/ipipe/
kernel/xenomai/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49342</commentid>
    <comment_count>1</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2015-03-10 16:08:21 +0000</bug_when>
    <thetext>For what it is worth, it is bad that *any* process leave the kernel directory dirty
and not commit its changes. It means that future patching will be impossible 
and bisecting / debugging issues also not possible.

I&apos;ve had a change for making the  meta directory detection more robust for a
while, as part of a change unifying the detection across scripts. As you guessed,
looking within the directory for a sentinel file is the easiest thing to do.

I like the failure from the point of view that it is exposing some poor practices 
that are happening to the kernel directory .. and saving future pain, but we can
still make things more robust. There&apos;s never hard in that.

If you look at:

  git://git.yoctoproject.org/yocto-kernel-tools master-test

You&apos;ll see the in progress patches. Feel free to take them for a test drive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49344</commentid>
    <comment_count>2</comment_count>
    <who name="Jeff Melville">dev</who>
    <bug_when>2015-03-10 16:21:13 +0000</bug_when>
    <thetext>Bruce,

Thanks for taking a look at this so quickly. I&apos;ll consider having our patch process commit the changes. If nothing else, it will avoid shipping builds with &quot;-dirty&quot; kernels.

I looked over 0f1c9d2 quickly. Forgive me if I&apos;m wrong, my bash scripting gets rusty from lack of use.

It looks like you save the name of the metadir to the &apos;.metadir&apos; file. Subsequent tests use -d to check if .metadir is a directory before catting the file into a variable. If I read the code correctly, that path will never run.

Cheers,
Jeff</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49345</commentid>
    <comment_count>3</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2015-03-10 16:27:49 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Bruce,
&gt; 
&gt; Thanks for taking a look at this so quickly. I&apos;ll consider having our patch
&gt; process commit the changes. If nothing else, it will avoid shipping builds
&gt; with &quot;-dirty&quot; kernels.
&gt; 
&gt; I looked over 0f1c9d2 quickly. Forgive me if I&apos;m wrong, my bash scripting
&gt; gets rusty from lack of use.
&gt; 
&gt; It looks like you save the name of the metadir to the &apos;.metadir&apos; file.
&gt; Subsequent tests use -d to check if .metadir is a directory before catting
&gt; the file into a variable. If I read the code correctly, that path will never

Yep. That&apos;s why this is under test :) That should be -f, not -d for the test.
And I made the change here.

Bruce

&gt; run.
&gt; 
&gt; Cheers,
&gt; Jeff</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49349</commentid>
    <comment_count>4</comment_count>
    <who name="Jeff Melville">dev</who>
    <bug_when>2015-03-10 17:03:19 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; Bruce,
&gt; &gt; 
&gt; &gt; Thanks for taking a look at this so quickly. I&apos;ll consider having our patch
&gt; &gt; process commit the changes. If nothing else, it will avoid shipping builds
&gt; &gt; with &quot;-dirty&quot; kernels.
&gt; &gt; 
&gt; &gt; I looked over 0f1c9d2 quickly. Forgive me if I&apos;m wrong, my bash scripting
&gt; &gt; gets rusty from lack of use.
&gt; &gt; 
&gt; &gt; It looks like you save the name of the metadir to the &apos;.metadir&apos; file.
&gt; &gt; Subsequent tests use -d to check if .metadir is a directory before catting
&gt; &gt; the file into a variable. If I read the code correctly, that path will never
&gt; 
&gt; Yep. That&apos;s why this is under test :) That should be -f, not -d for the test.
&gt; And I made the change here.
&gt; 
&gt; Bruce
&gt; 
&gt; &gt; run.
&gt; &gt; 
&gt; &gt; Cheers,
&gt; &gt; Jeff

OK now the meta-xilinx layer is making this messy. They keep the Kernel metadata separately and add it to the build flow with SRC_URI and type=kmeta. As far as I can tell, those directories don&apos;t get copied into the kernel tree until &apos;updateme&apos; gets run. When &apos;createme&apos; runs, it can&apos;t detect the meta directory (because nothing exists yet) and meta_dir is empty going into metaize(). The script then tries to create /cfg and fails with permission errors.

Jeff</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49350</commentid>
    <comment_count>5</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2015-03-10 17:12:50 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; Bruce,
&gt; &gt; &gt; 
&gt; &gt; &gt; Thanks for taking a look at this so quickly. I&apos;ll consider having our patch
&gt; &gt; &gt; process commit the changes. If nothing else, it will avoid shipping builds
&gt; &gt; &gt; with &quot;-dirty&quot; kernels.
&gt; &gt; &gt; 
&gt; &gt; &gt; I looked over 0f1c9d2 quickly. Forgive me if I&apos;m wrong, my bash scripting
&gt; &gt; &gt; gets rusty from lack of use.
&gt; &gt; &gt; 
&gt; &gt; &gt; It looks like you save the name of the metadir to the &apos;.metadir&apos; file.
&gt; &gt; &gt; Subsequent tests use -d to check if .metadir is a directory before catting
&gt; &gt; &gt; the file into a variable. If I read the code correctly, that path will never
&gt; &gt; 
&gt; &gt; Yep. That&apos;s why this is under test :) That should be -f, not -d for the test.
&gt; &gt; And I made the change here.
&gt; &gt; 
&gt; &gt; Bruce
&gt; &gt; 
&gt; &gt; &gt; run.
&gt; &gt; &gt; 
&gt; &gt; &gt; Cheers,
&gt; &gt; &gt; Jeff
&gt; 
&gt; OK now the meta-xilinx layer is making this messy. They keep the Kernel
&gt; metadata separately and add it to the build flow with SRC_URI and
&gt; type=kmeta. As far as I can tell, those directories don&apos;t get copied into
&gt; the kernel tree until &apos;updateme&apos; gets run. When &apos;createme&apos; runs, it can&apos;t
&gt; detect the meta directory (because nothing exists yet) and meta_dir is empty
&gt; going into metaize(). The script then tries to create /cfg and fails with
&gt; permission errors.
&gt; 
&gt; Jeff

(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; (In reply to comment #2)
&gt; &gt; &gt; Bruce,
&gt; &gt; &gt; 
&gt; &gt; &gt; Thanks for taking a look at this so quickly. I&apos;ll consider having our patch
&gt; &gt; &gt; process commit the changes. If nothing else, it will avoid shipping builds
&gt; &gt; &gt; with &quot;-dirty&quot; kernels.
&gt; &gt; &gt; 
&gt; &gt; &gt; I looked over 0f1c9d2 quickly. Forgive me if I&apos;m wrong, my bash scripting
&gt; &gt; &gt; gets rusty from lack of use.
&gt; &gt; &gt; 
&gt; &gt; &gt; It looks like you save the name of the metadir to the &apos;.metadir&apos; file.
&gt; &gt; &gt; Subsequent tests use -d to check if .metadir is a directory before catting
&gt; &gt; &gt; the file into a variable. If I read the code correctly, that path will never
&gt; &gt; 
&gt; &gt; Yep. That&apos;s why this is under test :) That should be -f, not -d for the test.
&gt; &gt; And I made the change here.
&gt; &gt; 
&gt; &gt; Bruce
&gt; &gt; 
&gt; &gt; &gt; run.
&gt; &gt; &gt; 
&gt; &gt; &gt; Cheers,
&gt; &gt; &gt; Jeff
&gt; 
&gt; OK now the meta-xilinx layer is making this messy. They keep the Kernel
&gt; metadata separately and add it to the build flow with SRC_URI and
&gt; type=kmeta. As far as I can tell, those directories don&apos;t get copied into
&gt; the kernel tree until &apos;updateme&apos; gets run. When &apos;createme&apos; runs, it can&apos;t
&gt; detect the meta directory (because nothing exists yet) and meta_dir is empty
&gt; going into metaize(). The script then tries to create /cfg and fails with
&gt; permission errors.

Ah yes. I&apos;ve run into this before as well.  We won&apos;t be getting this change into 1.8, so I&apos;ll
work on it more tomorrow, I&apos;d rather not include any more complexity (I just removed
a lot of it) so I need to come up with more than a one off solution.

For now, the best thing to do is to make sure that some custom task runs before the 
kernel configme and cleans up, so everything works as expected.

&gt; 
&gt; Jeff</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49379</commentid>
    <comment_count>6</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2015-03-11 19:46:05 +0000</bug_when>
    <thetext>I pushed a new variant, with an exception case in the createme script. It will fallback
to a default and then propagate it to all following tools.

I haven&apos;t build tested this against the xilinx layers, but it does survive standard and linux-yocto-custom
builds (which have no meta-data).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49458</commentid>
    <comment_count>7</comment_count>
    <who name="Jeff Melville">dev</who>
    <bug_when>2015-03-13 19:01:54 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; I pushed a new variant, with an exception case in the createme script. It
&gt; will fallback
&gt; to a default and then propagate it to all following tools.
&gt; 
&gt; I haven&apos;t build tested this against the xilinx layers, but it does survive
&gt; standard and linux-yocto-custom
&gt; builds (which have no meta-data).

Thanks I will test against my build flow on Monday. I have to roll back the workaround I made to work with the old scripts.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49825</commentid>
    <comment_count>8</comment_count>
    <who name="Jeff Melville">dev</who>
    <bug_when>2015-03-26 20:36:21 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; (In reply to comment #6)
&gt; &gt; I pushed a new variant, with an exception case in the createme script. It
&gt; &gt; will fallback
&gt; &gt; to a default and then propagate it to all following tools.
&gt; &gt; 
&gt; &gt; I haven&apos;t build tested this against the xilinx layers, but it does survive
&gt; &gt; standard and linux-yocto-custom
&gt; &gt; builds (which have no meta-data).
&gt; 
&gt; Thanks I will test against my build flow on Monday. I have to roll back the
&gt; workaround I made to work with the old scripts.

Sorry this took so long, I got around to testing it today and didn&apos;t see any issues. FWIW, I&apos;m still going to stick with your original suggestion to not build a dirty kernel.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>49866</commentid>
    <comment_count>9</comment_count>
    <who name="Bruce Ashfield">bruce.ashfield</who>
    <bug_when>2015-03-27 13:42:56 +0000</bug_when>
    <thetext>Great. Since I won&apos;t push this into 1.8 at this late point, I&apos;ll move this to 1.9 and
send it for merging once the tree thaws.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>