====== Could not allocate block ======
ERROR: core-image-minimal-1.0-r0 do_image_wic: ExecutionError('build/tmp/work/.../core-image-minimal/1.0/temp/run.do_image_wic.1471812', 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 "cc1"
| mkfs.ext4: Could not allocate block in ext2 filesystem while populating file system
| 512
|
| WARNING: exit code 1 from a shell command.
Not related to free space in image size. Tested with:
IMAGE_ROOTFS_EXTRA_SPACE:append = " + 150000"
IMAGE_OVERHEAD_FACTOR = "2"
Conclusions:
* It is related to build on ZFS. In this case LXC on Proxmox's LXC.
* It works before.
* It works for another (bigger) image.
* It is related to ''wic'' image.
* Yocto's ''image.bbclass'' was fixed to correctly calculate sizes on compressed ZFS:
* Problem raised here: [[https://lists.yoctoproject.org/g/poky/topic/image_bbclass/81548542|image.bbclass - get_rootfs_size]]
* And fixed here:
* [[https://git.yoctoproject.org/poky/commit/?h=master-next&id=3743234dab23e4068e1d1fde9e1fa0bc09fdb182|lib/oe/utils: add directory size function]]
* [[https://git.yoctoproject.org/poky/commit/?h=master-next&id=f7ed81182c7797fd6b0069fa5c90535b13848657|classes/image: use oe.utils.directory_size() instead of du]]
* Problem still exists in [[https://git.yoctoproject.org/poky/tree/scripts/lib/wic/partition.py#n279|poky/scripts/lib/wic/partition.py]]
* Task ''do_image_wic''.
* ''du'' returns real disc usage (135649) (on compressed ZFS) instead of data size (250920).
* adding ''--apparent-size'' fixes the issue (''du_cmd = "du -bks %s --apparent-size" % rootfs_dir'')
* Bug filled [[https://bugzilla.yoctoproject.org/show_bug.cgi?id=15951]]