<?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>13216</bug_id>
          
          <creation_ts>2019-03-06 14:46:52 +0000</creation_ts>
          <short_desc>Failure on do_image_ext4 on zfs file system</short_desc>
          <delta_ts>2019-03-06 14:55:32 +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>Scripts and Tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>8430</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Rajotte-Julien">jonathan.rajotte-julien</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>ross.burton</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>83196</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Rajotte-Julien">jonathan.rajotte-julien</who>
    <bug_when>2019-03-06 14:46:52 +0000</bug_when>
    <thetext>Hi,

Using oe-core in standalone mode (bitbake) inside a lxc container using a zfs file system, we get the following error:

Log data follows:
| DEBUG: Executing python function set_image_size
| DEBUG: 130757.900000 = 100583 * 1.300000
| DEBUG: 130757.900000 = max(130757.900000, 8192)[130757.900000] + 1
| DEBUG: 130758.000000 = int(130757.900000)
| DEBUG: 130758 = aligned(130758)
| DEBUG: returning 130758
| DEBUG: Python function set_image_size finished
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are [&apos;virtual:native:/root/oe-core/meta/recipes-devtools/makedevs/makedevs_1.0.1.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-devtools/e2fsprogs/e2fsprogs_1.44.5.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot&apos;, &apos;/root/oe-core/meta/recipes-kernel/kmod/depmodwrapper-cross_1.0.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-core/update-rc.d/update-rc.d_0.8.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-devtools/opkg/opkg_0.4.0.bb:do_populate_sysroot&apos;, &apos;/root/oe-core/meta/recipes-devtools/qemu/qemuwrapper-cross_1.0.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-devtools/opkg-utils/opkg-utils_0.4.0.bb:do_populate_sysroot&apos;, &apos;/root/oe-core/meta/recipes-devtools/mklibs/mklibs-native_0.1.44.bb:do_populate_sysroot&apos;, &apos;/root/oe-core/meta/recipes-core/glibc/cross-localedef-native_2.29.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-extended/pbzip2/pbzip2_1.1.13.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-devtools/prelink/prelink_git.bb:do_populate_sysroot&apos;, &apos;/root/oe-core/meta/recipes-core/glibc/ldconfig-native_2.12.1.bb:do_populate_sysroot&apos;, &apos;virtual:native:/root/oe-core/meta/recipes-extended/pigz/pigz_2.4.bb:do_populate_sysroot&apos;]
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: [&apos;makedevs-native&apos;, &apos;e2fsprogs-native&apos;, &apos;pseudo-native&apos;, &apos;depmodwrapper-cross&apos;, &apos;update-rc.d-native&apos;, &apos;opkg-native&apos;, &apos;qemuwrapper-cross&apos;, &apos;opkg-utils-native&apos;, &apos;mklibs-native&apos;, &apos;cross-localedef-native&apos;, &apos;pbzip2-native&apos;, &apos;prelink-native&apos;, &apos;ldconfig-native&apos;, &apos;pigz-native&apos;, &apos;quilt-native&apos;, &apos;xz-native&apos;, &apos;attr-native&apos;, &apos;automake-native&apos;, &apos;pkgconfig-native&apos;, &apos;libtool-native&apos;, &apos;gnu-config-native&apos;, &apos;texinfo-dummy-native&apos;, &apos;util-linux-native&apos;, &apos;autoconf-native&apos;, &apos;gettext-minimal-native&apos;, &apos;kmod-native&apos;, &apos;qemu-native&apos;, &apos;debianutils-native&apos;, &apos;openssl-native&apos;, &apos;gtk+3-native&apos;, &apos;gdk-pixbuf-native&apos;, &apos;libarchive-native&apos;, &apos;libsolv-native&apos;, &apos;shadow-native&apos;, &apos;glib-2.0-native&apos;, &apos;bzip2-native&apos;, &apos;binutils-native&apos;, &apos;elfutils-native&apos;, &apos;zlib-native&apos;, &apos;ncurses-native&apos;, &apos;m4-native&apos;, &apos;python3-native&apos;, &apos;gtk-doc-native&apos;, &apos;libxcursor-native&apos;, &apos;cairo-native&apos;, &apos;at-spi2-atk-native&apos;, &apos;libxdamage-native&apos;, &apos;libxrender-native&apos;, &apos;libpng-native&apos;, &apos;pango-native&apos;, &apos;atk-native&apos;, &apos;gobject-introspection-native&apos;, &apos;libxi-native&apos;, &apos;libxext-native&apos;, &apos;libxrandr-native&apos;, &apos;libxfixes-native&apos;, &apos;fontconfig-native&apos;, &apos;libx11-native&apos;, &apos;libxcomposite-native&apos;, &apos;libjpeg-turbo-native&apos;, &apos;meson-native&apos;, &apos;shared-mime-info-native&apos;, &apos;ninja-native&apos;, &apos;lzo-native&apos;, &apos;cmake-native&apos;, &apos;expat-native&apos;, &apos;rpm-native&apos;, &apos;gettext-native&apos;, &apos;libpcre-native&apos;, &apos;libffi-native&apos;, &apos;flex-native&apos;, &apos;gdbm-native&apos;, &apos;sqlite3-native&apos;, &apos;libnsl2-native&apos;, &apos;readline-native&apos;, &apos;libtirpc-native&apos;, &apos;util-macros-native&apos;, &apos;libxcb-native&apos;, &apos;pixman-native&apos;, &apos;libsm-native&apos;, &apos;at-spi2-core-native&apos;, &apos;libxml2-native&apos;, &apos;dbus-native&apos;, &apos;xorgproto-native&apos;, &apos;harfbuzz-native&apos;, &apos;fribidi-native&apos;, &apos;freetype-native&apos;, &apos;libxft-native&apos;, &apos;gperf-native&apos;, &apos;xtrans-native&apos;, &apos;python3-setuptools-native&apos;, &apos;intltool-native&apos;, &apos;re2c-native&apos;, &apos;curl-native&apos;, &apos;file-native&apos;, &apos;nss-native&apos;, &apos;popt-native&apos;, &apos;perl-native&apos;, &apos;db-native&apos;, &apos;libxau-native&apos;, &apos;xcb-proto-native&apos;, &apos;libpthread-stubs-native&apos;, &apos;libxdmcp-native&apos;, &apos;libice-native&apos;, &apos;libxtst-native&apos;, &apos;icu-native&apos;, &apos;unzip-native&apos;, &apos;libxml-parser-perl-native&apos;, &apos;nspr-native&apos;]
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_image_ext4
| DEBUG: Executing dd if=/dev/zero of=/root/oe-core/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/deploy-core-image-minimal-image-complete/core-image-minimal-qemux86-64-20190305222515.rootfs.ext4 seek=130758 count=0 bs=1024
| 0+0 records in
| 0+0 records out
| 0 bytes copied, 0.000166729 s, 0.0 kB/s
| DEBUG: Actual Rootfs size:  100583	/root/oe-core/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/rootfs
| DEBUG: Actual Partion size: 133896192
| DEBUG: Executing mkfs.ext4 -F -i 4096 -O 64bit /root/oe-core/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/deploy-core-image-minimal-image-complete/core-image-minimal-qemux86-64-20190305222515.rootfs.ext4 -d /root/oe-core/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/rootfs
| mke2fs 1.44.5 (15-Dec-2018)
| Discarding device blocks: done         
| Creating filesystem with 130756 1k blocks and 32768 inodes
| Filesystem UUID: a136fb3e-10e0-4847-a107-bc1926327ae9
| Superblock backups stored on blocks:
| 	8193, 24577, 40961, 57345, 73729
| 
| Allocating group tables: done 
| 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;libnl-genl-3.so.200.26.0&quot;
| mkfs.ext4: Could not allocate block in ext2 filesystem while populating file system
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_image_ext4 (log file is located at /root/oe-core/build/tmp-glibc/work/qemux86_64-oe-linux/core-image-minimal/1.0-r0/temp/log.do_image_ext4.8133)
ERROR: Task (/root/oe-core/meta/recipes-core/images/core-image-minimal.bb:do_image_ext4) failed with exit code &apos;1&apos;


After a quick discussion with Richard Purdie on irc [1], it seems that the size calculation is wrong. The current calculation is based on &quot;du -ks&quot;, using &quot;--apparent-size&quot; fixes the issue. Still, I&apos;m not convinced that this is a valid longterm solution since even when using --apparent-size du can under-report the actual size.

Ross Burton already has a branch that tries to fix this issue [2]. We tested it and it seems to do the job!


[1] https://www.yoctoproject.org/irc/%23yocto.2019-03-05.log.html#t2019-03-05T22:28:52
[2] https://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=ross/du</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83197</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Rajotte-Julien">jonathan.rajotte-julien</who>
    <bug_when>2019-03-06 14:49:20 +0000</bug_when>
    <thetext>Bug 12304 [1] might also be related.

https://bugzilla.yoctoproject.org/show_bug.cgi?id=12304</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83198</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Rajotte-Julien">jonathan.rajotte-julien</who>
    <bug_when>2019-03-06 14:55:32 +0000</bug_when>
    <thetext>This is a duplicate of bug 8430.

*** This bug has been marked as a duplicate of bug 8430 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>