use btrfs instead of ext4 with wic image

Message ID CAJGKYO5+xtMLnZKxhZ9oQacBFZUuaG85=-Acb-S+7UewhU1gMw@mail.gmail.com
State Not Applicable, archived
Headers show
Series use btrfs instead of ext4 with wic image | expand

Commit Message

Roberto A. Foglietta Sept. 20, 2022, 3:57 p.m. UTC
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"

To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/CAJGKYO5%2BxtMLnZKxhZ9oQacBFZUuaG85%3D-Acb-S%2B7UewhU1gMw%40mail.gmail.com.

Comments

Roberto A. Foglietta Sept. 21, 2022, 4:11 a.m. UTC | #1
Il giorno mar 20 set 2022 alle ore 17:57 Roberto A. Foglietta <
roberto.foglietta@gmail.com> ha scritto:

> 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.
>

This answer the question: add the tools into the wic imager, clean and
rebuild

diff --git a/recipes-core/images/eval-image-templte.bb
b/recipes-core/images/eval-image-templte.bb
index 380f9f9..30f689e 100644
--- a/recipes-core/images/eval-image-templte.bb
+++ b/recipes-core/images/eval-image-templte.bb
@@ -18,3 +18,5 @@ IMAGE_INSTALL += " customizations"
 IMAGE_INSTALL += " sshd-regen-keys"
 IMAGE_INSTALL += " expand-on-first-boot"
 IMAGE_INSTALL += " simatic-lsp-modules-${KERNEL_NAME}"
+
+WIC_IMAGER_INSTALL += "btrfs-progs"

Ciao, R-

Patch

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

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.