<?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>15603</bug_id>
          
          <creation_ts>2024-10-01 13:49:10 +0000</creation_ts>
          <short_desc>u-boot recipe cannot be used with devtool due to a bug in poky/meta/classes-recipe/uboot-config.bbclass</short_desc>
          <delta_ts>2026-04-16 15:30:37 +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>core</component>
          <version>5.0.16</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</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>normal</bug_severity>
          <target_milestone>5.0.17</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Iuliu Vasilescu">iuliuv</reporter>
          <assigned_to name="Yoann Congal">yoann.congal</assigned_to>
          <cc>ccasciato</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>tim.orling</cc>
    
    <cc>yoann.congal</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>99749</commentid>
    <comment_count>0</comment_count>
    <who name="Iuliu Vasilescu">iuliuv</who>
    <bug_when>2024-10-01 13:49:10 +0000</bug_when>
    <thetext>This bug affects scarthgap and master at least. Steps to reproduce. For any machine/configuration. I have tested for NXP imx, using the NXP i.MX Yocto BSP:

devtool modify u-boot
devtool build -c u-boot
devtool build u-boot

the last command results in an error to due to do_configure trying to copy the .config from 
...u-boot/2024.04/build/.. which is not the correct build directory if devtool is active. The correct directory is ...u-boot/2024.4/u-boot-2024.04...

This is due to the fact that in poky/meta/classes-recipe/uboot-config.bbclass:
d.setVar(&apos;KCONFIG_CONFIG_ROOTDIR&apos;, os.path.join(d.getVar(&quot;B&quot;), d.getVar(&quot;UBOOT_MACHINE&quot;).strip()))

the &quot;B&quot; var is expanded too early, before the new value set by devtool had a chance to be set. Proposed change which works but might not be the correct way to solve the issue is to change the line to:

d.setVar(&apos;KCONFIG_CONFIG_ROOTDIR&apos;, os.path.join(&quot;${B}/&quot;, d.getVar(&quot;UBOOT_MACHINE&quot;).strip()))


the exact error is here (notice it is u-boot-imx - which is the name of the recipe in this distro):
| cp: cannot stat &apos;/imx/95/tmp/work/imx8mn_lpddr4_evk-poky-linux/u-boot-imx/2024.04/build/imx8mn_evk_defconfig/.config&apos;: No such file or directory
| WARNING: /imx/95/tmp/work/imx8mn_lpddr4_evk-poky-linux/u-boot-imx/2024.04/temp/run.do_configure.73156:175 exit 1 from &apos;cp /imx/95/tmp/work/imx8mn_lpddr4_evk-poky-linux/u-boot-imx/2024.04/build/imx8mn_evk_defconfig/.config /imx/95/workspace/sources/u-boot-imx/.config.baseline&apos;
| WARNING: Backtrace (BB generated script):
|       #1: do_configure, /imx/95/tmp/work/imx8mn_lpddr4_evk-poky-linux/u-boot-imx/2024.04/temp/run.do_configure.73156, line 175
|       #2: main, /imx/95/tmp/work/imx8mn_lpddr4_evk-poky-linux/u-boot-imx/2024.04/temp/run.do_configure.73156, line 223</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99756</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-10-03 14:38:59 +0000</bug_when>
    <thetext>Would you be able to send a patch to not expand the variables?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99780</commentid>
    <comment_count>2</comment_count>
      <attachid>5070</attachid>
    <who name="Iuliu Vasilescu">iuliuv</who>
    <bug_when>2024-10-05 18:01:00 +0000</bug_when>
    <thetext>Created attachment 5070
patch for scarthgap</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99781</commentid>
    <comment_count>3</comment_count>
      <attachid>5071</attachid>
    <who name="Iuliu Vasilescu">iuliuv</who>
    <bug_when>2024-10-05 18:01:33 +0000</bug_when>
    <thetext>Created attachment 5071
patch for master</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99782</commentid>
    <comment_count>4</comment_count>
    <who name="Iuliu Vasilescu">iuliuv</who>
    <bug_when>2024-10-05 18:03:28 +0000</bug_when>
    <thetext>I&apos;ve attached the proposed patch formatted for master and for scarthgap. Again, should be checked by someone with a good understanding of the whole devtool interaction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99831</commentid>
    <comment_count>5</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-10-10 15:24:36 +0000</bug_when>
    <thetext>Could you please send to the mailing list? we do not take patches from Bugzilla.

https://docs.yoctoproject.org/dev/contributor-guide/submit-changes.html

https://lists.openembedded.org/g/openembedded-core</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>100848</commentid>
    <comment_count>6</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2025-02-05 23:01:10 +0000</bug_when>
    <thetext>A patch was sent: &quot;[PATCH v2] uboot-config: Fix devtool modify&quot; By Tom Hochstein
https://lists.openembedded.org/g/openembedded-core/message/210880</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104551</commentid>
    <comment_count>7</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-03-06 15:47:21 +0000</bug_when>
    <thetext>This has merged (~a year ago) in master (and is present on whinlatter):
commit 57b21065a25100c31515b32fd7c77bde3355d684
Author: Tom Hochstein &lt;tom.hochstein@oss.nxp.com&gt;
Date:   Wed Feb 5 16:18:55 2025 -0600

    uboot-config: Fix devtool modify
https://git.openembedded.org/openembedded-core/commit/?id=57b21065a25100c31515b32fd7c77bde3355d684

I&apos;ll take it for scarthgap since I had a request for a backport:
[scarthgap][PATCH] uboot-config: Fix devtool modify #scarthgap - nicolas.heemeryck
https://lore.kernel.org/openembedded-core/NOkm.1772551368148819834.HwYd@lists.openembedded.org/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105115</commentid>
    <comment_count>8</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2026-04-16 15:30:37 +0000</bug_when>
    <thetext>Fixed in scarthgap: https://git.openembedded.org/openembedded-core/commit/?h=scarthgap&amp;id=6a19e284baaadfdf080ebc5decf065e468655732 (in 5.0.17)</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5070</attachid>
            <date>2024-10-05 18:01:00 +0000</date>
            <delta_ts>2024-10-05 18:01:00 +0000</delta_ts>
            <desc>patch for scarthgap</desc>
            <filename>0001-uboot-fix-B-var-expanded-too-early-causing-devtool-scarthgap.patch</filename>
            <type>text/plain</type>
            <size>1457</size>
            <attacher name="Iuliu Vasilescu">iuliuv</attacher>
            
              <data encoding="base64">RnJvbSBjZmU4MmFiY2FhZGQxY2EzNzM3ZTBmZmE2MmUyNzgyNDE4Y2Q1MDFhIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBJdWxpdSBWYXNpbGVzY3UgPGl1bGl1dkBnbWFpbC5jb20+CkRh
dGU6IFNhdCwgNSBPY3QgMjAyNCAyMDoyMDo0MyArMDMwMApTdWJqZWN0OiBbUEFUQ0hdIHVib290
OiBmaXggQiB2YXIgZXhwYW5kZWQgdG9vIGVhcmx5LCBjYXVzaW5nIGRldnRvb2wgbm90IHRvCiB3
b3JrCgp0aGUgIkIiIHZhciBpcyBleHBh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aWYgbGVuKHVib290Y29uZmlnKSA9PSAxOgotICAgICAgICAgICAg
ICAgIGQuc2V0VmFyKCdLQ09ORklHX0NPTkZJR19ST09URElSJywgb3MucGF0aC5qb2luKGQuZ2V0
VmFyKCJCIiksIGQuZ2V0VmFyKCJVQk9PVF9NQUNISU5FIikuc3RyaXAoKSkpCisgICAgICAgICAg
ICAgICAgZC5zZXRWYXIoJ0tDT05GSUdfQ09ORklHX1JPT1RESVInLCBvcy5wYXRoLmpvaW4oIiR7
Qn0vIiwgZC5nZXRWYXIoIlVCT09UX01BQ0hJTkUiKS5zdHJpcCgpKSkKICAgICAgICAgICAgIGVs
c2U6CiAgICAgICAgICAgICAgICAgIyBEaXNhYmxlIG1lbnVjb25maWcgZm9yIG11bHRpcGxlIGNv
bmZpZ3MKICAgICAgICAgICAgICAgICBkLnNldFZhcignS0NPTkZJR19DT05GSUdfRU5BQkxFX01F
TlVDT05GSUcnLCAiZmFsc2UiKQotLSAKMi4zOS41Cgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5071</attachid>
            <date>2024-10-05 18:01:33 +0000</date>
            <delta_ts>2024-10-05 18:01:33 +0000</delta_ts>
            <desc>patch for master</desc>
            <filename>0001-uboot-fix-B-var-expanded-too-early-causing-devtool-master.patch</filename>
            <type>text/plain</type>
            <size>1477</size>
            <attacher name="Iuliu Vasilescu">iuliuv</attacher>
            
              <data encoding="base64">RnJvbSAxZTA1NmNkYTAxNTAwYTczYmZlZGU1NmE4MjMwZDk3ZGM5MmNlYTdmIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBJdWxpdSBWYXNpbGVzY3UgPGl1bGl1dkBnbWFpbC5jb20+CkRh
dGU6IFNhdCwgNSBPY3QgMjAyNCAyMDo1NTo0MCArMDMwMApTdWJqZWN0OiBbUEFUQ0hdIHVib290
OiBmaXggQiB2YXIgZXhwYW5kZWQgdG9vIGVhcmx5LCBjYXVzaW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AgIGlmICd1LWJvb3QnIGluIHJlY2lwZW5hbWU6
CiAgICAgICAgICAgICAgICAgaWYgbGVuKHVib290Y29uZmlnKSA9PSAxOgotICAgICAgICAgICAg
ICAgICAgICBkLnNldFZhcignS0NPTkZJR19DT05GSUdfUk9PVERJUicsIG9zLnBhdGguam9pbihk
LmdldFZhcigiQiIpLCBkLmdldFZhcigiVUJPT1RfTUFDSElORSIpLnN0cmlwKCkpKQorICAgICAg
ICAgICAgICAgICAgICBkLnNldFZhcignS0NPTkZJR19DT05GSUdfUk9PVERJUicsIG9zLnBhdGgu
am9pbigiJHtCfS8iLCBkLmdldFZhcigiVUJPT1RfTUFDSElORSIpLnN0cmlwKCkpKQogICAgICAg
ICAgICAgICAgIGVsc2U6CiAgICAgICAgICAgICAgICAgICAgICMgRGlzYWJsZSBtZW51Y29uZmln
IGZvciBtdWx0aXBsZSBjb25maWdzCiAgICAgICAgICAgICAgICAgICAgIGQuc2V0VmFyKCdLQ09O
RklHX0NPTkZJR19FTkFCTEVfTUVOVUNPTkZJRycsICJmYWxzZSIpCi0tIAoyLjM5LjUKCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>