<?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>12296</bug_id>
          
          <creation_ts>2017-11-02 19:06:04 +0000</creation_ts>
          <short_desc>standalone wic in &quot;classic&quot; SDK</short_desc>
          <delta_ts>2025-04-24 14:40:44 +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>deployment</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>ACCEPTED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>  </status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Berger">pokylinux</reporter>
          <assigned_to name="Trevor Woerner">twoerner</assigned_to>
          <cc>kexin.hao</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>tim.orling</cc>
    
    <cc>twoerner</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>77935</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Berger">pokylinux</who>
    <bug_when>2017-11-02 19:06:04 +0000</bug_when>
    <thetext>I think wic would be great as a default tool not only in the extensible SDK, but also in the &quot;standard&quot; SDK. 

Unfortunately it does not seem to be a &quot;package&quot;, but just a bunch of scripts under /scripts and /scripts/lib/wic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85536</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2019-11-14 16:01:35 +0000</bug_when>
    <thetext>This series appears to have been related:

https://patchwork.openembedded.org/series/13816/

http://lists.openembedded.org/pipermail/openembedded-core/2018-August/273512.html

It doesn&apos;t seem to have been merged.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92041</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-11-18 16:20:16 +0000</bug_when>
    <thetext>Richard Purdie suggested that wic could be managed as an independent package and then used by oe-core but that would require someone to set that up and maintain it...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97320</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-11-23 16:20:26 +0000</bug_when>
    <thetext>Might be a good place to mention that I&apos;ve vague plans to replace wic with pengutronix&apos;s genimage, which can be built into a sdk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101595</commentid>
    <comment_count>4</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2025-04-09 15:00:31 +0000</bug_when>
    <thetext>Currently there is a strong coupling between bitbake and wic.

In many places, whenever wic wants to know some information it calls bitbake directly via wic/misc.py::get_bitbake_var(). Here is a count of such interactions:

$ grep -r get_bitbake_var * | grep &quot;^scripts&quot; | cut -d&apos;:&apos; -f1 | uniq -c
      6 scripts/wic
      1 scripts/lib/wic/help.py
      5 scripts/lib/wic/misc.py
      3 scripts/lib/wic/engine.py
     22 scripts/lib/wic/plugins/source/isoimage-isohybrid.py
      2 scripts/lib/wic/plugins/source/rawcopy.py
      3 scripts/lib/wic/plugins/source/rootfs.py
      4 scripts/lib/wic/plugins/source/bootimg-partition.py
      8 scripts/lib/wic/plugins/source/bootimg-pcbios.py
     21 scripts/lib/wic/plugins/source/bootimg-efi.py
      3 scripts/lib/wic/plugins/imager/direct.py
      3 scripts/lib/wic/pluginbase.py
      5 scripts/lib/wic/partition.py
      3 scripts/lib/wic/ksparser.py

This is probably one of the primary reasons why wic can be part of the eSDK, but is not part of the SDK: it needs to have bitbake available to query these variables.

In order to make wic a tool that runs independently of bitbake, it will be necessary to:
- investigate each of these calls and either remove them or add cmdline arguments as the communication mechanism
- remove lib/wic/misc.py::get_bitbake_var()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101599</commentid>
    <comment_count>5</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2025-04-09 16:20:00 +0000</bug_when>
    <thetext>wic is the front end of a set of related functions. The most well-known of which is &quot;wic create&quot;. In addition to &quot;create&quot; wic also includes the following functions:
- list [list wks files]
- ls [*]
- cp [copy files in/out of partitions in image (only vfat and ext supported)]
- rm [remove files from partitions in image (only vfat and ext supported)]
- write [flash image to device]
- help

[*] ls has two behaviours:
- on the whole image, works like &quot;fdisk -l &lt;image&gt;&quot;
- on a partition in the image, does a regular &quot;ls&quot; of a directory
- currently only supported for vfat and ext filesystem partitions

The vast majority of the coupling between wic and bitbake (via lib/utils.py::get_bitbake_var()) occurs in paths related to &quot;wic create&quot;. It is quite easy to remove enough coupling to get many of the other tools decoupled (ls, cp, rm). As a proof of concept I have created a branch demonstrating this:

https://web.git.yoctoproject.org/wic/log/?h=no-create

By removing the create, list, and write sub-functions, wic is able to stand independently from bitbake and is able to be included in an SDK (for example).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101704</commentid>
    <comment_count>6</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2025-04-22 14:35:49 +0000</bug_when>
    <thetext>patch added to oe-core
https://git.openembedded.org/openembedded-core/commit/?id=1c690aa046ebca13d7b29de50d42b5d8a4a8486c</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101706</commentid>
    <comment_count>7</comment_count>
    <who name="Trevor Woerner">twoerner</who>
    <bug_when>2025-04-22 14:38:49 +0000</bug_when>
    <thetext>oops! closed the wrong bug!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101730</commentid>
    <comment_count>8</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-04-24 14:40:44 +0000</bug_when>
    <thetext>Closed the wrong bug so reset to accepted state.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>