Dear all,

 I am trying to use the btrfs instead of exta into wic image as root partition. Just changing the fs type in the wic/image.wkd does not work because it complains that btrfs native tools are missing. The variable DEPENDS in the image recipe does not help even if added. Did someone where used btrfs with wic image? Thanks, R.

ERROR: eval-image-1.0-r0 do_image_wic: ExecutionError('/work/build/tmp/work/debian-bullseye-amd64/eval-image-ipc847e/1.0-r0/temp/run.do_image_wic.1603', 1, None, None)
ERROR: Logfile of failure stored in: /work/build/tmp/work/debian-bullseye-amd64/eval-image-ipc847e/1.0-r0/temp/log.do_image_wic.1603
Log data follows:
| DEBUG: Executing python function set_image_size
| DEBUG: Python function set_image_size finished
| DEBUG: Executing shell function do_image_wic
| INFO: Creating image(s)...
|
| ERROR: A native program mkfs.btrfs required to build the image was not found (see details above).
|
| Please make sure wic-tools have btrfs-tools-native in its DEPENDS, build it with 'bitbake wic-tools' and try again.
|
|
| WARNING: exit code 1 from a shell command.
| ERROR: ExecutionError('/work/build/tmp/work/debian-bullseye-amd64/eval-image-ipc847e/1.0-r0/temp/run.do_image_wic.1603', 1, None, None)
ERROR: Task (/work/build/../../repo/recipes-core/images/eval-image.bb:do_image_wic) failed with exit code '1'
NOTE: Tasks Summary: Attempted 92 tasks of which 63 didn't need to be rerun and 1 failed.

Summary: 1 task failed:
  /work/build/../../repo/recipes-core/images/eval-image.bb:do_image_wic
Summary: There were 4 WARNING messages shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
2022-09-20 15:33:53 - ERROR    - Command returned non-zero exit status 1

ipc847e@nvidia:~/isar-ipc-847-e$ cat build/tmp/ipc847e/imgdata/wic-tools.env
RECIPE_SYSROOT_NATIVE="/"
STAGING_DATADIR="/usr/lib/"
STAGING_LIBDIR="/usr/lib/"
DEPENDS="btrfs-tools-native"

diff --git a/meta/classes/imagetypes_wic.bbclass b/meta/classes/imagetypes_wic.bbclass
index 61a74d4..ec9fcbd 100644
--- a/meta/classes/imagetypes_wic.bbclass
+++ b/meta/classes/imagetypes_wic.bbclass
@@ -127,7 +127,7 @@ python do_rootfs_wicenv () {
     with open(os.path.join(outdir, "wic-tools.env"), 'w') as envf:
         for var in ('RECIPE_SYSROOT_NATIVE', 'STAGING_DATADIR', 'STAGING_LIBDIR'):
             envf.write('{}="{}"\n'.format(var, d.getVar(var, True).strip()))
-
+        envf.write('DEPENDS="btrfs-tools-native"\n')
 }

 addtask do_rootfs_wicenv after do_rootfs before do_image_wic

diff --git a/wic/ipc847e.wks b/wic/ipc847e.wks
index c1ae667..216cc06 100644
--- a/wic/ipc847e.wks
+++ b/wic/ipc847e.wks
@@ -10,7 +10,7 @@

 part --source bootimg-efi-isar --sourceparams "loader=grub-efi" --label efi --part-type EF00 --align 1024

-part / --source rootfs --fstype ext4 --label platform --align 1024 --use-uuid
+part / --source rootfs --fstype btrfs --label platform --align 1024 --use-uuid