<?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>15951</bug_id>
          
          <creation_ts>2025-08-13 05:47:57 +0000</creation_ts>
          <short_desc>poky/scripts/lib/wic/partition.py: add du --apparent-size to solve build error on compressed ZFS dataset</short_desc>
          <delta_ts>2026-08-07 19:38:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Wic</product>
          <component>wic</component>
          <version>v0.3.0</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>normal</bug_severity>
          <target_milestone>v0.4.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Wojciech Niziński">niziak-yoctobug</reporter>
          <assigned_to name="Trevor Woerner">twoerner</assigned_to>
          <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>victor.hansen</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>102587</commentid>
    <comment_count>0</comment_count>
      <attachid>5132</attachid>
    <who name="Wojciech Niziński">niziak-yoctobug</who>
    <bug_when>2025-08-13 05:47:57 +0000</bug_when>
    <thetext>Created attachment 5132
patch proposal

Buildiing in LXC container on ZFS dataset with compression enabled:

ERROR: core-image-minimal-1.0-r0 do_image_wic: ExecutionError(&apos;build/tmp/work/.../core-image-minimal/1.0/temp/run.do_image_wic.1471812&apos;, 1, None, None)
...

| Writing inode tables: done 
| Creating journal (4096 blocks): done
| Copying files into the device: __populate_fs: Could not allocate block in ext2 filesystem while writing file &quot;cc1&quot;
| mkfs.ext4: Could not allocate block in ext2 filesystem while populating file system
| 512
| 
| WARNING: exit code 1 from a shell command.


Similar problem (https://lists.yoctoproject.org/g/poky/topic/image_bbclass/81548542) in image.bblcass was solved with commits:

https://git.yoctoproject.org/poky/commit/?h=master-next&amp;id=3743234dab23e4068e1d1fde9e1fa0bc09fdb182

https://git.yoctoproject.org/poky/commit/?h=master-next&amp;id=f7ed81182c7797fd6b0069fa5c90535b13848657

Now function prepare_root_fs_ext() in file poky/scripts/lib/wic/partition.py needs similar fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102597</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-08-14 14:38:59 +0000</bug_when>
    <thetext>Ross will want to look at this when he&apos;s back.
The code involved may need a re-write.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104046</commentid>
    <comment_count>2</comment_count>
    <who name="Victor Johan Hansen">victor.hansen</who>
    <bug_when>2026-01-23 08:21:07 +0000</bug_when>
    <thetext>(In reply to Randy MacLeod from comment #1)
&gt; Ross will want to look at this when he&apos;s back.
&gt; The code involved may need a re-write.

This patch also resolves spurious 
&apos;ERROR: Actual rootfs size (y kB) is larger than allowed size x kB&apos; failures when building wic images on ZFS hosts.

The root cause: du -ks reports disk usage based on allocated blocks, which on ZFS varies depending on pool fragmentation and fill level. This means identical builds can report different sizes across builders:

builder 1 - du -ks: 281870 kB
builder 2 - du -ks: 281534 kB

The ERROR becomes more prevalent when your target rootfs reaches capacity, i.e. less &quot;wiggle room&quot;.


Would it be possible to backport this fix to scarthgap?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104607</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2026-03-12 15:11:54 +0000</bug_when>
    <thetext>As this is a wic issue I&apos;m going to throw it to Trevor :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105717</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2026-06-04 15:17:15 +0000</bug_when>
    <thetext>Trevor, Does this patch work for you ?</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>5132</attachid>
            <date>2025-08-13 05:47:57 +0000</date>
            <delta_ts>2025-08-13 05:47:57 +0000</delta_ts>
            <desc>patch proposal</desc>
            <filename>0001-wic-partition.py-fix-du-size-reporting-on-compressed.patch</filename>
            <type>text/plain</type>
            <size>1161</size>
            <attacher name="Wojciech Niziński">niziak-yoctobug</attacher>
            
              <data encoding="base64">RnJvbSA5ZWEwNTcwMWY0YzI4MWRhNTAzMWZkZTkwOTgwYjdmMjliZTNlNzAzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBXb2pjaWVjaCBOaXppbnNraSA8d29qY2llY2gubml6aW5za2lA
Z3Jpbm4tZ2xvYmFsLmNvbT4KRGF0ZTogV2VkLCAxMyBBdWcgMjAyNSAwNTozNjoxMiArMDAwMApT
dWJqZWN0OiBbUEFUQ0hdIHdpYy9wYXJ0aXRpb24ucHk6IGZpeCBkdSBzaXplIHJlcG9ydGluZyBv
biBjb21wcmVzc2VkIEZTCgpCYXJlIGBkdWAgcmVwb3J0cyBiYXJlIHJlYWwgZGlzYyB1c2FnZSBu
b3QgYWN0dWFsIHNpemUuCk9uIGNvbXByZXNzZWQgZmlsZXN5c3RlbXMgc2l6ZSByZXR1cm5lZCBp
cyBpbmNvcnJlY3QgYW5kCnVuZGVydmFsdWVkIGNhdXNpbmcgYnVpbGQgZXJyb3I6CgpDb3B5aW5n
IGZpbGVzIGludG8gdGhlIGRldmljZTogX19wb3B1bGF0ZV9m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