Skip to contentSkip to conversation

standalone wic

RFC PATCH In review Trevor Woerner 3 participants 20 messages Feb 2 – Feb 3 RISC-V

lore
Share & tools
lore
#0 lore raw

v2 cover standalone wic

This series of patches explores the possibility of splitting wic out from oe-core into its own standalone utility. The wic utility will continue to fall under The Yocto Project umbrella, but will no longer be integrated into the project as part of oe-core. The ultimate goal is to make wic a completely independent tool, hosted on PyPI, with its own tests, development roadmap, and releases.

Some benefits include:
- relieving the oe-core maintainers from having to review, understand, merge, or reject wic patches
- allow the tool to be used outside of The Yocto Project for generating Linux images
- provide more flexibility to explore other features, libraries, mechanisms, etc

The initial task of splitting wic out into its own repository was performed with the help of AI. It was checked, and subsequent work was done without AI.

These changes have been tested with oe-selftest as follows:

	$ sudo .../layers/openembedded-core/scripts/runqemu-gen-tapdevs <my numeric group id> 4
	$ oe-selftest -v -r wic

On my machine my oe-selftest results for an unmodified oe-core give:

	successes=93, skipped=1, failures=0, errors=1
with these patches I get:
	successes=91, skipped=1, failures=2, errors=0

There are 2 tests that need to be fixed, but it would be great to get some feedback on this work, and to see what the AB thinks of it so far. I have also done some adhoc testing with meta-rockchip and meta-raspberrypi.

Should this work eventually make its way to oe-core, it would need to be squashed into a single commit otherwise builds will break when only partially applied. They have been submitted here in this RFC series separately to make review easier.

Trevor Woerner (9):
remove wic
provide oe-core wks files
add wic recipe
oe-selftest/cases/wic.py: update WicTestCase oe-selftest -r wic.CLITests -> PASS oe-selftest -r wic.ModifyTests -> PASS (except 1) oe-selftest -r wic.Wic -> PASS
oe-selftest -r wic.Wic2 (non-runqemu) -> PASS oe-selftest -r wic.Wic2 (runqemu) -> PASS (mostly)

 meta/classes-recipe/image_types_wic.bbclass   |    8 +-
 meta/conf/distro/include/maintainers.inc      |    3 +-
 meta/lib/oeqa/selftest/cases/wic.py           |  360 ++---
 meta/recipes-core/meta/wic-tools.bb           |    1 +
 meta/recipes-support/wic/wic_0.3.0.bb         |   18 +
 .../canned-wks => meta/wic}/common.wks.inc    |    0
 .../wic}/directdisk-bootloader-config.cfg     |    0
 .../wic}/directdisk-bootloader-config.wks     |    0
 .../wic}/directdisk-gpt.wks                   |    0
 .../wic}/directdisk-multi-rootfs.wks          |    0
 .../canned-wks => meta/wic}/directdisk.wks    |    0
 .../wic}/efi-bootdisk.wks.in                  |    0
 .../wic}/efi-uki-bootdisk.wks.in              |    0
 .../wic/canned-wks => meta/wic}/mkefidisk.wks |    0
 .../canned-wks => meta/wic}/mkhybridiso.wks   |    0
 .../canned-wks => meta/wic}/qemuloongarch.wks |    0
 .../wic/canned-wks => meta/wic}/qemuriscv.wks |    0
 .../wic}/qemux86-directdisk.wks               |    0
 .../wic}/sdimage-bootpart.wks                 |    0
 .../wic}/systemd-bootdisk.wks                 |    0
 scripts/lib/wic/__init__.py                   |   10 -
 scripts/lib/wic/engine.py                     |  681 ----------
 scripts/lib/wic/filemap.py                    |  583 --------
 scripts/lib/wic/help.py                       | 1188 -----------------
 scripts/lib/wic/ksparser.py                   |  322 -----
 scripts/lib/wic/misc.py                       |  266 ----
 scripts/lib/wic/partition.py                  |  562 --------
 scripts/lib/wic/pluginbase.py                 |  144 --
 scripts/lib/wic/plugins/imager/direct.py      |  710 ----------
 .../wic/plugins/source/bootimg_biosplusefi.py |  213 ---
 scripts/lib/wic/plugins/source/bootimg_efi.py |  435 ------
 .../wic/plugins/source/bootimg_partition.py   |  162 ---
 .../lib/wic/plugins/source/bootimg_pcbios.py  |  483 -------
 scripts/lib/wic/plugins/source/empty.py       |   89 --
 .../lib/wic/plugins/source/extra_partition.py |  134 --
 .../wic/plugins/source/isoimage_isohybrid.py  |  463 -------
 scripts/lib/wic/plugins/source/rawcopy.py     |  115 --
 scripts/lib/wic/plugins/source/rootfs.py      |  236 ----
 scripts/wic                                   |  600 ---------
 39 files changed, 207 insertions(+), 7579 deletions(-)
 create mode 100644 meta/recipes-support/wic/wic_0.3.0.bb
 rename {scripts/lib/wic/canned-wks => meta/wic}/common.wks.inc (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/directdisk-bootloader-config.cfg (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/directdisk-bootloader-config.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/directdisk-gpt.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/directdisk-multi-rootfs.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/directdisk.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/efi-bootdisk.wks.in (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/efi-uki-bootdisk.wks.in (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/mkefidisk.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/mkhybridiso.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/qemuloongarch.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/qemuriscv.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/qemux86-directdisk.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/sdimage-bootpart.wks (100%)
 rename {scripts/lib/wic/canned-wks => meta/wic}/systemd-bootdisk.wks (100%)
 delete mode 100644 scripts/lib/wic/__init__.py
 delete mode 100644 scripts/lib/wic/engine.py
 delete mode 100644 scripts/lib/wic/filemap.py
 delete mode 100644 scripts/lib/wic/help.py
 delete mode 100644 scripts/lib/wic/ksparser.py
 delete mode 100644 scripts/lib/wic/misc.py
 delete mode 100644 scripts/lib/wic/partition.py
 delete mode 100644 scripts/lib/wic/pluginbase.py
 delete mode 100644 scripts/lib/wic/plugins/imager/direct.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_biosplusefi.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_efi.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_partition.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_pcbios.py
 delete mode 100644 scripts/lib/wic/plugins/source/empty.py
 delete mode 100644 scripts/lib/wic/plugins/source/extra_partition.py
 delete mode 100644 scripts/lib/wic/plugins/source/isoimage_isohybrid.py
 delete mode 100644 scripts/lib/wic/plugins/source/rawcopy.py
 delete mode 100644 scripts/lib/wic/plugins/source/rootfs.py
 delete mode 100755 scripts/wic
Signature · 1 line
2.51.0
#1 lore raw

RFC PATCH v2 1/9 remove wic

The wic utility will continue to fall under The Yocto Project umbrella, but will no longer be integrated into the project as part of oe-core. The ultimate goal is to make wic a completely independent tool, hosted on PyPI, with its own tests, development roadmap, and releases.

Some benefits include:
- relieving the oe-core maintainers from having to review, understand, merge, or reject wic patches
- allow the tool to be used outside of The Yocto Project for generating Linux images
- provide more flexibility to explore other features, libraries, mechanisms, etc

AI-Generated: AI was used to help with the initial split of wic from oe-core
AI-Tool: codex
AI-Model: gpt-5.1-codex-max

---
 scripts/lib/wic/__init__.py                   |   10 -
 scripts/lib/wic/canned-wks/common.wks.inc     |    3 -
 .../directdisk-bootloader-config.cfg          |   27 -
 .../directdisk-bootloader-config.wks          |    8 -
 scripts/lib/wic/canned-wks/directdisk-gpt.wks |   10 -
 .../canned-wks/directdisk-multi-rootfs.wks    |   23 -
 scripts/lib/wic/canned-wks/directdisk.wks     |    8 -
 .../lib/wic/canned-wks/efi-bootdisk.wks.in    |    3 -
 .../wic/canned-wks/efi-uki-bootdisk.wks.in    |    3 -
 scripts/lib/wic/canned-wks/mkefidisk.wks      |   11 -
 scripts/lib/wic/canned-wks/mkhybridiso.wks    |    7 -
 scripts/lib/wic/canned-wks/qemuloongarch.wks  |    3 -
 scripts/lib/wic/canned-wks/qemuriscv.wks      |    3 -
 .../lib/wic/canned-wks/qemux86-directdisk.wks |    8 -
 .../lib/wic/canned-wks/sdimage-bootpart.wks   |    6 -
 .../lib/wic/canned-wks/systemd-bootdisk.wks   |   11 -
 scripts/lib/wic/engine.py                     |  681 ----------
 scripts/lib/wic/filemap.py                    |  583 --------
 scripts/lib/wic/help.py                       | 1188 -----------------
 scripts/lib/wic/ksparser.py                   |  322 -----
 scripts/lib/wic/misc.py                       |  266 ----
 scripts/lib/wic/partition.py                  |  562 --------
 scripts/lib/wic/pluginbase.py                 |  144 --
 scripts/lib/wic/plugins/imager/direct.py      |  710 ----------
 .../wic/plugins/source/bootimg_biosplusefi.py |  213 ---
 scripts/lib/wic/plugins/source/bootimg_efi.py |  435 ------
 .../wic/plugins/source/bootimg_partition.py   |  162 ---
 .../lib/wic/plugins/source/bootimg_pcbios.py  |  483 -------
 scripts/lib/wic/plugins/source/empty.py       |   89 --
 .../lib/wic/plugins/source/extra_partition.py |  134 --
 .../wic/plugins/source/isoimage_isohybrid.py  |  463 -------
 scripts/lib/wic/plugins/source/rawcopy.py     |  115 --
 scripts/lib/wic/plugins/source/rootfs.py      |  236 ----
 scripts/wic                                   |  600 ---------
 34 files changed, 7530 deletions(-)
 delete mode 100644 scripts/lib/wic/__init__.py
 delete mode 100644 scripts/lib/wic/canned-wks/common.wks.inc
 delete mode 100644 scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg
 delete mode 100644 scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks
 delete mode 100644 scripts/lib/wic/canned-wks/directdisk-gpt.wks
 delete mode 100644 scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks
 delete mode 100644 scripts/lib/wic/canned-wks/directdisk.wks
 delete mode 100644 scripts/lib/wic/canned-wks/efi-bootdisk.wks.in
 delete mode 100644 scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in
 delete mode 100644 scripts/lib/wic/canned-wks/mkefidisk.wks
 delete mode 100644 scripts/lib/wic/canned-wks/mkhybridiso.wks
 delete mode 100644 scripts/lib/wic/canned-wks/qemuloongarch.wks
 delete mode 100644 scripts/lib/wic/canned-wks/qemuriscv.wks
 delete mode 100644 scripts/lib/wic/canned-wks/qemux86-directdisk.wks
 delete mode 100644 scripts/lib/wic/canned-wks/sdimage-bootpart.wks
 delete mode 100644 scripts/lib/wic/canned-wks/systemd-bootdisk.wks
 delete mode 100644 scripts/lib/wic/engine.py
 delete mode 100644 scripts/lib/wic/filemap.py
 delete mode 100644 scripts/lib/wic/help.py
 delete mode 100644 scripts/lib/wic/ksparser.py
 delete mode 100644 scripts/lib/wic/misc.py
 delete mode 100644 scripts/lib/wic/partition.py
 delete mode 100644 scripts/lib/wic/pluginbase.py
 delete mode 100644 scripts/lib/wic/plugins/imager/direct.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_biosplusefi.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_efi.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_partition.py
 delete mode 100644 scripts/lib/wic/plugins/source/bootimg_pcbios.py
 delete mode 100644 scripts/lib/wic/plugins/source/empty.py
 delete mode 100644 scripts/lib/wic/plugins/source/extra_partition.py
 delete mode 100644 scripts/lib/wic/plugins/source/isoimage_isohybrid.py
 delete mode 100644 scripts/lib/wic/plugins/source/rawcopy.py
 delete mode 100644 scripts/lib/wic/plugins/source/rootfs.py
 delete mode 100755 scripts/wic
scripts/lib/wic/__init__.py deleted +0 -10
deleted file mode 100644
index 85567934aea5..000000000000
@@ -1,10 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright (c) 2007 Red Hat, Inc.
-# Copyright (c) 2011 Intel, Inc.
-#
-# SPDX-License-Identifier: GPL-2.0-only
-#
-
-class WicError(Exception):
-    pass
scripts/lib/wic/canned-wks/common.wks.inc deleted +0 -3
deleted file mode 100644
index 4a440ddafe64..000000000000
@@ -1,3 +0,0 @@
-# This file is included into 3 canned wks files from this directory
-part /boot --source bootimg_pcbios --ondisk sda --label boot --active --align 1024
-part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
scripts/lib/wic/canned-wks/directdisk-bootloader-config.cfg deleted +0 -27
deleted file mode 100644
index c58e74a853cb..000000000000
@@ -1,27 +0,0 @@
-# This is an example configuration file for syslinux.
-TIMEOUT 50
-ALLOWOPTIONS 1
-SERIAL 0 115200
-PROMPT 0
-
-UI vesamenu.c32
-menu title Select boot options
-menu tabmsg Press [Tab] to edit, [Return] to select
-
-DEFAULT Graphics console boot
-
-LABEL Graphics console boot
-KERNEL /vmlinuz
-APPEND label=boot rootwait
-
-LABEL Serial console boot
-KERNEL /vmlinuz
-APPEND label=boot rootwait console=ttyS0,115200
-
-LABEL Graphics console install
-KERNEL /vmlinuz
-APPEND label=install rootwait
-
-LABEL Serial console install
-KERNEL /vmlinuz
-APPEND label=install rootwait console=ttyS0,115200
scripts/lib/wic/canned-wks/directdisk-bootloader-config.wks deleted +0 -8
deleted file mode 100644
index 3529e05c876e..000000000000
@@ -1,8 +0,0 @@
-# short-description: Create a 'pcbios' direct disk image with custom bootloader config
-# long-description: Creates a partitioned legacy BIOS disk image that the user
-# can directly dd to boot media. The bootloader configuration source is a user file.
-
-include common.wks.inc
-
-bootloader --configfile="directdisk-bootloader-config.cfg"
-
scripts/lib/wic/canned-wks/directdisk-gpt.wks deleted +0 -10
deleted file mode 100644
index cb640056f199..000000000000
@@ -1,10 +0,0 @@
-# short-description: Create a 'pcbios' direct disk image
-# long-description: Creates a partitioned legacy BIOS disk image that the user
-# can directly dd to boot media.
-
-
-part /boot --source bootimg_pcbios --ondisk sda --label boot --active --align 1024
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
-
-bootloader  --ptable gpt --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
-
scripts/lib/wic/canned-wks/directdisk-multi-rootfs.wks deleted +0 -23
deleted file mode 100644
index 4fd1999ffb69..000000000000
@@ -1,23 +0,0 @@
-# short-description: Create multi rootfs image using rootfs plugin
-# long-description: Creates a partitioned disk image with two rootfs partitions
-# using rootfs plugin.
-#
-# Partitions can use either
-#   - indirect rootfs references to image recipe(s):
-#     wic create directdisk-multi-indirect-recipes -e core-image-minimal \
-#         --rootfs-dir rootfs1=core-image-minimal
-#         --rootfs-dir rootfs2=core-image-minimal-dev
-#
-#   - or paths to rootfs directories:
-#     wic create directdisk-multi-rootfs \
-#         --rootfs-dir rootfs1=tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/
-#         --rootfs-dir rootfs2=tmp/work/qemux86_64-poky-linux/core-image-minimal-dev/1.0-r0/rootfs/
-#
-#   - or any combinations of -r and --rootfs command line options
-
-part /boot --source bootimg_pcbios --ondisk sda --label boot --active --align 1024
-part / --source rootfs --rootfs-dir=rootfs1 --ondisk sda --fstype=ext4 --label platform --align 1024
-part /rescue --source rootfs --rootfs-dir=rootfs2 --ondisk sda --fstype=ext4 --label secondary --align 1024
-
-bootloader  --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
-
scripts/lib/wic/canned-wks/directdisk.wks deleted +0 -8
deleted file mode 100644
index 8c8e06b02c66..000000000000
@@ -1,8 +0,0 @@
-# short-description: Create a 'pcbios' direct disk image
-# long-description: Creates a partitioned legacy BIOS disk image that the user
-# can directly dd to boot media.
-
-include common.wks.inc
-
-bootloader  --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
-
scripts/lib/wic/canned-wks/efi-bootdisk.wks.in deleted +0 -3
deleted file mode 100644
index 5211972955a5..000000000000
@@ -1,3 +0,0 @@
-bootloader --ptable gpt
-part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.2
-part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/
scripts/lib/wic/canned-wks/efi-uki-bootdisk.wks.in deleted +0 -3
deleted file mode 100644
index cac0fa32cdab..000000000000
@@ -1,3 +0,0 @@
-bootloader --ptable gpt --timeout=5
-part /boot --source bootimg_efi --sourceparams="loader=${EFI_PROVIDER}" --label boot --active --align 1024 --use-uuid --part-name="ESP" --part-type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B --overhead-factor=1
-part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/
scripts/lib/wic/canned-wks/mkefidisk.wks deleted +0 -11
deleted file mode 100644
index 16dfe76dfe27..000000000000
@@ -1,11 +0,0 @@
-# short-description: Create an EFI disk image
-# long-description: Creates a partitioned EFI disk image that the user
-# can directly dd to boot media.
-
-part /boot --source bootimg_efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
-
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
-
-part swap --ondisk sda --size 44 --label swap1 --fstype=swap
-
-bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=${KERNEL_CONSOLE} console=tty0"
scripts/lib/wic/canned-wks/mkhybridiso.wks deleted +0 -7
deleted file mode 100644
index c3a030e5b40e..000000000000
@@ -1,7 +0,0 @@
-# short-description: Create a hybrid ISO image
-# long-description: Creates an EFI and legacy bootable hybrid ISO image
-# which can be used on optical media as well as USB media.
-
-part /boot --source isoimage_isohybrid --sourceparams="loader=grub-efi,image_name=HYBRID_ISO_IMG" --ondisk cd --label HYBRIDISO
-
-bootloader  --timeout=15  --append=""
scripts/lib/wic/canned-wks/qemuloongarch.wks deleted +0 -3
deleted file mode 100644
index 8465c7a8c0a2..000000000000
@@ -1,3 +0,0 @@
-# short-description: Create qcow2 image for LoongArch QEMU machines
-
-part / --source rootfs --fstype=ext4 --label root --align 4096 --size 5G
scripts/lib/wic/canned-wks/qemuriscv.wks deleted +0 -3
deleted file mode 100644
index 12c68b706917..000000000000
@@ -1,3 +0,0 @@
-# short-description: Create qcow2 image for RISC-V QEMU machines
-
-part / --source rootfs --fstype=ext4 --label root --align 4096 --size 5G
scripts/lib/wic/canned-wks/qemux86-directdisk.wks deleted +0 -8
deleted file mode 100644
index 808997611a4a..000000000000
@@ -1,8 +0,0 @@
-# short-description: Create a qemu machine 'pcbios' direct disk image
-# long-description: Creates a partitioned legacy BIOS disk image that the user
-# can directly use to boot a qemu machine.
-
-include common.wks.inc
-
-bootloader  --timeout=0  --append="rw oprofile.timer=1 rootfstype=ext4 console=tty console=ttyS0 "
-
scripts/lib/wic/canned-wks/sdimage-bootpart.wks deleted +0 -6
deleted file mode 100644
index f9f8044f7dc4..000000000000
@@ -1,6 +0,0 @@
-# short-description: Create SD card image with a boot partition
-# long-description: Creates a partitioned SD card image. Boot files
-# are located in the first vfat partition.
-
-part /boot --source bootimg_partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16
-part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4
scripts/lib/wic/canned-wks/systemd-bootdisk.wks deleted +0 -11
deleted file mode 100644
index 3fb2c0e35f3a..000000000000
@@ -1,11 +0,0 @@
-# short-description: Create an EFI disk image with systemd-boot
-# long-description: Creates a partitioned EFI disk image that the user
-# can directly dd to boot media. The selected bootloader is systemd-boot.
-
-part /boot --source bootimg_efi --sourceparams="loader=systemd-boot" --ondisk sda --label msdos --active --align 1024 --use-uuid
-
-part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
-
-part swap --ondisk sda --size 44 --label swap1 --fstype=swap --use-uuid
-
-bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0"
scripts/lib/wic/engine.py deleted +0 -681

681 lines not on this page · raw message

scripts/lib/wic/filemap.py deleted +0 -583

583 lines not on this page · raw message

scripts/lib/wic/help.py deleted +0 -1188

1,188 lines not on this page · raw message

scripts/lib/wic/ksparser.py deleted +0 -322

322 lines not on this page · raw message

scripts/lib/wic/misc.py deleted +0 -266

82 lines not on this page · raw message

scripts/lib/wic/partition.py deleted +0 -562

562 lines not on this page · raw message

scripts/lib/wic/pluginbase.py deleted +0 -144

144 lines not on this page · raw message

scripts/lib/wic/plugins/imager/direct.py deleted +0 -710

710 lines not on this page · raw message

scripts/lib/wic/plugins/source/bootimg_biosplusefi.py deleted +0 -213

213 lines not on this page · raw message

scripts/lib/wic/plugins/source/bootimg_efi.py deleted +0 -435

435 lines not on this page · raw message

scripts/lib/wic/plugins/source/bootimg_partition.py deleted +0 -162

162 lines not on this page · raw message

scripts/lib/wic/plugins/source/bootimg_pcbios.py deleted +0 -483

483 lines not on this page · raw message

scripts/lib/wic/plugins/source/empty.py deleted +0 -89

89 lines not on this page · raw message

scripts/lib/wic/plugins/source/extra_partition.py deleted +0 -134

134 lines not on this page · raw message

scripts/lib/wic/plugins/source/isoimage_isohybrid.py deleted +0 -463

463 lines not on this page · raw message

scripts/lib/wic/plugins/source/rawcopy.py deleted +0 -115

115 lines not on this page · raw message

scripts/lib/wic/plugins/source/rootfs.py deleted +0 -236

236 lines not on this page · raw message

scripts/wic deleted +0 -600

600 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.51.0

Part of the diff is not shown here. View the raw message.

#2 lore raw

Patchtest results for [RFC][PATCH v2 1/9] remove wic

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/RFC-v2-1-9-remove-wic.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#3 lore raw

RFC PATCH v2 2/9 provide oe-core wks files

In reply to Trevor Woerner

By coded convention, wic will look for a "wic" directory in the top-level of all BBLAYERS in order to find *wks files. oe-core was the only exception; it stored its *wks files in scripts/lib/wic/canned-wks. Take the *wks, *wks.in, *inc, and *cfg files that were in the old wks location and place them in a "wic" top-level directory in the oe-core layer, thereby following the convention of every other layer.

---
 meta/classes-recipe/image_types_wic.bbclass |  2 +-
 meta/wic/common.wks.inc                     |  3 +++
 meta/wic/directdisk-bootloader-config.cfg   | 27 +++++++++++++++++++++
 meta/wic/directdisk-bootloader-config.wks   |  8 ++++++
 meta/wic/directdisk-gpt.wks                 | 10 ++++++++
 meta/wic/directdisk-multi-rootfs.wks        | 23 ++++++++++++++++++
 meta/wic/directdisk.wks                     |  8 ++++++
 meta/wic/efi-bootdisk.wks.in                |  3 +++
 meta/wic/efi-uki-bootdisk.wks.in            |  3 +++
 meta/wic/mkefidisk.wks                      | 11 +++++++++
 meta/wic/mkhybridiso.wks                    |  7 ++++++
 meta/wic/qemuloongarch.wks                  |  3 +++
 meta/wic/qemuriscv.wks                      |  3 +++
 meta/wic/qemux86-directdisk.wks             |  8 ++++++
 meta/wic/sdimage-bootpart.wks               |  6 +++++
 meta/wic/systemd-bootdisk.wks               | 11 +++++++++
 16 files changed, 135 insertions(+), 1 deletion(-)
 create mode 100644 meta/wic/common.wks.inc
 create mode 100644 meta/wic/directdisk-bootloader-config.cfg
 create mode 100644 meta/wic/directdisk-bootloader-config.wks
 create mode 100644 meta/wic/directdisk-gpt.wks
 create mode 100644 meta/wic/directdisk-multi-rootfs.wks
 create mode 100644 meta/wic/directdisk.wks
 create mode 100644 meta/wic/efi-bootdisk.wks.in
 create mode 100644 meta/wic/efi-uki-bootdisk.wks.in
 create mode 100644 meta/wic/mkefidisk.wks
 create mode 100644 meta/wic/mkhybridiso.wks
 create mode 100644 meta/wic/qemuloongarch.wks
 create mode 100644 meta/wic/qemuriscv.wks
 create mode 100644 meta/wic/qemux86-directdisk.wks
 create mode 100644 meta/wic/sdimage-bootpart.wks
 create mode 100644 meta/wic/systemd-bootdisk.wks
meta/classes-recipe/image_types_wic.bbclass +1 -1
index 675aa9751367..f2fd00e6d7ec 100644
@@ -45,7 +45,7 @@ inherit_defer ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifa
 
 WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
 WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
-WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/wic' % p for p in '${BBPATH}'.split(':'))}:${@':'.join('%s/scripts/lib/wic/canned-wks' % l for l in '${BBPATH}:${COREBASE}'.split(':'))}"
+WKS_SEARCH_PATH ?= "${THISDIR}:${@':'.join('%s/wic' % p for p in '${BBPATH}'.split(':'))}"
 WKS_FULL_PATH = "${@wks_search(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) or ''}"
 
 def wks_search(files, search_path):
meta/wic/common.wks.inc new file +3 -0
new file mode 100644
index 000000000000..4a440ddafe64
@@ -0,0 +1,3 @@
+# This file is included into 3 canned wks files from this directory
+part /boot --source bootimg_pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --use-uuid --fstype=ext4 --label platform --align 1024
meta/wic/directdisk-bootloader-config.cfg new file +27 -0
new file mode 100644
index 000000000000..c58e74a853cb
@@ -0,0 +1,27 @@
+# This is an example configuration file for syslinux.
+TIMEOUT 50
+ALLOWOPTIONS 1
+SERIAL 0 115200
+PROMPT 0
+
+UI vesamenu.c32
+menu title Select boot options
+menu tabmsg Press [Tab] to edit, [Return] to select
+
+DEFAULT Graphics console boot
+
+LABEL Graphics console boot
+KERNEL /vmlinuz
+APPEND label=boot rootwait
+
+LABEL Serial console boot
+KERNEL /vmlinuz
+APPEND label=boot rootwait console=ttyS0,115200
+
+LABEL Graphics console install
+KERNEL /vmlinuz
+APPEND label=install rootwait
+
+LABEL Serial console install
+KERNEL /vmlinuz
+APPEND label=install rootwait console=ttyS0,115200
meta/wic/directdisk-bootloader-config.wks new file +8 -0
new file mode 100644
index 000000000000..3529e05c876e
@@ -0,0 +1,8 @@
+# short-description: Create a 'pcbios' direct disk image with custom bootloader config
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media. The bootloader configuration source is a user file.
+
+include common.wks.inc
+
+bootloader --configfile="directdisk-bootloader-config.cfg"
+
meta/wic/directdisk-gpt.wks new file +10 -0
new file mode 100644
index 000000000000..cb640056f199
@@ -0,0 +1,10 @@
+# short-description: Create a 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media.
+
+
+part /boot --source bootimg_pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+bootloader  --ptable gpt --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
+
meta/wic/directdisk-multi-rootfs.wks new file +23 -0
new file mode 100644
index 000000000000..4fd1999ffb69
@@ -0,0 +1,23 @@
+# short-description: Create multi rootfs image using rootfs plugin
+# long-description: Creates a partitioned disk image with two rootfs partitions
+# using rootfs plugin.
+#
+# Partitions can use either
+#   - indirect rootfs references to image recipe(s):
+#     wic create directdisk-multi-indirect-recipes -e core-image-minimal \
+#         --rootfs-dir rootfs1=core-image-minimal
+#         --rootfs-dir rootfs2=core-image-minimal-dev
+#
+#   - or paths to rootfs directories:
+#     wic create directdisk-multi-rootfs \
+#         --rootfs-dir rootfs1=tmp/work/qemux86_64-poky-linux/core-image-minimal/1.0-r0/rootfs/
+#         --rootfs-dir rootfs2=tmp/work/qemux86_64-poky-linux/core-image-minimal-dev/1.0-r0/rootfs/
+#
+#   - or any combinations of -r and --rootfs command line options
+
+part /boot --source bootimg_pcbios --ondisk sda --label boot --active --align 1024
+part / --source rootfs --rootfs-dir=rootfs1 --ondisk sda --fstype=ext4 --label platform --align 1024
+part /rescue --source rootfs --rootfs-dir=rootfs2 --ondisk sda --fstype=ext4 --label secondary --align 1024
+
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
+
meta/wic/directdisk.wks new file +8 -0
new file mode 100644
index 000000000000..8c8e06b02c66
@@ -0,0 +1,8 @@
+# short-description: Create a 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly dd to boot media.
+
+include common.wks.inc
+
+bootloader  --timeout=0  --append="rootwait rootfstype=ext4 video=vesafb vga=0x318 console=tty0 console=ttyS0,115200n8"
+
meta/wic/efi-bootdisk.wks.in new file +3 -0
new file mode 100644
index 000000000000..5211972955a5
@@ -0,0 +1,3 @@
+bootloader --ptable gpt
+part /boot --source rootfs --rootfs-dir=${IMAGE_ROOTFS}/boot --fstype=vfat --label boot --active --align 1024 --use-uuid --overhead-factor 1.2
+part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/
meta/wic/efi-uki-bootdisk.wks.in new file +3 -0
new file mode 100644
index 000000000000..cac0fa32cdab
@@ -0,0 +1,3 @@
+bootloader --ptable gpt --timeout=5
+part /boot --source bootimg_efi --sourceparams="loader=${EFI_PROVIDER}" --label boot --active --align 1024 --use-uuid --part-name="ESP" --part-type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B --overhead-factor=1
+part / --source rootfs --fstype=ext4 --label root --align 1024 --exclude-path boot/
meta/wic/mkefidisk.wks new file +11 -0
new file mode 100644
index 000000000000..16dfe76dfe27
@@ -0,0 +1,11 @@
+# short-description: Create an EFI disk image
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media.
+
+part /boot --source bootimg_efi --sourceparams="loader=grub-efi" --ondisk sda --label msdos --active --align 1024
+
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap
+
+bootloader --ptable gpt --timeout=5 --append="rootfstype=ext4 console=${KERNEL_CONSOLE} console=tty0"
meta/wic/mkhybridiso.wks new file +7 -0
new file mode 100644
index 000000000000..c3a030e5b40e
@@ -0,0 +1,7 @@
+# short-description: Create a hybrid ISO image
+# long-description: Creates an EFI and legacy bootable hybrid ISO image
+# which can be used on optical media as well as USB media.
+
+part /boot --source isoimage_isohybrid --sourceparams="loader=grub-efi,image_name=HYBRID_ISO_IMG" --ondisk cd --label HYBRIDISO
+
+bootloader  --timeout=15  --append=""
meta/wic/qemuloongarch.wks new file +3 -0
new file mode 100644
index 000000000000..8465c7a8c0a2
@@ -0,0 +1,3 @@
+# short-description: Create qcow2 image for LoongArch QEMU machines
+
+part / --source rootfs --fstype=ext4 --label root --align 4096 --size 5G
meta/wic/qemuriscv.wks new file +3 -0
new file mode 100644
index 000000000000..12c68b706917
@@ -0,0 +1,3 @@
+# short-description: Create qcow2 image for RISC-V QEMU machines
+
+part / --source rootfs --fstype=ext4 --label root --align 4096 --size 5G
meta/wic/qemux86-directdisk.wks new file +8 -0
new file mode 100644
index 000000000000..808997611a4a
@@ -0,0 +1,8 @@
+# short-description: Create a qemu machine 'pcbios' direct disk image
+# long-description: Creates a partitioned legacy BIOS disk image that the user
+# can directly use to boot a qemu machine.
+
+include common.wks.inc
+
+bootloader  --timeout=0  --append="rw oprofile.timer=1 rootfstype=ext4 console=tty console=ttyS0 "
+
meta/wic/sdimage-bootpart.wks new file +6 -0
new file mode 100644
index 000000000000..f9f8044f7dc4
@@ -0,0 +1,6 @@
+# short-description: Create SD card image with a boot partition
+# long-description: Creates a partitioned SD card image. Boot files
+# are located in the first vfat partition.
+
+part /boot --source bootimg_partition --ondisk mmcblk0 --fstype=vfat --label boot --active --align 4 --size 16
+part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --label root --align 4
meta/wic/systemd-bootdisk.wks new file +11 -0
new file mode 100644
index 000000000000..3fb2c0e35f3a
@@ -0,0 +1,11 @@
+# short-description: Create an EFI disk image with systemd-boot
+# long-description: Creates a partitioned EFI disk image that the user
+# can directly dd to boot media. The selected bootloader is systemd-boot.
+
+part /boot --source bootimg_efi --sourceparams="loader=systemd-boot" --ondisk sda --label msdos --active --align 1024 --use-uuid
+
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024 --use-uuid
+
+part swap --ondisk sda --size 44 --label swap1 --fstype=swap --use-uuid
+
+bootloader --ptable gpt --timeout=5 --append="rootwait rootfstype=ext4 console=ttyS0,115200 console=tty0"
Signature · 1 line
2.51.0
#4 lore raw

Patchtest results for [RFC][PATCH v2 2/9] provide oe-core wks files

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/RFC-v2-2-9-provide-oe-core-wks-files.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#5 lore raw

RFC PATCH v2 3/9 add wic recipe

In reply to Trevor Woerner

Add a recipe to pull in the newly-externalized wic utility. Add wic to the list of native wic-tools, and make it a dependency of the image bbclass for wic images.

Add some bitbake variables to the default list of WICVARS that will likely be needed in the environment file when invoking wic.

---
 meta/classes-recipe/image_types_wic.bbclass |  6 ++++--
 meta/conf/distro/include/maintainers.inc    |  3 ++-
 meta/recipes-core/meta/wic-tools.bb         |  1 +
 meta/recipes-support/wic/wic_0.3.0.bb       | 18 ++++++++++++++++++
 4 files changed, 25 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-support/wic/wic_0.3.0.bb
meta/classes-recipe/image_types_wic.bbclass +4 -2
index f2fd00e6d7ec..693f49ddf608 100644
@@ -39,6 +39,8 @@ WICVARS ?= "\
 	STAGING_DIR_HOST \
 	STAGING_LIBDIR \
 	TARGET_SYS \
+	TOPDIR \
+	WIC_SECTOR_SIZE \
 "
 
 inherit_defer ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)}
@@ -111,14 +113,14 @@ do_image_wic[cleandirs] = "${WORKDIR}/build-wic"
 USING_WIC = "${@bb.utils.contains_any('IMAGE_FSTYPES', 'wic ' + ' '.join('wic.%s' % c for c in '${CONVERSIONTYPES}'.split()), '1', '', d)}"
 WKS_FILE_CHECKSUM = "${@wks_checksums(d.getVar('WKS_FILES').split(), d.getVar('WKS_SEARCH_PATH')) if '${USING_WIC}' else ''}"
 do_image_wic[file-checksums] += "${WKS_FILE_CHECKSUM}"
-do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('parted', 'gptfdisk', 'dosfstools', 'mtools'))}"
+do_image_wic[depends] += "${@' '.join('%s-native:do_populate_sysroot' % r for r in ('wic', 'parted', 'gptfdisk', 'dosfstools', 'mtools'))}"
 
 # We ensure all artfacts are deployed (e.g virtual/bootloader)
 do_image_wic[recrdeptask] += "do_deploy"
 do_image_wic[deptask] += "do_image_complete"
 
 WKS_FILE_DEPENDS_DEFAULT = '${@bb.utils.contains_any("BUILD_ARCH", [ 'x86_64', 'i686' ], "syslinux-native", "",d)}'
-WKS_FILE_DEPENDS_DEFAULT += "bmaptool-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native erofs-utils-native"
+WKS_FILE_DEPENDS_DEFAULT += "wic-native bmaptool-native cdrtools-native btrfs-tools-native squashfs-tools-native e2fsprogs-native erofs-utils-native"
 # Unified kernel images need objcopy
 WKS_FILE_DEPENDS_DEFAULT += "virtual/cross-binutils"
 WKS_FILE_DEPENDS_BOOTLOADERS = ""
meta/conf/distro/include/maintainers.inc +2 -1
index e830648945f3..22f974cae890 100644
@@ -885,7 +885,8 @@ RECIPE_MAINTAINER:pn-weston = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER:pn-weston-init = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER:pn-wget = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER:pn-which = "Unassigned <[email protected]>"
-RECIPE_MAINTAINER:pn-wic-tools = "Unassigned <[email protected]>"
+RECIPE_MAINTAINER:pn-wic = "Trevor Woerner <[email protected]>"
+RECIPE_MAINTAINER:pn-wic-tools = "Trevor Woerner <[email protected]>"
 RECIPE_MAINTAINER:pn-wireless-regdb = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-wpa-supplicant = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-wpebackend-fdo = "Unassigned <[email protected]>"
meta/recipes-core/meta/wic-tools.bb +1 -0
index fa983ed5f12c..45fb873dd6bd 100644
@@ -3,6 +3,7 @@ SUMMARY = "A meta recipe to build native tools used by wic."
 LICENSE = "MIT"
 
 DEPENDS = "\
+           wic-native \
            parted-native gptfdisk-native dosfstools-native \
            mtools-native bmaptool-native grub-native cdrtools-native \
            btrfs-tools-native squashfs-tools-native pseudo-native \
meta/recipes-support/wic/wic_0.3.0.bb new file +18 -0
new file mode 100644
index 000000000000..f0c58f527c70
@@ -0,0 +1,18 @@
+SUMMARY = "OpenEmbedded Image Creator (wic) standalone CLI"
+HOMEPAGE = "https://github.com/twoerner/wic"
+LICENSE = "GPL-2.0-only"
+LIC_FILES_CHKSUM = "file://LICENSE.GPL-2.0-only;md5=4ee23c52855c222cba72583d301d2338"
+
+SRC_URI = "git://github.com/twoerner/wic.git;branch=master;protocol=https"
+SRCREV = "c9305099546888d17b33c16e98bb2012e36d734a"
+
+inherit python_hatchling
+
+RDEPENDS:${PN} += " \
+    python3-core \
+    python3-json \
+    python3-logging \
+    python3-misc \
+    "
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.51.0
#6 lore raw

Patchtest results for [RFC][PATCH v2 3/9] add wic recipe

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/RFC-v2-3-9-add-wic-recipe.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)

PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#7 lore raw

RFC PATCH v2 4/9 oe-selftest/cases/wic.py: update WicTestCase

In reply to Trevor Woerner

The wic oe-selftest defines its own class, WicTestCase, for handling setup, teardown, and other pieces needed to run the individual wic oe-selftests. Now that wic is a tool external to oe-core, it, and the tools on which it depends, need to be built natively before the test can be run, need to be made available to the tests, and need to remain available while the test is running.

---
 meta/lib/oeqa/selftest/cases/wic.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)
meta/lib/oeqa/selftest/cases/wic.py +13 -0
index 958f1d084fd2..8eb0d3dcc464 100644
@@ -57,12 +57,24 @@ class WicTestCase(OESelftestTestCase):
 
     image_is_ready = False
     wicenv_cache = {}
+    oldpath = ""
+    pathPlusTools = ""
+    envfile = ""
 
     def setUpLocal(self):
         """This code is executed before each test method."""
         self.resultdir = os.path.join(self.builddir, "wic-tmp")
         super(WicTestCase, self).setUpLocal()
 
+        wic_tools_depends = get_bb_var("DEPENDS", "wic-tools")
+        config = 'DEPENDS:pn-core-image-minimal += " %s"' % wic_tools_depends
+        self.append_config(config)
+        bitbake('wic-tools core-image-minimal core-image-minimal-mtdutils')
+        WicTestCase.envfile = self._get_image_env_path('core-image-minimal') + "/core-image-minimal.env"
+        WicTestCase.oldpath = os.environ['PATH']
+        WicTestCase.pathPlusTools = get_bb_var("PATH", "wic-tools") + ":" + os.environ['PATH']
+        os.environ['PATH'] = WicTestCase.pathPlusTools
+
         # Do this here instead of in setUpClass as the base setUp does some
         # clean up which can result in the native tools built earlier in
         # setUpClass being unavailable.
@@ -78,6 +90,7 @@ class WicTestCase(OESelftestTestCase):
         """Remove resultdir as it may contain images."""
         rmtree(self.resultdir, ignore_errors=True)
         super(WicTestCase, self).tearDownLocal()
+        os.environ['PATH'] = WicTestCase.oldpath
 
     def _get_image_env_path(self, image):
         """Generate and obtain the path to <image>.env"""
Signature · 1 line
2.51.0
#8 lore raw

RFC PATCH v2 5/9 oe-selftest -r wic.CLITests -> PASS

In reply to Trevor Woerner

Changes for the wic.CLITests oe-selftests to pass now that wic is a stand-alone app and no longer part of oe-core.

Note that the base class for these tests had to change to WicTestCase so that the wic-native tool would be built and available.

---
 meta/lib/oeqa/selftest/cases/wic.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
meta/lib/oeqa/selftest/cases/wic.py +5 -5
index 8eb0d3dcc464..d8f89e79e7f2 100644
@@ -101,7 +101,7 @@ class WicTestCase(OESelftestTestCase):
             WicTestCase.wicenv_cache[image] = os.path.join(stdir, machine, 'imgdata')
         return WicTestCase.wicenv_cache[image]
 
-class CLITests(OESelftestTestCase):
+class CLITests(WicTestCase):
     def test_version(self):
         """Test wic --version"""
         runCmd('wic --version')
@@ -141,18 +141,18 @@ class CLITests(OESelftestTestCase):
 
     def test_list_images(self):
         """Test wic list images"""
-        runCmd('wic list images')
+        runCmd('wic list images --vars %s' % self.envfile)
 
     def test_list_source_plugins(self):
         """Test wic list source-plugins"""
-        runCmd('wic list source-plugins')
+        runCmd('wic list source-plugins --vars %s' % self.envfile)
 
     def test_listed_images_help(self):
         """Test wic listed images help"""
-        output = runCmd('wic list images').output
+        output = runCmd('wic list images --vars %s' % self.envfile).output
         imagelist = [line.split()[0] for line in output.splitlines()]
         for image in imagelist:
-            runCmd('wic list %s help' % image)
+            runCmd('wic list %s help --vars %s' % (image, self.envfile))
 
     def test_unsupported_subcommand(self):
         """Test unsupported subcommand"""
Signature · 1 line
2.51.0
#9 lore raw

Patchtest results for [RFC][PATCH v2 5/9] oe-selftest -r wic.CLITests -> PASS

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---

Testing patch /home/patchtest/share/mboxes/RFC-v2-5-9-oe-selftest--r-wic.CLITests---PASS.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#10 lore raw

RFC PATCH v2 6/9 oe-selftest -r wic.ModifyTests -> PASS (except 1)

In reply to Trevor Woerner

Changes for the wic.ModifyTests oe-selftests to pass now that wic is a stand-alone app and no longer part of oe-core.

NOTE: wic.ModifyTests.test_wic_cp_ext fails

---
 meta/lib/oeqa/selftest/cases/wic.py | 82 ++++++++++++++---------------
 1 file changed, 41 insertions(+), 41 deletions(-)
meta/lib/oeqa/selftest/cases/wic.py +41 -41
index d8f89e79e7f2..0dc17dcd5614 100644
@@ -1958,44 +1958,44 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
 class ModifyTests(WicTestCase):
     def test_wic_ls(self):
         """Test listing image content using 'wic ls'"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-D -o %s" % self.resultdir)
+                                   "-D -o %s" % (self.envfile, self.resultdir))
         images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
 
         # list partitions
-        result = runCmd("wic ls %s -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertEqual(3, len(result.output.split('\n')))
 
         # list directory content of the first partition
-        result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:1/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertEqual(6, len(result.output.split('\n')))
 
     def test_wic_cp(self):
         """Test copy files and directories to the the wic image."""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-D -o %s" % self.resultdir)
+                                   "-D -o %s" % (self.envfile, self.resultdir))
         images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
 
         # list directory content of the first partition
-        result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:1/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertEqual(6, len(result.output.split('\n')))
 
         with NamedTemporaryFile("w", suffix=".wic-cp") as testfile:
             testfile.write("test")
 
             # copy file to the partition
-            runCmd("wic cp %s %s:1/ -n %s" % (testfile.name, images[0], sysroot))
+            runCmd("wic cp %s %s:1/ -n %s --vars %s" % (testfile.name, images[0], sysroot, self.envfile))
 
             # check if file is there
-            result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+            result = runCmd("wic ls %s:1/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
             self.assertEqual(7, len(result.output.split('\n')))
             self.assertIn(os.path.basename(testfile.name), result.output)
 
@@ -2006,25 +2006,25 @@ class ModifyTests(WicTestCase):
             copy(testfile.name, testdir)
 
             # copy directory to the partition
-            runCmd("wic cp %s %s:1/ -n %s" % (testdir, images[0], sysroot))
+            runCmd("wic cp %s %s:1/ -n %s --vars %s" % (testdir, images[0], sysroot, self.envfile))
 
             # check if directory is there
-            result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))
+            result = runCmd("wic ls %s:1/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
             self.assertEqual(8, len(result.output.split('\n')))
             self.assertIn(os.path.basename(testdir), result.output)
 
             # copy the file from the partition and check if it success
             dest = '%s-cp' % testfile.name
-            runCmd("wic cp %s:1/%s %s -n %s" % (images[0],
-                    os.path.basename(testfile.name), dest, sysroot))
+            runCmd("wic cp %s:1/%s %s -n %s --vars %s" % (images[0],
+                    os.path.basename(testfile.name), dest, sysroot, self.envfile))
             self.assertTrue(os.path.exists(dest), msg="File %s wasn't generated as expected" % dest)
 
 
     def test_wic_rm(self):
         """Test removing files and directories from the the wic image."""
-        runCmd("wic create mkefidisk "
+        runCmd("wic create mkefidisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-D -o %s" % self.resultdir)
+                                   "-D -o %s" % (self.envfile, self.resultdir))
         images = glob(os.path.join(self.resultdir, "mkefidisk-*.direct"))
         self.assertEqual(1, len(images))
 
@@ -2033,48 +2033,48 @@ class ModifyTests(WicTestCase):
         kerneltype = get_bb_var('KERNEL_IMAGETYPE', 'virtual/kernel')
 
         # list directory content of the first partition
-        result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:1 -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertIn('\n%s ' % kerneltype.upper(), result.output)
         self.assertIn('\nEFI          <DIR>     ', result.output)
 
         # remove file. EFI partitions are case-insensitive so exercise that too
-        runCmd("wic rm %s:1/%s -n %s" % (images[0], kerneltype.lower(), sysroot))
+        runCmd("wic rm %s:1/%s -n %s --vars %s" % (images[0], kerneltype.lower(), sysroot, self.envfile))
 
         # remove directory
-        runCmd("wic rm %s:1/efi -n %s" % (images[0], sysroot))
+        runCmd("wic rm %s:1/efi -n %s --vars %s" % (images[0], sysroot, self.envfile))
 
         # check if they're removed
-        result = runCmd("wic ls %s:1 -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:1 -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertNotIn('\n%s        ' % kerneltype.upper(), result.output)
         self.assertNotIn('\nEFI          <DIR>     ', result.output)
 
     def test_wic_ls_ext(self):
         """Test listing content of the ext partition using 'wic ls'"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-D -o %s" % self.resultdir)
+                                   "-D -o %s" % (self.envfile, self.resultdir))
         images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
 
         # list directory content of the second ext4 partition
-        result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:2/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertTrue(set(['bin', 'home', 'proc', 'usr', 'var', 'dev', 'lib', 'sbin']).issubset(
                             set(line.split()[-1] for line in result.output.split('\n') if line)), msg="Expected directories not present %s" % result.output)
 
     def test_wic_cp_ext(self):
         """Test copy files and directories to the ext partition."""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-D -o %s" % self.resultdir)
+                                   "-D -o %s" % (self.envfile, self.resultdir))
         images = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
 
         # list directory content of the ext4 partition
-        result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:2/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
         dirs = set(line.split()[-1] for line in result.output.split('\n') if line)
         self.assertTrue(set(['bin', 'home', 'proc', 'usr', 'var', 'dev', 'lib', 'sbin']).issubset(dirs), msg="Expected directories not present %s" % dirs)
 
@@ -2082,20 +2082,20 @@ class ModifyTests(WicTestCase):
             testfile.write("test")
 
             # copy file to the partition
-            runCmd("wic cp %s %s:2/ -n %s" % (testfile.name, images[0], sysroot))
+            runCmd("wic cp %s %s:2/ -n %s --vars %s" % (testfile.name, images[0], sysroot, self.envfile))
 
             # check if file is there
-            result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+            result = runCmd("wic ls %s:2/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
             newdirs = set(line.split()[-1] for line in result.output.split('\n') if line)
             self.assertEqual(newdirs.difference(dirs), set([os.path.basename(testfile.name)]))
 
             # check if the file to copy is in the partition
-            result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
+            result = runCmd("wic ls %s:2/etc/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
             self.assertIn('fstab', [line.split()[-1] for line in result.output.split('\n') if line])
 
             # copy file from the partition, replace the temporary file content with it and
             # check for the file size to validate the copy
-            runCmd("wic cp %s:2/etc/fstab %s -n %s" % (images[0], testfile.name, sysroot))
+            runCmd("wic cp %s:2/etc/fstab %s -n %s --vars %s" % (images[0], testfile.name, sysroot, self.envfile))
             self.assertTrue(os.stat(testfile.name).st_size > 0, msg="Filesize not as expected %s" % os.stat(testfile.name).st_size)
 
             # prepare directory structure
@@ -2114,16 +2114,16 @@ class ModifyTests(WicTestCase):
                 f.write("sub-level\n")
 
             # copy directory to the partition root
-            runCmd("wic cp %s %s:2/ -n %s" % (testdir, images[0], sysroot))
+            runCmd("wic cp %s %s:2/ -n %s --vars %s" % (testdir, images[0], sysroot, self.envfile))
             basedir = os.path.basename(testdir)
 
             # check if directory is there at partition root
-            result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+            result = runCmd("wic ls %s:2/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
             root_entries = set(line.split()[-1] for line in result.output.split('\n') if line)
             self.assertIn(basedir, root_entries, msg="Expected directory not present at root: %s" % root_entries)
 
             # list INSIDE the copied directory
-            result = runCmd("wic ls %s:2/%s/ -n %s" % (images[0], basedir, sysroot))
+            result = runCmd("wic ls %s:2/%s/ -n %s --vars %s" % (images[0], basedir, sysroot, self.envfile))
             self.assertEqual(0, result.status,
                              msg="wic ls inside copied directory failed. Output:\n%s" % result.output)
             self.assertNotIn("Ext2 inode is not a directory", result.output,
@@ -2134,7 +2134,7 @@ class ModifyTests(WicTestCase):
                             msg="Expected entries missing inside dir: %s" % inside_entries)
 
             # list inside the subdir
-            result = runCmd("wic ls %s:2/%s/subdir/ -n %s" % (images[0], basedir, sysroot))
+            result = runCmd("wic ls %s:2/%s/subdir/ -n %s --vars %s" % (images[0], basedir, sysroot, self.envfile))
             self.assertEqual(0, result.status,
                              msg="wic ls inside copied subdir failed. Output:\n%s" % result.output)
             self.assertNotIn("Ext2 inode is not a directory", result.output,
@@ -2146,7 +2146,7 @@ class ModifyTests(WicTestCase):
             # copy directory from the partition and compare with original
             outparent = os.path.join(self.resultdir, "wic-test-cp-ext-out")
             os.makedirs(outparent)
-            runCmd("wic cp %s:2/%s %s -n %s" % (images[0], basedir, outparent, sysroot))
+            runCmd("wic cp %s:2/%s %s -n %s --vars %s" % (images[0], basedir, outparent, sysroot, self.envfile))
 
             copied_dir = os.path.join(outparent, basedir)
             self.assertTrue(os.path.isdir(copied_dir), msg="Copied-back directory not created: %s" % copied_dir)
@@ -2165,28 +2165,28 @@ class ModifyTests(WicTestCase):
 
     def test_wic_rm_ext(self):
         """Test removing files from the ext partition."""
-        runCmd("wic create mkefidisk "
+        runCmd("wic create mkefidisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-D -o %s" % self.resultdir)
+                                   "-D -o %s" % (self.envfile, self.resultdir))
         images = glob(os.path.join(self.resultdir, "mkefidisk-*.direct"))
         self.assertEqual(1, len(images))
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
 
         # list directory content of the /etc directory on ext4 partition
-        result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:2/etc/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertIn('fstab', [line.split()[-1] for line in result.output.split('\n') if line])
 
         # remove file
-        runCmd("wic rm %s:2/etc/fstab -n %s" % (images[0], sysroot))
+        runCmd("wic rm %s:2/etc/fstab -n %s --vars %s" % (images[0], sysroot, self.envfile))
 
         # check if it's removed
-        result = runCmd("wic ls %s:2/etc/ -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:2/etc/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertNotIn('fstab', [line.split()[-1] for line in result.output.split('\n') if line])
 
         # remove non-empty directory
-        runCmd("wic rm -r %s:2/etc/ -n %s" % (images[0], sysroot))
+        runCmd("wic rm -r %s:2/etc/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
 
         # check if it's removed
-        result = runCmd("wic ls %s:2/ -n %s" % (images[0], sysroot))
+        result = runCmd("wic ls %s:2/ -n %s --vars %s" % (images[0], sysroot, self.envfile))
         self.assertNotIn('etc', [line.split()[-1] for line in result.output.split('\n') if line])
Signature · 1 line
2.51.0
#11 lore raw

Patchtest results for [RFC][PATCH v2 6/9] oe-selftest -r wic.ModifyTests -> PASS (except 1)

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---

Testing patch /home/patchtest/share/mboxes/RFC-v2-6-9-oe-selftest--r-wic.ModifyTests---PASS-except-1.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#12 lore raw

RFC PATCH v2 7/9 oe-selftest -r wic.Wic -> PASS

In reply to Trevor Woerner

Changes for the wic.Wic oe-selftests to pass now that wic is a stand-alone app and no longer part of oe-core.

---
 meta/lib/oeqa/selftest/cases/wic.py | 176 +++++++++++++++-------------
 1 file changed, 94 insertions(+), 82 deletions(-)
meta/lib/oeqa/selftest/cases/wic.py +94 -82
index 0dc17dcd5614..3b24d0a5a645 100644
@@ -101,6 +101,12 @@ class WicTestCase(OESelftestTestCase):
             WicTestCase.wicenv_cache[image] = os.path.join(stdir, machine, 'imgdata')
         return WicTestCase.wicenv_cache[image]
 
+    def _create_image_env_file(self, image):
+        bitbake('%s -c rootfs_wicenv' % image)
+        stagingdir = get_bb_var('STAGING_DIR', image)
+        machine = self.td['MACHINE']
+        return os.path.join(stagingdir, machine, 'imgdata', image) + '.env'
+
 class CLITests(WicTestCase):
     def test_version(self):
         """Test wic --version"""
@@ -177,8 +183,8 @@ class Wic(WicTestCase):
             with TemporaryDirectory() as tmpdir:
                 img = 'core-image-minimal'
                 # build the image using the WKS file
-                cmd = "wic create %s -e %s -o %s" % (
-                    wks.name, img, self.resultdir)
+                cmd = "wic create %s -e %s -o %s --vars %s" % (
+                    wks.name, img, self.resultdir, self.envfile)
                 runCmd(cmd)
                 wksname = os.path.splitext(os.path.basename(wks.name))[0]
                 out = glob(os.path.join(
@@ -186,7 +192,7 @@ class Wic(WicTestCase):
                 self.assertEqual(1, len(out))
                 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
                 # extract the content of the disk image to the temporary directory
-                cmd = "wic cp %s:1 %s -n %s" % (out[0], tmpdir, sysroot)
+                cmd = "wic cp %s:1 %s -n %s --vars %s" % (out[0], tmpdir, sysroot, self.envfile)
                 runCmd(cmd)
                 # check if the kernel is installed or not
                 kimgtype = get_bb_var('KERNEL_IMAGETYPE', img)
@@ -210,14 +216,14 @@ class Wic(WicTestCase):
             with TemporaryDirectory() as tmpdir:
                 img = 'core-image-minimal'
                 # build the image using the WKS file
-                cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+                cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
                 runCmd(cmd)
                 wksname = os.path.splitext(os.path.basename(wks.name))[0]
                 out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname))
                 self.assertEqual(1, len(out))
                 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
                 # extract the content of the disk image to the temporary directory
-                cmd = "wic cp %s:1 %s -n %s" % (out[0], tmpdir, sysroot)
+                cmd = "wic cp %s:1 %s -n %s --vars %s" % (out[0], tmpdir, sysroot, self.envfile)
                 runCmd(cmd)
                 # check if the kernel is installed or not
                 kimgtype = get_bb_var('KERNEL_IMAGETYPE', img)
@@ -254,7 +260,7 @@ class Wic(WicTestCase):
                 bitbake(img)
                 self.remove_config(config)
 
-                cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+                cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
                 runCmd(cmd)
 
                 wksname = os.path.splitext(os.path.basename(wks.name))[0]
@@ -264,23 +270,23 @@ class Wic(WicTestCase):
                 sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
 
                 # Check if grub.cfg is installed
-                result = runCmd("wic ls %s:1/boot/grub -n %s" % (out[0], sysroot))
+                result = runCmd("wic ls %s:1/boot/grub -n %s --vars %s" % (out[0], sysroot, self.envfile))
                 self.assertIn('grub', result.output)
 
                 # Check if normal.mod is installed
-                result = runCmd("wic ls %s:1/boot/grub/i386-pc -n %s" % (out[0], sysroot))
+                result = runCmd("wic ls %s:1/boot/grub/i386-pc -n %s --vars %s" % (out[0], sysroot, self.envfile))
                 self.assertIn('normal', result.output)
 
     def test_build_image_name(self):
         """Test wic create wictestdisk --image-name=core-image-minimal"""
-        cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s" % self.resultdir
+        cmd = "wic create wictestdisk --image-name=core-image-minimal -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join (self.resultdir, "wictestdisk-*.direct"))))
 
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
     def test_gpt_image(self):
         """Test creation of core-image-minimal with gpt table and UUID boot"""
-        cmd = "wic create directdisk-gpt --image-name core-image-minimal -o %s" % self.resultdir
+        cmd = "wic create directdisk-gpt --image-name core-image-minimal -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-*.direct"))))
 
@@ -293,7 +299,7 @@ class Wic(WicTestCase):
         self.append_config(config)
         bitbake('core-image-minimal core-image-minimal-initramfs')
         self.remove_config(config)
-        cmd = "wic create mkhybridiso --image-name core-image-minimal -o %s" % self.resultdir
+        cmd = "wic create mkhybridiso --image-name core-image-minimal -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "HYBRID_ISO_IMG-*.direct"))))
         self.assertEqual(1, len(glob(os.path.join (self.resultdir, "HYBRID_ISO_IMG-*.iso"))))
@@ -301,14 +307,14 @@ class Wic(WicTestCase):
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
     def test_qemux86_directdisk(self):
         """Test creation of qemux-86-directdisk image"""
-        cmd = "wic create qemux86-directdisk -e core-image-minimal -o %s" % self.resultdir
+        cmd = "wic create qemux86-directdisk -e core-image-minimal -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "qemux86-directdisk-*direct"))))
 
     @skipIfNotArch(['i586', 'i686', 'x86_64', 'aarch64'])
     def test_mkefidisk(self):
         """Test creation of mkefidisk image"""
-        cmd = "wic create mkefidisk -e core-image-minimal -o %s" % self.resultdir
+        cmd = "wic create mkefidisk -e core-image-minimal -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "mkefidisk-*direct"))))
 
@@ -319,7 +325,7 @@ class Wic(WicTestCase):
         self.append_config(config)
         bitbake('core-image-minimal')
         self.remove_config(config)
-        cmd = "wic create directdisk-bootloader-config -e core-image-minimal -o %s" % self.resultdir
+        cmd = "wic create directdisk-bootloader-config -e core-image-minimal -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-bootloader-config-*direct"))))
 
@@ -330,26 +336,28 @@ class Wic(WicTestCase):
         self.append_config(config)
         bitbake('core-image-minimal')
         self.remove_config(config)
-        cmd = "wic create systemd-bootdisk -e core-image-minimal -o %s" % self.resultdir
+        cmd = "wic create systemd-bootdisk -e core-image-minimal -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "systemd-bootdisk-*direct"))))
 
     def test_efi_bootpart(self):
         """Test creation of efi-bootpart image"""
-        cmd = "wic create mkefidisk -e core-image-minimal -o %s" % self.resultdir
         kimgtype = get_bb_var('KERNEL_IMAGETYPE', 'core-image-minimal')
         self.append_config('IMAGE_EFI_BOOT_FILES = "%s;kernel"\n' % kimgtype)
+        envvars = self._create_image_env_file('core-image-minimal')
+        cmd = "wic create mkefidisk -e core-image-minimal -o %s --vars %s" % (self.resultdir, envvars)
         runCmd(cmd)
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
         images = glob(os.path.join(self.resultdir, "mkefidisk-*.direct"))
-        result = runCmd("wic ls %s:1/ -n %s" % (images[0], sysroot))       
+        result = runCmd("wic ls %s:1/ -n %s --vars %s" % (images[0], sysroot, envvars))
         self.assertIn("kernel",result.output)
 
     def test_sdimage_bootpart(self):
         """Test creation of sdimage-bootpart image"""
-        cmd = "wic create sdimage-bootpart -e core-image-minimal -o %s" % self.resultdir
         kimgtype = get_bb_var('KERNEL_IMAGETYPE', 'core-image-minimal')
-        self.write_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
+        self.append_config('IMAGE_BOOT_FILES = "%s"\n' % kimgtype)
+        envvars = self._create_image_env_file('core-image-minimal')
+        cmd = "wic create sdimage-bootpart -e core-image-minimal -o %s --vars %s" % (self.resultdir, envvars)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "sdimage-bootpart-*direct"))))
 
@@ -363,7 +371,7 @@ class Wic(WicTestCase):
         self.append_config(config)
         bitbake('core-image-minimal')
         self.remove_config(config)
-        cmd = "wic create directdisk -e core-image-minimal"
+        cmd = "wic create directdisk -e core-image-minimal --vars %s" % self.envfile
         runCmd(cmd)
         self.assertEqual(1, len(glob("directdisk-*.direct")))
 
@@ -376,97 +384,99 @@ class Wic(WicTestCase):
                                    'core-image-minimal'))
         bbvars = {key.lower(): value for key, value in bb_vars.items()}
         bbvars['resultdir'] = self.resultdir
+        bbvars['envfile'] = self.envfile
         runCmd("wic create directdisk "
                         "-b %(staging_datadir)s "
                         "-k %(deploy_dir_image)s "
                         "-n %(recipe_sysroot_native)s "
                         "-r %(image_rootfs)s "
-                        "-o %(resultdir)s" % bbvars)
+                        "-o %(resultdir)s "
+                        "-v %(envfile)s" % bbvars)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-*.direct"))))
 
     def test_compress_gzip(self):
         """Test compressing an image with gzip"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name core-image-minimal "
-                                   "-c gzip -o %s" % self.resultdir)
+                                   "-c gzip -o %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct.gz"))))
 
     def test_compress_bzip2(self):
         """Test compressing an image with bzip2"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-c bzip2 -o %s" % self.resultdir)
+                                   "-c bzip2 -o %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct.bz2"))))
 
     def test_compress_xz(self):
         """Test compressing an image with xz"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "--compress-with=xz -o %s" % self.resultdir)
+                                   "--compress-with=xz -o %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct.xz"))))
 
     def test_wrong_compressor(self):
         """Test how wic breaks if wrong compressor is provided"""
-        self.assertEqual(2, runCmd("wic create wictestdisk "
+        self.assertEqual(2, runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-c wrong -o %s" % self.resultdir,
+                                   "-c wrong -o %s" % (self.envfile, self.resultdir),
                                    ignore_status=True).status)
 
     def test_debug_short(self):
         """Test -D option"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-D -o %s" % self.resultdir)
+                                   "-D -o %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "tmp.wic*"))))
 
     def test_debug_long(self):
         """Test --debug option"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "--debug -o %s" % self.resultdir)
+                                   "--debug -o %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "tmp.wic*"))))
 
     def test_skip_build_check_short(self):
         """Test -s option"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
-                                   "-s -o %s" % self.resultdir)
+                                   "-s -o %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
     def test_skip_build_check_long(self):
         """Test --skip-build-check option"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
                                    "--skip-build-check "
-                                   "--outdir %s" % self.resultdir)
+                                   "--outdir %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
     def test_build_rootfs_short(self):
         """Test -f option"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk -v %s "
                                    "--image-name=core-image-minimal "
-                                   "-f -o %s" % self.resultdir)
+                                   "-f -o %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
     def test_build_rootfs_long(self):
         """Test --build-rootfs option"""
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name=core-image-minimal "
                                    "--build-rootfs "
-                                   "--outdir %s" % self.resultdir)
+                                   "--outdir %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))))
 
     # TODO this doesn't have to be x86-specific
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
     def test_rootfs_indirect_recipes(self):
         """Test usage of rootfs plugin with rootfs recipes"""
-        runCmd("wic create directdisk-multi-rootfs "
+        runCmd("wic create directdisk-multi-rootfs --vars %s "
                         "--image-name=core-image-minimal "
                         "--rootfs rootfs1=core-image-minimal "
                         "--rootfs rootfs2=core-image-minimal "
-                        "--outdir %s" % self.resultdir)
+                        "--outdir %s" % (self.envfile, self.resultdir))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "directdisk-multi-rootfs*.direct"))))
 
     # TODO this doesn't have to be x86-specific
@@ -480,7 +490,8 @@ class Wic(WicTestCase):
         bbvars = {key.lower(): value for key, value in bb_vars.items()}
         bbvars['wks'] = "directdisk-multi-rootfs"
         bbvars['resultdir'] = self.resultdir
-        runCmd("wic create %(wks)s "
+        bbvars['envfile'] = self.envfile
+        runCmd("wic create %(wks)s --vars %(envfile)s "
                         "--bootimg-dir=%(staging_datadir)s "
                         "--kernel-dir=%(deploy_dir_image)s "
                         "--native-sysroot=%(recipe_sysroot_native)s "
@@ -505,8 +516,8 @@ part /usr --source rootfs --ondisk mmcblk0 --fstype=ext4 --rootfs-dir %s/usr
 part /etc --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/ --rootfs-dir %s/usr
 part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoami --rootfs-dir %s/usr"""
                           % (rootfs_dir, rootfs_dir, rootfs_dir))
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
+            runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                       % (wks_file, self.resultdir, self.envfile))
 
             os.remove(wks_file)
             wicout = glob(os.path.join(self.resultdir, "%s-*direct" % 'temp'))
@@ -622,7 +633,7 @@ part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoa
         machine = bb_vars['MACHINE']
         nativesysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
         wicout = glob(os.path.join(deploy_dir, "core-image-minimal-%s.rootfs-*.wic" % machine))[0]
-        size_of_root_partition = int(runCmd("wic ls %s --native-sysroot %s" % (wicout, nativesysroot)).output.split('\n')[2].split()[3])
+        size_of_root_partition = int(runCmd("wic ls %s --native-sysroot %s --vars %s" % (wicout, nativesysroot, self.envfile)).output.split('\n')[2].split()[3])
         self.assertGreater(size_of_root_partition, 500000000)
 
     def test_include_path(self):
@@ -643,8 +654,8 @@ part /mnt --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path bin/whoa
 part /part1 --source rootfs --ondisk mmcblk0 --fstype=ext4
 part /part2 --source rootfs --ondisk mmcblk0 --fstype=ext4 --include-path %s"""
                           % (include_path))
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
+            runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                       % (wks_file, self.resultdir, self.envfile))
 
             part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
             part2 = glob(os.path.join(self.resultdir, 'temp-*.direct.p2'))[0]
@@ -680,8 +691,8 @@ part /part2 --source rootfs --ondisk mmcblk0 --fstype=ext4 --include-path %s"""
                 wks.write("""
 part / --source rootfs  --fstype=ext4 --include-path %s --include-path core-image-minimal-mtdutils export/"""
                           % (include_path))
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
+            runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                       % (wks_file, self.resultdir, self.envfile))
 
             part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
 
@@ -705,22 +716,22 @@ part / --source rootfs  --fstype=ext4 --include-path %s --include-path core-imag
         # Absolute argument.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --fstype=ext4 --include-path core-image-minimal-mtdutils /export")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
         # Argument pointing to parent directory.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --fstype=ext4 --include-path core-image-minimal-mtdutils ././..")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
         # 3 Argument pointing to parent directory.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --fstype=ext4 --include-path core-image-minimal-mtdutils export/ dummy")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
     def test_exclude_path_errors(self):
@@ -730,15 +741,15 @@ part / --source rootfs  --fstype=ext4 --include-path %s --include-path core-imag
         # Absolute argument.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path /usr")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
         # Argument pointing to parent directory.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --ondisk mmcblk0 --fstype=ext4 --exclude-path ././..")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
     def test_permissions(self):
@@ -773,8 +784,8 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
                 wks_file = os.path.join(include_path, 'temp.wks')
                 with open(wks_file, 'w') as wks:
                     wks.write(test)
-                runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
+                runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                       % (wks_file, self.resultdir, self.envfile))
 
                 for part in glob(os.path.join(self.resultdir, 'temp-*.direct.p*')):
                     res = runCmd("debugfs -R 'ls -p' %s" % (part), stderr=subprocess.PIPE)
@@ -810,8 +821,8 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
             wks_file = os.path.join(include_path, 'temp.wks')
             with open(wks_file, 'w') as wks:
                 wks.write("part /etc --source rootfs --fstype=ext4 --change-directory=etc")
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
+            runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                       % (wks_file, self.resultdir, self.envfile))
 
             part1 = glob(os.path.join(self.resultdir, 'temp-*.direct.p1'))[0]
 
@@ -829,15 +840,15 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
         # Absolute argument.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --fstype=ext4 --change-directory /usr")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
         # Argument pointing to parent directory.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --fstype=ext4 --change-directory ././..")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
     def test_no_fstab_update(self):
@@ -860,8 +871,8 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
                 wks.writelines(['part / --source rootfs --fstype=ext4 --label rootfs\n',
                                 'part /mnt/p2 --source rootfs --rootfs-dir=core-image-minimal ',
                                 '--fstype=ext4 --label p2 --no-fstab-update\n'])
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
+            runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                       % (wks_file, self.resultdir, self.envfile))
 
             part_fstab_md5sum = []
             for i in range(1, 3):
@@ -886,23 +897,23 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
         # Absolute argument.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update /etc")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
         # Argument pointing to parent directory.
         with open(wks_file, 'w') as wks:
             wks.write("part / --source rootfs --fstype=ext4 --no-fstab-update ././..")
-        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s" \
-                                      % (wks_file, self.resultdir), ignore_status=True).status)
+        self.assertNotEqual(0, runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                      % (wks_file, self.resultdir, self.envfile), ignore_status=True).status)
         os.remove(wks_file)
 
     def test_extra_space(self):
         """Test --extra-space wks option."""
         extraspace = 1024**3
-        runCmd("wic create wictestdisk "
+        runCmd("wic create wictestdisk --vars %s "
                                    "--image-name core-image-minimal "
-                                   "--extra-space %i -o %s" % (extraspace ,self.resultdir))
+                                   "--extra-space %i -o %s" % (self.envfile, extraspace ,self.resultdir))
         wicout = glob(os.path.join(self.resultdir, "wictestdisk-*.direct"))
         self.assertEqual(1, len(wicout))
         size = os.path.getsize(wicout[0])
@@ -915,7 +926,7 @@ part /etc --source rootfs --fstype=ext4 --change-directory=etc
         # Absolute argument.
         with open(wks_file, 'w') as wks:
             wks.write("part testspace --no-table --fixed-size 16k --offset 4080k")
-        runCmd("wic create %s --image-name core-image-minimal -o %s" % (wks_file, self.resultdir))
+        runCmd("wic create %s --image-name core-image-minimal -o %s --vars %s" % (wks_file, self.resultdir, self.envfile))
 
         wicout = glob(os.path.join(self.resultdir, "*.*"))
 
@@ -936,8 +947,8 @@ part / --source rootfs --fstype=ext4
 part / --source rootfs --fstype=ext4 --hidden
 bootloader --ptable gpt""")
 
-            runCmd("wic create %s -e core-image-minimal -o %s" \
-                                       % (wks_file, self.resultdir))
+            runCmd("wic create %s -e core-image-minimal -o %s --vars %s" \
+                                       % (wks_file, self.resultdir, self.envfile))
             wicout = os.path.join(self.resultdir, "*.direct")
 
             result = runCmd("%s/usr/sbin/sfdisk --part-attrs %s 1" % (sysroot, wicout))
@@ -960,6 +971,7 @@ bootloader --ptable gpt""")
                      'WICVARS:append = " WIC_SECTOR_SIZE"\n'
             self.append_config(config)
             bitbake('core-image-minimal')
+            envvars = self._create_image_env_file('core-image-minimal')
 
             # Check WIC_SECTOR_SIZE apply to bitbake variable
             wic_sector_size_str = get_bb_var('WIC_SECTOR_SIZE', 'core-image-minimal')
@@ -974,7 +986,7 @@ bootloader --ptable gpt""")
                      'part --fstype ext4 --source rootfs --label rofs-a --mkfs-extraopts "-b 4096"\n',
                      'part --fstype ext4 --source rootfs --use-uuid --mkfs-extraopts "-b 4096"\n'])
                 wks.flush()
-                cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir)
+                cmd = "wic create %s -e core-image-minimal -o %s --vars %s" % (wks.name, self.resultdir, envvars)
                 runCmd(cmd)
                 wksname = os.path.splitext(os.path.basename(wks.name))[0]
                 images = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
@@ -982,7 +994,7 @@ bootloader --ptable gpt""")
 
             sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
             # list partitions
-            result = runCmd("wic ls %s -n %s" % (images[0], sysroot))
+            result = runCmd("wic ls %s -n %s --vars %s" % (images[0], sysroot, envvars))
             self.assertEqual(3, len(result.output.split('\n')))
 
             # verify partition size with wic
Signature · 1 line
2.51.0
#13 lore raw

Patchtest results for [RFC][PATCH v2 7/9] oe-selftest -r wic.Wic -> PASS

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---

Testing patch /home/patchtest/share/mboxes/RFC-v2-7-9-oe-selftest--r-wic.Wic---PASS.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#14 lore raw

RFC PATCH v2 8/9 oe-selftest -r wic.Wic2 (non-runqemu) -> PASS

In reply to Trevor Woerner

Changes for the wic.Wic2 non-runqemu oe-selftests to pass now that wic is a stand-alone app and no longer part of oe-core.

NOTE: the wic.Wic2.test_sparse_copy test was deleted since it tests a
submodule of the wic project itself and therefore should be tested in the wic project itself, instead of in oe-core

---
 meta/lib/oeqa/selftest/cases/wic.py | 70 ++++++++++-------------------
 1 file changed, 23 insertions(+), 47 deletions(-)
meta/lib/oeqa/selftest/cases/wic.py +23 -47
index 3b24d0a5a645..b35dbd9fb348 100644
@@ -1020,14 +1020,14 @@ class Wic2(WicTestCase):
 
     def test_bmap_short(self):
         """Test generation of .bmap file -m option"""
-        cmd = "wic create wictestdisk -e core-image-minimal -m -o %s" % self.resultdir
+        cmd = "wic create wictestdisk -e core-image-minimal -m -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct"))))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct.bmap"))))
 
     def test_bmap_long(self):
         """Test generation of .bmap file --bmap option"""
-        cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s" % self.resultdir
+        cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s --vars %s" % (self.resultdir, self.envfile)
         runCmd(cmd)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct"))))
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "wictestdisk-*direct.bmap"))))
@@ -1045,7 +1045,7 @@ class Wic2(WicTestCase):
 
         wicvars = set(bb_vars['WICVARS'].split())
         # filter out optional variables
-        wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES',
+        wicvars = wicvars.difference(('DEPLOY_DIR_IMAGE', 'IMAGE_BOOT_FILES', 'WIC_SECTOR_SIZE',
                                       'INITRD', 'INITRD_LIVE', 'ISODIR','INITRAMFS_IMAGE',
                                       'INITRAMFS_IMAGE_BUNDLE', 'INITRAMFS_LINK_NAME',
                                       'APPEND', 'IMAGE_EFI_BOOT_FILES', 'IMAGE_EXTRA_PARTITION_FILES'))
@@ -1090,6 +1090,7 @@ class Wic2(WicTestCase):
         config = 'IMAGE_FSTYPES += "wic"\nWKS_FILE = "wic-image-minimal"\n'\
                  'MACHINE_FEATURES:append = " efi"\n'
         image_recipe_append = """
+DEPENDS:append = " wic-native"
 do_image_wic[postfuncs] += "run_wic_cmd"
 run_wic_cmd() {
     echo "test" >> ${WORKDIR}/test.wic-cp
@@ -1111,7 +1112,7 @@ run_wic_cmd() {
 
         sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
         # check if file is there
-        result = runCmd("wic ls %s:1/ -n %s" % (prefix+"wic", sysroot))
+        result = runCmd("wic ls %s:1/ -n %s --vars %s" % (prefix+"wic", sysroot, self.envfile))
         self.assertIn("test.wic-cp", result.output)
 
         # check if we have result image and manifests symlinks
@@ -1194,7 +1195,7 @@ run_wic_cmd() {
         return wkspath
 
     def _get_wic(self, wkspath, ignore_status=False):
-        p = runCmd("wic create %s -e core-image-minimal -o %s" % (wkspath, self.resultdir),
+        p = runCmd("wic create %s -e core-image-minimal -o %s --vars %s" % (wkspath, self.resultdir, self.envfile),
                    ignore_status=ignore_status)
 
         if p.status:
@@ -1435,7 +1436,7 @@ run_wic_cmd() {
             wks.write('part / --source rawcopy --sourceparams="file=%s.%s%s"\n'\
                       % (bb_vars['IMAGE_LINK_NAME'], fstype, params))
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, image, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, image, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
@@ -1471,7 +1472,7 @@ run_wic_cmd() {
 
         # Fstype column from 'wic ls' should be empty for the second partition
         # as listed in test_empty_plugin.wks
-        result = runCmd("wic ls %s -n %s | awk -F ' ' '{print $1 \" \" $5}' | grep '^2' | wc -w" % (image_path, sysroot))
+        result = runCmd("wic ls %s -n %s -v %s| awk -F ' ' '{print $1 \" \" $5}' | grep '^2' | wc -w" % (image_path, sysroot, self.envfile))
         self.assertEqual('1', result.output)
 
     @skipIfNotArch(['i586', 'i686', 'x86_64'])
@@ -1528,7 +1529,7 @@ run_wic_cmd() {
                             'part / --source rootfs --fstype=ext4 --align 1024 --use-uuid\n'\
                             'bootloader --timeout=0 --append="console=ttyS0,115200n8"\n'])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname))
@@ -1540,6 +1541,7 @@ run_wic_cmd() {
         config = 'IMAGE_EFI_BOOT_FILES="/etc/fstab;testfile"\nIMAGE_FSTYPES = "wic"\nWKS_FILE = "test_uefikernel.wks"\nMACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
         bitbake('core-image-minimal')
+        envvars = self._create_image_env_file('core-image-minimal')
         self.remove_config(config)
 
         img = 'core-image-minimal'
@@ -1548,7 +1550,7 @@ run_wic_cmd() {
                             'part / --source rootfs --fstype=ext4 --align 1024 --use-uuid\n'\
                             'bootloader --timeout=0 --append="console=ttyS0,115200n8"\n'])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, envvars)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*.direct" % wksname))
@@ -1692,6 +1694,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
         "
         """)
         self.append_config(config)
+        self.envfile = self._create_image_env_file('core-image-minimal')
 
         deploy_dir = get_bb_var('DEPLOY_DIR_IMAGE')
 
@@ -1715,11 +1718,11 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
                 wks.flush()
                 _, wicimg = self._get_wic(wks.name)
 
-                result = runCmd("wic ls %s | wc -l" % wicimg)
+                result = runCmd("wic ls %s -v %s | wc -l" % (wicimg, self.envfile))
                 self.assertEqual('4', result.output, msg="Expect 3 partitions, not %s" % result.output)
 
                 for part, file in enumerate(["foo.conf", "foobar.conf", "bar.conf"]):
-                    result = runCmd("wic ls %s:%d | grep -q \"%s\"" % (wicimg, part + 1, file))
+                    result = runCmd("wic ls %s:%d -v %s| grep -q \"%s\"" % (wicimg, part + 1, self.envfile, file))
                     self.assertEqual(0, result.status, msg="File '%s' not found in the partition #%d" % (file, part))
 
             self.remove_config(config)
@@ -1740,7 +1743,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
                             'part emptyext2   --fstype ext2   --size 1M\n',
                             'part emptybtrfs  --fstype btrfs  --size 150M\n'])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
@@ -1752,7 +1755,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
             wks.writelines(['part / --fstype ext3 --source rootfs --system-id 0xFF '\
                             '--overhead-factor 1.2 --size 100k\n'])
             wks.flush()
-            cmd = "wic create %s -e core-image-minimal -o %s" % (wks.name, self.resultdir)
+            cmd = "wic create %s -e core-image-minimal -o %s --vars %s" % (wks.name, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
@@ -1761,41 +1764,14 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
     def test_image_bootpart_globbed(self):
         """Test globbed sources with image-bootpart plugin"""
         img = "core-image-minimal"
-        cmd = "wic create sdimage-bootpart -e %s -o %s" % (img, self.resultdir)
         config = 'IMAGE_BOOT_FILES = "%s*"' % get_bb_var('KERNEL_IMAGETYPE', img)
         self.append_config(config)
+        envvars = self._create_image_env_file('core-image-minimal')
+        cmd = "wic create sdimage-bootpart -e %s -o %s --vars %s" % (img, self.resultdir, envvars)
         runCmd(cmd)
         self.remove_config(config)
         self.assertEqual(1, len(glob(os.path.join(self.resultdir, "sdimage-bootpart-*direct"))))
 
-    def test_sparse_copy(self):
-        """Test sparse_copy with FIEMAP and SEEK_HOLE filemap APIs"""
-        libpath = os.path.join(self.td['COREBASE'], 'scripts', 'lib', 'wic')
-        sys.path.insert(0, libpath)
-        from  filemap import FilemapFiemap, FilemapSeek, sparse_copy, ErrorNotSupp
-        with NamedTemporaryFile("w", suffix=".wic-sparse") as sparse:
-            src_name = sparse.name
-            src_size = 1024 * 10
-            sparse.truncate(src_size)
-            # write one byte to the file
-            with open(src_name, 'r+b') as sfile:
-                sfile.seek(1024 * 4)
-                sfile.write(b'\x00')
-            dest = sparse.name + '.out'
-            # copy src file to dest using different filemap APIs
-            for api in (FilemapFiemap, FilemapSeek, None):
-                if os.path.exists(dest):
-                    os.unlink(dest)
-                try:
-                    sparse_copy(sparse.name, dest, api=api)
-                except ErrorNotSupp:
-                    continue # skip unsupported API
-                dest_stat = os.stat(dest)
-                self.assertEqual(dest_stat.st_size, src_size)
-                # 8 blocks is 4K (physical sector size)
-                self.assertEqual(dest_stat.st_blocks, 8)
-            os.unlink(dest)
-
     def test_mkfs_extraopts(self):
         """Test wks option --mkfs-extraopts for empty and not empty partitions"""
         img = 'core-image-minimal'
@@ -1809,7 +1785,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
                  'part emptyext2   --fstype ext2   --size 1M --mkfs-extraopts "-D -F -i 8192"\n',
                  'part emptybtrfs  --fstype btrfs  --size 100M --mkfs-extraopts "--mixed -K"\n'])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
@@ -1908,7 +1884,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
                  'part empty --source empty --sourceparams="size=2048k,bs=512K" --ondisk sda --size 4M --align 1024\n'
                  ])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             wicout = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
@@ -1926,7 +1902,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
         with NamedTemporaryFile("w", suffix=".wks") as wks:
             wks.writelines(['part empty --source empty --sourceparams="fill" --ondisk sda --size 1M\n'])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
             result = runCmd(cmd, ignore_status=True)
             self.assertIn("Source parameter 'fill' only works with the '--fixed-size' option, exiting.", result.output)
             self.assertNotEqual(0, result.status)
@@ -1940,7 +1916,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
                             'part /boot --size=100M --active --fstype=ext4 --label boot\n'
                             'part /     --source rootfs      --fstype=ext4 --label root\n'])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
@@ -1958,7 +1934,7 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
                             'part /boot --size=100M --active --fstype=ext4 --label boot\n'
                             'part /     --source rootfs      --fstype=ext4 --label root\n'])
             wks.flush()
-            cmd = "wic create %s -e %s -o %s" % (wks.name, img, self.resultdir)
+            cmd = "wic create %s -e %s -o %s --vars %s" % (wks.name, img, self.resultdir, self.envfile)
             runCmd(cmd)
             wksname = os.path.splitext(os.path.basename(wks.name))[0]
             out = glob(os.path.join(self.resultdir, "%s-*direct" % wksname))
Signature · 1 line
2.51.0
#15 lore raw

Patchtest results for [RFC][PATCH v2 8/9] oe-selftest -r wic.Wic2 (non-runqemu) -> PASS

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---

Testing patch /home/patchtest/share/mboxes/RFC-v2-8-9-oe-selftest--r-wic.Wic2-non-runqemu---PASS.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#16 lore raw

RFC PATCH v2 9/9 oe-selftest -r wic.Wic2 (runqemu) -> PASS (mostly)

In reply to Trevor Woerner

Changes for the wic.Wic2 runqemu oe-selftests to pass now that wic is a stand-alone app and no longer part of oe-core.

NOTES:
- wic.Wic2.test_efi_plugin_plain_systemd_boot_qemu_aarch64 was skipped
- wic.Wic2.test_expand_mbr_image failed

---
 meta/lib/oeqa/selftest/cases/wic.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
meta/lib/oeqa/selftest/cases/wic.py +5 -4
index b35dbd9fb348..11182e05de72 100644
@@ -1131,6 +1131,7 @@ run_wic_cmd() {
                  'MACHINE_FEATURES:append = " efi"\n'
         self.append_config(config)
         image_recipe_append = """
+DEPENDS:append = " wic-native"
 do_image_wic[postfuncs] += "run_wic_cmd"
 run_wic_cmd() {
     echo "test" >> ${WORKDIR}/test.wic-cp
@@ -1147,7 +1148,7 @@ run_wic_cmd() {
         bb_vars = get_bb_vars(['DEPLOY_DIR_IMAGE', 'IMAGE_LINK_NAME'], "wic-image-minimal")
         image_path = os.path.join(bb_vars['DEPLOY_DIR_IMAGE'], bb_vars['IMAGE_LINK_NAME'])
         # check if file is there
-        result = runCmd("wic ls %s:1/ -n %s" % (image_path+".wic", sysroot))
+        result = runCmd("wic ls %s:1/ -n %s --vars %s" % (image_path+".wic", sysroot, self.envfile))
         self.assertIn("test.wic-cp", result.output)
         self.remove_config(config)
 
@@ -1816,12 +1817,12 @@ INITRAMFS_IMAGE = "core-image-initramfs-boot"
                 new_image_path = sparse.name
 
             sysroot = get_bb_var('RECIPE_SYSROOT_NATIVE', 'wic-tools')
-            cmd = "wic write -n %s --expand 1:0 %s %s" % (sysroot, image_path, new_image_path)
+            cmd = "wic write -n %s --expand 1:0 %s %s --vars %s" % (sysroot, image_path, new_image_path, self.envfile)
             runCmd(cmd)
 
             # check if partitions are expanded
-            orig = runCmd("wic ls %s -n %s" % (image_path, sysroot))
-            exp = runCmd("wic ls %s -n %s" % (new_image_path, sysroot))
+            orig = runCmd("wic ls %s -n %s --vars %s" % (image_path, sysroot, self.envfile))
+            exp = runCmd("wic ls %s -n %s --vars %s" % (new_image_path, sysroot, self.envfile))
             orig_sizes = [int(line.split()[3]) for line in orig.output.split('\n')[1:]]
             exp_sizes = [int(line.split()[3]) for line in exp.output.split('\n')[1:]]
             self.assertEqual(orig_sizes[0], exp_sizes[0]) # first partition is not resized
Signature · 1 line
2.51.0
#17 lore raw

Patchtest results for [RFC][PATCH v2 9/9] oe-selftest -r wic.Wic2 (runqemu) -> PASS (mostly)

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---

Testing patch /home/patchtest/share/mboxes/RFC-v2-9-9-oe-selftest--r-wic.Wic2-runqemu---PASS-mostly.patch

FAIL: test shortlog format: Commit shortlog (first line of commit message) should follow the format "<target>: <summary>" (test_mbox.TestMbox.test_shortlog_format)
PASS: pretest pylint (test_python_pylint.PyLint.pretest_pylint)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test pylint (test_python_pylint.PyLint.test_pylint)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: test CVE tag format: No new CVE patches introduced (test_patch.TestPatch.test_cve_tag_format)
SKIP: test Signed-off-by presence: No new CVE patches introduced (test_patch.TestPatch.test_signed_off_by_presence)
SKIP: test Upstream-Status presence: No new CVE patches introduced (test_patch.TestPatch.test_upstream_status_presence_format)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#18 lore raw
In reply to Trevor Woerner
Quoted 33 lines · Trevor Woerner via lists.openembedded.org

This series of patches explores the possibility of splitting wic out from oe-core into its own standalone utility. The wic utility will continue to fall under The Yocto Project umbrella, but will no longer be integrated into the project as part of oe-core. The ultimate goal is to make wic a completely independent tool, hosted on PyPI, with its own tests, development roadmap, and releases.

Some benefits include:
- relieving the oe-core maintainers from having to review, understand, merge, or reject wic patches
- allow the tool to be used outside of The Yocto Project for generating Linux images
- provide more flexibility to explore other features, libraries, mechanisms, etc

The initial task of splitting wic out into its own repository was performed with the help of AI. It was checked, and subsequent work was done without AI.

These changes have been tested with oe-selftest as follows:

	$ sudo .../layers/openembedded-core/scripts/runqemu-gen-tapdevs <my numeric group id> 4
	$ oe-selftest -v -r wic

On my machine my oe-selftest results for an unmodified oe-core give:

	successes=93, skipped=1, failures=0, errors=1
with these patches I get:
	successes=91, skipped=1, failures=2, errors=0

There are 2 tests that need to be fixed, but it would be great to get some feedback on this work, and to see what the AB thinks of it so far. I have also done some adhoc testing with meta-rockchip and meta-raspberrypi.

Quoted 5 lines

Should this work eventually make its way to oe-core, it would need to be squashed into a single commit otherwise builds will break when only partially applied. They have been submitted here in this RFC series separately to make review easier.

Hi Trevor,

Thanks for this series. I ran it on the autobuilder, a few issues (maybe just a single one actually), but most tests succeed.

So first, we have the wic tests, which try to invoke the wic tools directly. These one entirely failed because wic was not found in the path at all:

Running '. ./init-build-env; wic create directdisk -e core-image-sato -o ${BUILDDIR}/tmp/deploy/wic_images/qemux86/directdisk/core-image-sato/' with output to /srv/pokybuild/yocto-worker/wic/build/build/command-1-cmds.log in /srv/pokybuild/yocto-worker/wic/build/build /bin/bash: line 1: wic: command not found

https://autobuilder.yoctoproject.org/valkyrie/#/builders/15/builds/3076

So I still have to look in depth at your patches, but I suspect, as the tool is now in a separate git, it can no longer be used just by sourcing the environment file.

In the context of the test, this is probably not really an issue, we can just fix it to have wic tools. But thinking about users, this might be a bigger issue as it does change a bit the flow if they want to use wic directly.

The second issue is similar: one of the selftests fails as the wic command was not found:

2026-02-03 09:54:38,418 - oe-selftest - INFO - systemd_boot.Systemdboot.test_efi_systemdboot_images_can_be_built (subunit.RemotedTestCase)
2026-02-03 09:54:38,419 - oe-selftest - INFO -  ... FAIL

...
AssertionError: Command 'wic cp /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st-1720620/tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.rootfs.wic:1/EFI/BOOT/bootx64.efi /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st-1720620/tmp/deploy/images/genericx86-64/bootx64.efi -n /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st-1720620/tmp/work/core2-64-poky-linux/wic-tools/1.0/recipe-sysroot-native' returned non-zero exit status 127:
/bin/sh: 1: wic: not found

https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3260
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/3136
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3034

And so far, that's all. So we might have other issues masked behind this, but overall it looks pretty good in term of tests.

Thanks,
Mathieu

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#19 lore raw

Hi Mathieu,

Thanks for giving them a run on the AB.

Quoted 74 lines · Mathieu Dubois-Briand
Quoted 33 lines · Trevor Woerner via lists.openembedded.org

This series of patches explores the possibility of splitting wic out from oe-core into its own standalone utility. The wic utility will continue to fall under The Yocto Project umbrella, but will no longer be integrated into the project as part of oe-core. The ultimate goal is to make wic a completely independent tool, hosted on PyPI, with its own tests, development roadmap, and releases.

Some benefits include:
- relieving the oe-core maintainers from having to review, understand, merge, or reject wic patches
- allow the tool to be used outside of The Yocto Project for generating Linux images
- provide more flexibility to explore other features, libraries, mechanisms, etc

The initial task of splitting wic out into its own repository was performed with the help of AI. It was checked, and subsequent work was done without AI.

These changes have been tested with oe-selftest as follows:

	$ sudo .../layers/openembedded-core/scripts/runqemu-gen-tapdevs <my numeric group id> 4
	$ oe-selftest -v -r wic

On my machine my oe-selftest results for an unmodified oe-core give:

	successes=93, skipped=1, failures=0, errors=1
with these patches I get:
	successes=91, skipped=1, failures=2, errors=0

There are 2 tests that need to be fixed, but it would be great to get some feedback on this work, and to see what the AB thinks of it so far. I have also done some adhoc testing with meta-rockchip and meta-raspberrypi.

Quoted 5 lines

Should this work eventually make its way to oe-core, it would need to be squashed into a single commit otherwise builds will break when only partially applied. They have been submitted here in this RFC series separately to make review easier.

Hi Trevor,

Thanks for this series. I ran it on the autobuilder, a few issues (maybe just a single one actually), but most tests succeed.

So first, we have the wic tests, which try to invoke the wic tools directly. These one entirely failed because wic was not found in the path at all:

Running '. ./init-build-env; wic create directdisk -e core-image-sato -o ${BUILDDIR}/tmp/deploy/wic_images/qemux86/directdisk/core-image-sato/' with output to /srv/pokybuild/yocto-worker/wic/build/build/command-1-cmds.log in /srv/pokybuild/yocto-worker/wic/build/build /bin/bash: line 1: wic: command not found

https://autobuilder.yoctoproject.org/valkyrie/#/builders/15/builds/3076

So I still have to look in depth at your patches, but I suspect, as the tool is now in a separate git, it can no longer be used just by sourcing the environment file.

In the context of the test, this is probably not really an issue, we can just fix it to have wic tools. But thinking about users, this might be a bigger issue as it does change a bit the flow if they want to use wic directly.

The second issue is similar: one of the selftests fails as the wic command was not found:

2026-02-03 09:54:38,418 - oe-selftest - INFO - systemd_boot.Systemdboot.test_efi_systemdboot_images_can_be_built (subunit.RemotedTestCase)
2026-02-03 09:54:38,419 - oe-selftest - INFO -  ... FAIL

...
AssertionError: Command 'wic cp /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st-1720620/tmp/deploy/images/genericx86-64/core-image-minimal-genericx86-64.rootfs.wic:1/EFI/BOOT/bootx64.efi /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st-1720620/tmp/deploy/images/genericx86-64/bootx64.efi -n /srv/pokybuild/yocto-worker/oe-selftest-armhost/build/build-st-1720620/tmp/work/core2-64-poky-linux/wic-tools/1.0/recipe-sysroot-native' returned non-zero exit status 127:
/bin/sh: 1: wic: not found

Quoted 7 lines

https://autobuilder.yoctoproject.org/valkyrie/#/builders/23/builds/3260
https://autobuilder.yoctoproject.org/valkyrie/#/builders/35/builds/3136
https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/3034

And so far, that's all. So we might have other issues masked behind this, but overall it looks pretty good in term of tests.

Wow, this is excellent results!

	successes=619, skipped=43, failures=1, errors=0
	successes=642, skipped=20, failures=1, errors=0
	successes=644, skipped=18, failures=1, errors=0

In my testing, locally, I had 2 tests that were failing, but the AB only has one :-) The one that is failing on the AB:
systemd_boot.Systemdboot.test_efi_systemdboot_images_can_be_built

is not one I had tested.

Thanks!