public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Support multiple image types in one build
@ 2021-09-28  7:13 Uladzimir Bely
  2021-09-28  7:13 ` [PATCH v2 1/5] image: Make WORKDIR and STAMPs unrelated to IMAGE_TYPE Uladzimir Bely
                   ` (5 more replies)
  0 siblings, 6 replies; 12+ messages in thread
From: Uladzimir Bely @ 2021-09-28  7:13 UTC (permalink / raw)
  To: isar-users

Changes since v1:
- removed mc:qemuamd64-buster-cpiogz config
- mc:qemuamd64-buster config now includes cpiogz image type

The patchset makes possible to build several image types for
the specific target by listing all them in IMG_FSTYPES variable.

This also deprecates using IMG_TYPE variable.

Uladzimir Bely (5):
  image: Make WORKDIR and STAMPs unrelated to IMAGE_TYPE
  wic-img: Set weak default value for WKS_FILE
  start_vm: Use the first image type to start VM
  meta-isar: Rework mc:qemuamd64-buster configs
  api: Rename IMAGE_TYPE to IMAGE_FSTYPES

 RECIPE-API-CHANGELOG.md                       |  5 ++++
 doc/user_manual.md                            | 23 +++++++++++--------
 meta-isar/conf/local.conf.sample              |  2 --
 meta-isar/conf/machine/bananapi.conf          |  2 +-
 meta-isar/conf/machine/container-amd64.conf   |  2 +-
 meta-isar/conf/machine/de0-nano-soc.conf      |  2 +-
 meta-isar/conf/machine/hikey.conf             |  2 +-
 meta-isar/conf/machine/nand-ubi-demo.conf     |  2 +-
 meta-isar/conf/machine/nanopi-neo.conf        |  2 +-
 meta-isar/conf/machine/qemuamd64.conf         |  2 +-
 meta-isar/conf/machine/qemuarm.conf           |  2 +-
 meta-isar/conf/machine/qemuarm64.conf         |  2 +-
 meta-isar/conf/machine/qemui386.conf          |  2 +-
 meta-isar/conf/machine/qemumipsel.conf        |  2 +-
 meta-isar/conf/machine/qemuriscv64.conf       |  2 +-
 meta-isar/conf/machine/rpi.conf               |  2 +-
 meta-isar/conf/machine/sifive-fu540.conf      |  2 +-
 meta-isar/conf/machine/stm32mp15x.conf        |  2 +-
 .../multiconfig/qemuamd64-buster-cpiogz.conf  |  9 --------
 .../multiconfig/qemuamd64-buster-tgz.conf     |  9 --------
 .../conf/multiconfig/qemuamd64-buster.conf    |  2 ++
 meta/classes/image.bbclass                    | 12 ++++++----
 meta/classes/wic-img.bbclass                  |  3 +++
 scripts/ci_build.sh                           |  5 ++--
 scripts/start_vm                              |  8 ++++---
 testsuite/start_vm.py                         |  2 +-
 26 files changed, 54 insertions(+), 56 deletions(-)
 delete mode 100644 meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
 delete mode 100644 meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf

-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 1/5] image: Make WORKDIR and STAMPs unrelated to IMAGE_TYPE
  2021-09-28  7:13 [PATCH v2 0/5] Support multiple image types in one build Uladzimir Bely
@ 2021-09-28  7:13 ` Uladzimir Bely
  2021-09-28  7:13 ` [PATCH v2 2/5] wic-img: Set weak default value for WKS_FILE Uladzimir Bely
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Uladzimir Bely @ 2021-09-28  7:13 UTC (permalink / raw)
  To: isar-users

If we want to support several image types listed in IMAGE_TYPE,
we should remove this part from WORKDIR and STAMP and STAMPCLEAN.

This leads to sharing the same directories by parallel builds like
mc:qemuamd64-buster and mc:qemuamd64-buster-tgz that differs only
in used image type.

Technically, this commit reverts the commit 6374a763c988
(image: Make WORKDIR and STAMPs IMAGE_TYPE-specific).

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/image.bbclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index ec93cab..eecada3 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -2,9 +2,9 @@
 # Copyright (C) 2015-2017 ilbers GmbH
 
 # Make workdir and stamps machine-specific without changing common PN target
-WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_TYPE}/${PV}-${PR}"
-STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_TYPE}/${PV}-${PR}"
-STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_TYPE}/*-*"
+WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}"
+STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}"
+STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*"
 
 IMAGE_INSTALL ?= ""
 IMAGE_TYPE    ?= "ext4-img"
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 2/5] wic-img: Set weak default value for WKS_FILE
  2021-09-28  7:13 [PATCH v2 0/5] Support multiple image types in one build Uladzimir Bely
  2021-09-28  7:13 ` [PATCH v2 1/5] image: Make WORKDIR and STAMPs unrelated to IMAGE_TYPE Uladzimir Bely
@ 2021-09-28  7:13 ` Uladzimir Bely
  2021-10-05  8:49   ` Henning Schild
  2021-09-28  7:13 ` [PATCH v2 3/5] start_vm: Use the first image type to start VM Uladzimir Bely
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2021-09-28  7:13 UTC (permalink / raw)
  To: isar-users

In case user lists "wic-img" in IMAGE_TYPE variable, bitbake fails
at early parsing stages because WKS_FILE is not defined at this
moment.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/wic-img.bbclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass
index d849ad9..50e9819 100644
--- a/meta/classes/wic-img.bbclass
+++ b/meta/classes/wic-img.bbclass
@@ -6,6 +6,9 @@
 
 WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}')}"
 
+# In case user has chosen wic-img in local.conf without mandatory WKS_FILE, define default
+WKS_FILE ??= "sdimage-efi"
+
 do_copy_wks_template[file-checksums] += "${WKS_FILE_CHECKSUM}"
 do_copy_wks_template () {
     cp -f '${WKS_TEMPLATE_PATH}' '${WORKDIR}/${WKS_TEMPLATE_FILE}'
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 3/5] start_vm: Use the first image type to start VM
  2021-09-28  7:13 [PATCH v2 0/5] Support multiple image types in one build Uladzimir Bely
  2021-09-28  7:13 ` [PATCH v2 1/5] image: Make WORKDIR and STAMPs unrelated to IMAGE_TYPE Uladzimir Bely
  2021-09-28  7:13 ` [PATCH v2 2/5] wic-img: Set weak default value for WKS_FILE Uladzimir Bely
@ 2021-09-28  7:13 ` Uladzimir Bely
  2021-10-05  8:52   ` Henning Schild
  2021-09-28  7:13 ` [PATCH v2 4/5] meta-isar: Rework mc:qemuamd64-buster configs Uladzimir Bely
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2021-09-28  7:13 UTC (permalink / raw)
  To: isar-users

If there are several image types listed in IMAGE_TYPE, we need
to use the only to start VM. Let first one be the default.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 scripts/start_vm      | 2 ++
 testsuite/start_vm.py | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/start_vm b/scripts/start_vm
index 28ada30..77c4244 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -110,6 +110,8 @@ readonly MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf
 eval "$(egrep 'MACHINE_SERIAL|QEMU_' $MACHINE_CONF |bb2sh)"
 
 eval $(bitbake -e mc:qemu$ARCH-$DISTRO:isar-image-base | grep "\(^IMAGE_TYPE=\|^IMAGE_FULLNAME=\)")
+# Take first image type for VM if there are several defined
+IMAGE_TYPE=$(echo "$IMAGE_TYPE" | sed -e 's/\s.*$//')
 case "$IMAGE_TYPE" in
     ext4-img)
     readonly ROOTFS_IMAGE=$IMAGE_FULLNAME.ext4.img
diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
index a3e32ac..06fc935 100755
--- a/testsuite/start_vm.py
+++ b/testsuite/start_vm.py
@@ -28,7 +28,7 @@ def format_qemu_cmdline(arch, build, distro):
     extra_args = ''
     cpu = ['']
 
-    image_type = get_bitbake_var(bb_output, 'IMAGE_TYPE')
+    image_type = get_bitbake_var(bb_output, 'IMAGE_TYPE').split()[0]
     deploy_dir_image = get_bitbake_var(bb_output, 'DEPLOY_DIR_IMAGE')
     if image_type == 'ext4-img':
         rootfs_image = 'isar-image-base-debian-' + distro + '-qemu' + arch + '.ext4.img'
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 4/5] meta-isar: Rework mc:qemuamd64-buster configs
  2021-09-28  7:13 [PATCH v2 0/5] Support multiple image types in one build Uladzimir Bely
                   ` (2 preceding siblings ...)
  2021-09-28  7:13 ` [PATCH v2 3/5] start_vm: Use the first image type to start VM Uladzimir Bely
@ 2021-09-28  7:13 ` Uladzimir Bely
  2021-10-05  8:54   ` Henning Schild
  2021-09-28  7:13 ` [PATCH v2 5/5] api: Rename IMAGE_TYPE to IMAGE_FSTYPES Uladzimir Bely
  2021-10-05  9:08 ` [PATCH v2 0/5] Support multiple image types in one build Henning Schild
  5 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2021-09-28  7:13 UTC (permalink / raw)
  To: isar-users

We remove mc:qemuamd64-buster-tgz config that explicitly creates tgz-img,
and mc:qemuamd64-buster-cpiogz config that createc cpiogz image,
but add these image types to common mc:qemuamd64-buster config.

This gives several output image types for this machine and
allows to test this feature in CI.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta-isar/conf/local.conf.sample                        | 2 --
 meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf | 9 ---------
 meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf    | 9 ---------
 meta-isar/conf/multiconfig/qemuamd64-buster.conf        | 2 ++
 scripts/ci_build.sh                                     | 5 ++---
 5 files changed, 4 insertions(+), 23 deletions(-)
 delete mode 100644 meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
 delete mode 100644 meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf

diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 88a8175..d90c739 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -49,8 +49,6 @@ BBMULTICONFIG = " \
     qemui386-bullseye \
     qemuamd64-stretch \
     qemuamd64-buster \
-    qemuamd64-buster-tgz \
-    qemuamd64-buster-cpiogz \
     qemuamd64-bullseye \
     container-amd64-stretch \
     container-amd64-buster \
diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf b/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
deleted file mode 100644
index cadcdac..0000000
--- a/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-# This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2020
-#
-# SPDX-License-Identifier: MIT
-
-MACHINE ?= "qemuamd64"
-DISTRO ?= "debian-buster"
-
-IMAGE_TYPE = "cpiogz-img"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf b/meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf
deleted file mode 100644
index 17de338..0000000
--- a/meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf
+++ /dev/null
@@ -1,9 +0,0 @@
-# This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2018
-#
-# SPDX-License-Identifier: MIT
-
-MACHINE ?= "qemuamd64"
-DISTRO ?= "debian-buster"
-
-IMAGE_TYPE ?= "targz-img"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster.conf b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
index 3fabd67..d8139f7 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
@@ -2,3 +2,5 @@
 
 MACHINE ?= "qemuamd64"
 DISTRO ?= "debian-buster"
+
+IMAGE_TYPE ?= "wic-img targz-img cpiogz-img"
diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index 48a51f2..c39ba3b 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -36,8 +36,6 @@ TARGETS_SET="\
             mc:qemui386-buster:isar-image-base \
             mc:qemuamd64-stretch:isar-image-base \
             mc:qemuamd64-buster:isar-image-base \
-            mc:qemuamd64-buster-tgz:isar-image-base \
-            mc:qemuamd64-buster-cpiogz:isar-image-base \
             mc:qemuamd64-buster:isar-initramfs \
             mc:qemumipsel-stretch:isar-image-base \
             mc:qemumipsel-buster:isar-image-base \
@@ -196,6 +194,7 @@ if [ -n "$REPRO_BUILD" ]; then
     sed -i -e 's/ISAR_USE_CACHED_BASE_REPO ?= "1"/#ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf
     sed -i -e 's/^BB_NO_NETWORK/#BB_NO_NETWORK/g' conf/local.conf
     sed -i -e 's/^BASE_REPO_KEY/#BASE_REPO_KEY/g' conf/local.conf
+
     bitbake $BB_ARGS $REPRO_TARGETS_SET
     while [ -e bitbake.sock ]; do sleep 1; done
     # Enable use of unsigned cached base repository
@@ -205,6 +204,7 @@ if [ -n "$REPRO_BUILD" ]; then
     bitbake $BB_ARGS $REPRO_TARGETS_SET
     while [ -e bitbake.sock ]; do sleep 1; done
     # Disable use of unsigned cached base repository
+
     sed -i -e 's/ISAR_USE_CACHED_BASE_REPO ?= "1"/#ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf
     sed -i -e 's/^BB_NO_NETWORK/#BB_NO_NETWORK/g' conf/local.conf
     # Try to build with changed configuration with no cleanup
@@ -273,4 +273,3 @@ while [ -e bitbake.sock ]; do sleep 1; done
 echo 'SDK_FORMATS = "docker-archive"' >> conf/local.conf
 bitbake $BB_ARGS -c do_populate_sdk mc:container-amd64-stretch:isar-image-base
 while [ -e bitbake.sock ]; do sleep 1; done
-
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH v2 5/5] api: Rename IMAGE_TYPE to IMAGE_FSTYPES
  2021-09-28  7:13 [PATCH v2 0/5] Support multiple image types in one build Uladzimir Bely
                   ` (3 preceding siblings ...)
  2021-09-28  7:13 ` [PATCH v2 4/5] meta-isar: Rework mc:qemuamd64-buster configs Uladzimir Bely
@ 2021-09-28  7:13 ` Uladzimir Bely
  2021-10-05  8:56   ` Henning Schild
  2021-10-05  9:08 ` [PATCH v2 0/5] Support multiple image types in one build Henning Schild
  5 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2021-09-28  7:13 UTC (permalink / raw)
  To: isar-users

The variable is renamed to get closer to OpenEmbedded/Poky
variables naming. If user still uses IMAGE_TYPE, it will be used
with the deprecation warning shown.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 RECIPE-API-CHANGELOG.md                       |  5 ++++
 doc/user_manual.md                            | 23 +++++++++++--------
 meta-isar/conf/machine/bananapi.conf          |  2 +-
 meta-isar/conf/machine/container-amd64.conf   |  2 +-
 meta-isar/conf/machine/de0-nano-soc.conf      |  2 +-
 meta-isar/conf/machine/hikey.conf             |  2 +-
 meta-isar/conf/machine/nand-ubi-demo.conf     |  2 +-
 meta-isar/conf/machine/nanopi-neo.conf        |  2 +-
 meta-isar/conf/machine/qemuamd64.conf         |  2 +-
 meta-isar/conf/machine/qemuarm.conf           |  2 +-
 meta-isar/conf/machine/qemuarm64.conf         |  2 +-
 meta-isar/conf/machine/qemui386.conf          |  2 +-
 meta-isar/conf/machine/qemumipsel.conf        |  2 +-
 meta-isar/conf/machine/qemuriscv64.conf       |  2 +-
 meta-isar/conf/machine/rpi.conf               |  2 +-
 meta-isar/conf/machine/sifive-fu540.conf      |  2 +-
 meta-isar/conf/machine/stm32mp15x.conf        |  2 +-
 .../conf/multiconfig/qemuamd64-buster.conf    |  2 +-
 meta/classes/image.bbclass                    |  6 +++--
 scripts/start_vm                              |  8 +++----
 testsuite/start_vm.py                         |  2 +-
 21 files changed, 44 insertions(+), 32 deletions(-)

diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 7312d4d..5583625 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -301,3 +301,8 @@ Kernel update with "apt-get" will not work since bootloader configuration will
 not be updated. It used to "kind of work" for grub and efi, that hack is gone.
 
 When using the plugins it is advised to name the partition "/boot" and to exclude boot from the follwing rootfs to not waste space.
+
+### Rename IMAGE_TYPE to IMAGE_FSTYPES
+
+The variable is renamed to get closer to OE/Poky variables naming. The old naming
+will still also work, but with deprecation warning shown.
diff --git a/doc/user_manual.md b/doc/user_manual.md
index 01fe701..8b17710 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -209,7 +209,10 @@ tmp/deploy/images/rpi/isar-image-base.rpi-sdimg
 
 ### Generate full disk image
 
-A bootable disk image is generated if you set IMAGE_TYPE to 'wic-img'. Behind the scenes a tool called `wic` is used to assemble the images. It is controlled by a `.wks` file which you can choose with changing WKS_FILE. Some examples in the tree use that feature already.
+A bootable disk image is generated if you set IMAGE_FSTYPES to 'wic-img'.
+Behind the scenes a tool called `wic` is used to assemble the images.
+It is controlled by a `.wks` file which you can choose with changing WKS_FILE.
+Some examples in the tree use that feature already.
 ```
  # Generate an image for the `i386` target architecture
  $ bitbake mc:qemui386-buster:isar-image-base
@@ -245,7 +248,7 @@ https://github.com/intel/bmap-tools
 
 ### Generate container image with root filesystem
 
-A runnable container image is generated if you set IMAGE_TYPE to 
+A runnable container image is generated if you set IMAGE_FSTYPES to
 'container-img'.
 Getting a container image can be the main purpose of an Isar configuration, 
 but not only.
@@ -286,8 +289,8 @@ The resulting container image archives (only for `docker-archive` and
 For one-shot builds (use `local.conf` otherwise):
 
 ```
-export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE IMAGE_TYPE CONTAINER_FORMAT"
-export IMAGE_TYPE="container-img"
+export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE IMAGE_FSTYPES CONTAINER_FORMAT"
+export IMAGE_FSTYPES="container-img"
 export CONTAINER_FORMAT="docker-archive"
 ```
 
@@ -448,7 +451,9 @@ Please refer to `Add a Custom Application` section for more information about wr
 
 ## Image Type Selection
 
-Isar can generate various images types for specific machine. The type of the image to be generated may be specified through the `IMAGE_TYPE` variable. Currently, the following image types are provided:
+Isar can generate various images types for specific machine. The type of the
+image to be generated may be specified through the `IMAGE_FSTYPES` variable.
+Currently, the following image types are provided:
 
  - `ext4` - Raw ext4 filesystem image (default option for `qemuarm` machine).
  - `rpi-sdimg` - A complete, partitioned Raspberry Pi SD card image (default option for the `rpi` machine).
@@ -507,7 +512,7 @@ Every machine is described in its configuration file. The file defines the follo
  - `KERNEL_IMAGE` - The name of kernel binary that it installed to `/boot` folder in target filesystem. This variable is used by Isar to extract the kernel binary and put it into the deploy folder. This makes sense for embedded devices, where kernel and root filesystem are written to different flash partitions. This variable is optional.
  - `INITRD_IMAGE` - The name of `ramdisk` binary. The meaning of this variable is similar to `KERNEL_IMAGE`. This variable is optional.
  - `MACHINE_SERIAL` - The name of serial device that will be used for console output.
- - `IMAGE_TYPE` - The type of images to be generated for this machine.
+ - `IMAGE_FSTYPES` - The type of images to be generated for this machine.
 
 Below is an example of machine configuration file for `Raspberry Pi` board:
 ```
@@ -516,7 +521,7 @@ IMAGE_PREINSTALL = "linux-image-rpi-rpfv \
 KERNEL_IMAGE = "vmlinuz-4.4.0-1-rpi"
 INITRD_IMAGE = "initrd.img-4.4.0-1-rpi"
 MACHINE_SERIAL = "ttyAMA0"
-IMAGE_TYPE = "rpi-sdimg"
+IMAGE_FSTYPES = "rpi-sdimg"
 ```
 
 To add new machine user should perform the following steps:
@@ -549,7 +554,7 @@ The user may use `meta-isar/recipes-core/images` as a template for new image rec
 ### General Information
 The image recipe in Isar creates a folder with target root filesystem. Its default location is:
 ```
-tmp/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_TYPE}/${PV}-${PR}/rootfs
+tmp/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_FSTYPES}/${PV}-${PR}/rootfs
 ```
 Every image type in Isar is implemented as a `bitbake` class. The goal of these classes is to pack root filesystem folder to appropriate format.
 
@@ -572,7 +577,7 @@ The content of `do_my_image` function can be implemented either in shell or in P
 
 In the machine configuration file, set the following:
 ```
-IMAGE_TYPE = "my-image"
+IMAGE_FSTYPES = "my-image"
 ```
 
 ### Reference Classes
diff --git a/meta-isar/conf/machine/bananapi.conf b/meta-isar/conf/machine/bananapi.conf
index cec8057..dd3a066 100644
--- a/meta-isar/conf/machine/bananapi.conf
+++ b/meta-isar/conf/machine/bananapi.conf
@@ -9,6 +9,6 @@ KERNEL_NAME ?= "armmp"
 
 IMAGE_INSTALL += "u-boot-script"
 
-IMAGE_TYPE ?= "wic-img"
+IMAGE_FSTYPES ?= "wic-img"
 WKS_FILE ?= "bananapi"
 IMAGER_INSTALL += "u-boot-sunxi"
diff --git a/meta-isar/conf/machine/container-amd64.conf b/meta-isar/conf/machine/container-amd64.conf
index d2978c4..1f7669a 100644
--- a/meta-isar/conf/machine/container-amd64.conf
+++ b/meta-isar/conf/machine/container-amd64.conf
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: MIT
 
 DISTRO_ARCH ?= "amd64"
-IMAGE_TYPE ?= "container-img"
+IMAGE_FSTYPES ?= "container-img"
diff --git a/meta-isar/conf/machine/de0-nano-soc.conf b/meta-isar/conf/machine/de0-nano-soc.conf
index 5e35602..f822e24 100644
--- a/meta-isar/conf/machine/de0-nano-soc.conf
+++ b/meta-isar/conf/machine/de0-nano-soc.conf
@@ -11,7 +11,7 @@ PREFERRED_PROVIDER_u-boot-de0-nano-soc = "u-boot-de0-nano-soc"
 U_BOOT_CONFIG_de0-nano-soc = "socfpga_de0_nano_soc_defconfig"
 U_BOOT_BIN_de0-nano-soc = "u-boot-with-spl.sfp"
 
-IMAGE_TYPE ?= "wic-img"
+IMAGE_FSTYPES ?= "wic-img"
 WKS_FILE ?= "de0-nano-soc.wks.in"
 IMAGER_INSTALL += "u-boot-de0-nano-soc"
 IMAGER_BUILD_DEPS += "u-boot-de0-nano-soc"
diff --git a/meta-isar/conf/machine/hikey.conf b/meta-isar/conf/machine/hikey.conf
index 09dfaf4..615d674 100644
--- a/meta-isar/conf/machine/hikey.conf
+++ b/meta-isar/conf/machine/hikey.conf
@@ -7,7 +7,7 @@ DISTRO_ARCH = "arm64"
 
 KERNEL_NAME ?= "mainline"
 
-IMAGE_TYPE = "wic-img"
+IMAGE_FSTYPES = "wic-img"
 WKS_FILE ?= "hikey"
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
 
diff --git a/meta-isar/conf/machine/nand-ubi-demo.conf b/meta-isar/conf/machine/nand-ubi-demo.conf
index 25ec72f..5be337f 100644
--- a/meta-isar/conf/machine/nand-ubi-demo.conf
+++ b/meta-isar/conf/machine/nand-ubi-demo.conf
@@ -8,6 +8,6 @@ BAUDRATE_TTY ?= "115200"
 
 MKUBIFS_ARGS := "-m 0x1000 -e 0x3e000 -c 1500"
 UBINIZE_ARGS = "-vv -m 0x1000 -p 0x40000"
-IMAGE_TYPE ?= "ubi-ubifs-img"
+IMAGE_FSTYPES ?= "ubi-ubifs-img"
 
 DTB_FILES = "imx6q-sabrelite.dtb"
diff --git a/meta-isar/conf/machine/nanopi-neo.conf b/meta-isar/conf/machine/nanopi-neo.conf
index 703b4f4..2475ce9 100644
--- a/meta-isar/conf/machine/nanopi-neo.conf
+++ b/meta-isar/conf/machine/nanopi-neo.conf
@@ -7,7 +7,7 @@ DISTRO_ARCH ?= "armhf"
 
 KERNEL_NAME ?= "armmp"
 
-IMAGE_TYPE ?= "wic-img"
+IMAGE_FSTYPES ?= "wic-img"
 WKS_FILE ?= "nanopi-neo.wks.in"
 
 IMAGE_INSTALL += "u-boot-script"
diff --git a/meta-isar/conf/machine/qemuamd64.conf b/meta-isar/conf/machine/qemuamd64.conf
index dab4f09..ccfde39 100644
--- a/meta-isar/conf/machine/qemuamd64.conf
+++ b/meta-isar/conf/machine/qemuamd64.conf
@@ -6,7 +6,7 @@ DISTRO_ARCH ?= "amd64"
 KERNEL_NAME ?= "amd64"
 KERNEL_NAME_ubuntu-focal ?= "generic"
 
-IMAGE_TYPE ?= "wic-img"
+IMAGE_FSTYPES ?= "wic-img"
 WKS_FILE ?= "sdimage-efi"
 IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
 
diff --git a/meta-isar/conf/machine/qemuarm.conf b/meta-isar/conf/machine/qemuarm.conf
index fbbdc23..20a71ea 100644
--- a/meta-isar/conf/machine/qemuarm.conf
+++ b/meta-isar/conf/machine/qemuarm.conf
@@ -5,7 +5,7 @@ DISTRO_ARCH ?= "armhf"
 
 KERNEL_NAME ?= "armmp"
 
-IMAGE_TYPE ?= "ext4-img"
+IMAGE_FSTYPES ?= "ext4-img"
 
 QEMU_ROOTFS_DEV ?= "vda"
 
diff --git a/meta-isar/conf/machine/qemuarm64.conf b/meta-isar/conf/machine/qemuarm64.conf
index e5e762f..ca23cef 100644
--- a/meta-isar/conf/machine/qemuarm64.conf
+++ b/meta-isar/conf/machine/qemuarm64.conf
@@ -6,7 +6,7 @@ DISTRO_ARCH ?= "arm64"
 KERNEL_NAME ?= "arm64"
 KERNEL_NAME_ubuntu-focal ?= "generic"
 
-IMAGE_TYPE ?= "ext4-img"
+IMAGE_FSTYPES ?= "ext4-img"
 
 QEMU_ROOTFS_DEV ?= "vda"
 
diff --git a/meta-isar/conf/machine/qemui386.conf b/meta-isar/conf/machine/qemui386.conf
index e6afb06..17cff1e 100644
--- a/meta-isar/conf/machine/qemui386.conf
+++ b/meta-isar/conf/machine/qemui386.conf
@@ -4,7 +4,7 @@ DISTRO_ARCH ?= "i386"
 
 KERNEL_NAME ?= "686-pae"
 
-IMAGE_TYPE ?= "wic-img"
+IMAGE_FSTYPES ?= "wic-img"
 WKS_FILE ?= "directdisk-isar"
 IMAGER_INSTALL += "${SYSLINUX_BOOTLOADER_INSTALL}"
 
diff --git a/meta-isar/conf/machine/qemumipsel.conf b/meta-isar/conf/machine/qemumipsel.conf
index 85178ee..b34e46d 100644
--- a/meta-isar/conf/machine/qemumipsel.conf
+++ b/meta-isar/conf/machine/qemumipsel.conf
@@ -5,7 +5,7 @@ DISTRO_ARCH ?= "mipsel"
 
 KERNEL_NAME ?= "4kc-malta"
 
-IMAGE_TYPE ?= "ext4-img"
+IMAGE_FSTYPES ?= "ext4-img"
 
 QEMU_ROOTFS_DEV ?= "sda"
 
diff --git a/meta-isar/conf/machine/qemuriscv64.conf b/meta-isar/conf/machine/qemuriscv64.conf
index f4f5312..5c687a0 100644
--- a/meta-isar/conf/machine/qemuriscv64.conf
+++ b/meta-isar/conf/machine/qemuriscv64.conf
@@ -8,7 +8,7 @@ DISTRO_ARCH ?= "riscv64"
 
 KERNEL_NAME ?= "riscv64"
 
-IMAGE_TYPE ?= "ext4-img"
+IMAGE_FSTYPES ?= "ext4-img"
 
 QEMU_ROOTFS_DEV ?= "vda"
 
diff --git a/meta-isar/conf/machine/rpi.conf b/meta-isar/conf/machine/rpi.conf
index 31f2219..61852a9 100644
--- a/meta-isar/conf/machine/rpi.conf
+++ b/meta-isar/conf/machine/rpi.conf
@@ -4,4 +4,4 @@
 MACHINE_SERIAL ?= "ttyAMA0"
 BAUDRATE_TTY ?= "9600"
 
-IMAGE_TYPE ?= "rpi-sdimg"
+IMAGE_FSTYPES ?= "rpi-sdimg"
diff --git a/meta-isar/conf/machine/sifive-fu540.conf b/meta-isar/conf/machine/sifive-fu540.conf
index c815f4a..d73f047 100644
--- a/meta-isar/conf/machine/sifive-fu540.conf
+++ b/meta-isar/conf/machine/sifive-fu540.conf
@@ -7,7 +7,7 @@ DISTRO_ARCH = "riscv64"
 
 KERNEL_NAME ?= "mainline"
 
-IMAGE_TYPE ?= "wic-img"
+IMAGE_FSTYPES ?= "wic-img"
 WKS_FILE ?= "sifive-fu540"
 IMAGER_INSTALL += "opensbi-sifive-fu540"
 IMAGER_BUILD_DEPS += "opensbi-sifive-fu540"
diff --git a/meta-isar/conf/machine/stm32mp15x.conf b/meta-isar/conf/machine/stm32mp15x.conf
index e963d08..22e88ea 100644
--- a/meta-isar/conf/machine/stm32mp15x.conf
+++ b/meta-isar/conf/machine/stm32mp15x.conf
@@ -11,7 +11,7 @@ PREFERRED_PROVIDER_u-boot-stm32mp15x = "u-boot-stm32mp15x"
 U_BOOT_CONFIG_stm32mp15x = "stm32mp15_trusted_defconfig"
 U_BOOT_BIN_stm32mp15x = "u-boot.stm32"
 
-IMAGE_TYPE ?= "wic-img"
+IMAGE_FSTYPES ?= "wic-img"
 WKS_FILE ?= "stm32mp15x.wks.in"
 IMAGER_INSTALL += "trusted-firmware-a-stm32mp15x optee-os-stm32mp15x u-boot-stm32mp15x"
 IMAGER_BUILD_DEPS += "trusted-firmware-a-stm32mp15x optee-os-stm32mp15x u-boot-stm32mp15x"
diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster.conf b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
index d8139f7..26f4f4c 100644
--- a/meta-isar/conf/multiconfig/qemuamd64-buster.conf
+++ b/meta-isar/conf/multiconfig/qemuamd64-buster.conf
@@ -3,4 +3,4 @@
 MACHINE ?= "qemuamd64"
 DISTRO ?= "debian-buster"
 
-IMAGE_TYPE ?= "wic-img targz-img cpiogz-img"
+IMAGE_FSTYPES ?= "wic-img targz-img cpiogz-img"
\ No newline at end of file
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index eecada3..e923318 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -7,7 +7,7 @@ STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}"
 STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*"
 
 IMAGE_INSTALL ?= ""
-IMAGE_TYPE    ?= "ext4-img"
+IMAGE_FSTYPES ?= "${@ d.getVar("IMAGE_TYPE", True) if d.getVar("IMAGE_TYPE", True) else "ext4-img"}"
 IMAGE_ROOTFS ?= "${WORKDIR}/rootfs"
 
 IMAGE_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME", True)) if d.getVar("KERNEL_NAME", True) else ""}"
@@ -36,6 +36,8 @@ BUILDROOT_WORK = "${BUILDCHROOT_DIR}${PP_WORK}"
 python(){
     if (d.getVar('IMAGE_TRANSIENT_PACKAGES')):
         bb.warn("IMAGE_TRANSIENT_PACKAGES is set and no longer supported")
+    if (d.getVar('IMAGE_TYPE')):
+        bb.warn("IMAGE_TYPE is deprecated, please switch to IMAGE_FSTYPES")
 }
 
 def cfg_script(d):
@@ -220,4 +222,4 @@ EOSUDO
 addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess
 
 # Last so that the image type can overwrite tasks if needed
-inherit ${IMAGE_TYPE}
+inherit ${IMAGE_FSTYPES}
diff --git a/scripts/start_vm b/scripts/start_vm
index 77c4244..5717c7c 100755
--- a/scripts/start_vm
+++ b/scripts/start_vm
@@ -109,10 +109,10 @@ readonly ISARROOT="$(dirname "$0")"/..
 readonly MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf
 eval "$(egrep 'MACHINE_SERIAL|QEMU_' $MACHINE_CONF |bb2sh)"
 
-eval $(bitbake -e mc:qemu$ARCH-$DISTRO:isar-image-base | grep "\(^IMAGE_TYPE=\|^IMAGE_FULLNAME=\)")
+eval $(bitbake -e mc:qemu$ARCH-$DISTRO:isar-image-base | grep "\(^IMAGE_FSTYPES=\|^IMAGE_FULLNAME=\)")
 # Take first image type for VM if there are several defined
-IMAGE_TYPE=$(echo "$IMAGE_TYPE" | sed -e 's/\s.*$//')
-case "$IMAGE_TYPE" in
+IMAGE_FSTYPES=$(echo "$IMAGE_FSTYPES" | sed -e 's/\s.*$//')
+case "$IMAGE_FSTYPES" in
     ext4-img)
     readonly ROOTFS_IMAGE=$IMAGE_FULLNAME.ext4.img
 
@@ -135,7 +135,7 @@ case "$IMAGE_TYPE" in
     EXTRA_ARGS="$EXTRA_ARGS -snapshot"
     ;;
     *)
-    echo "IMAGE_TYPE \"$IMAGE_TYPE\" not supported"
+    echo "IMAGE_FSTYPES \"$IMAGE_FSTYPES\" not supported"
     exit 1
     ;;
 esac
diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
index 06fc935..bbbd2e3 100755
--- a/testsuite/start_vm.py
+++ b/testsuite/start_vm.py
@@ -28,7 +28,7 @@ def format_qemu_cmdline(arch, build, distro):
     extra_args = ''
     cpu = ['']
 
-    image_type = get_bitbake_var(bb_output, 'IMAGE_TYPE').split()[0]
+    image_type = get_bitbake_var(bb_output, 'IMAGE_FSTYPES').split()[0]
     deploy_dir_image = get_bitbake_var(bb_output, 'DEPLOY_DIR_IMAGE')
     if image_type == 'ext4-img':
         rootfs_image = 'isar-image-base-debian-' + distro + '-qemu' + arch + '.ext4.img'
-- 
2.20.1


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 2/5] wic-img: Set weak default value for WKS_FILE
  2021-09-28  7:13 ` [PATCH v2 2/5] wic-img: Set weak default value for WKS_FILE Uladzimir Bely
@ 2021-10-05  8:49   ` Henning Schild
  0 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-10-05  8:49 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

Am Tue, 28 Sep 2021 09:13:49 +0200
schrieb Uladzimir Bely <ubely@ilbers.de>:

> In case user lists "wic-img" in IMAGE_TYPE variable, bitbake fails
> at early parsing stages because WKS_FILE is not defined at this
> moment.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  meta/classes/wic-img.bbclass | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/meta/classes/wic-img.bbclass
> b/meta/classes/wic-img.bbclass index d849ad9..50e9819 100644
> --- a/meta/classes/wic-img.bbclass
> +++ b/meta/classes/wic-img.bbclass
> @@ -6,6 +6,9 @@
>  
>  WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' %
> os.path.exists('${WKS_FULL_PATH}')}" 
> +# In case user has chosen wic-img in local.conf without mandatory
> WKS_FILE, define default +WKS_FILE ??= "sdimage-efi"
> +

i guess the comment is not needed, should be clear to anyone that this
is just a weak default

With this you can drop WKS_FILE from some machine confs.

Henning

>  do_copy_wks_template[file-checksums] += "${WKS_FILE_CHECKSUM}"
>  do_copy_wks_template () {
>      cp -f '${WKS_TEMPLATE_PATH}' '${WORKDIR}/${WKS_TEMPLATE_FILE}'


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 3/5] start_vm: Use the first image type to start VM
  2021-09-28  7:13 ` [PATCH v2 3/5] start_vm: Use the first image type to start VM Uladzimir Bely
@ 2021-10-05  8:52   ` Henning Schild
  0 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-10-05  8:52 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

Am Tue, 28 Sep 2021 09:13:50 +0200
schrieb Uladzimir Bely <ubely@ilbers.de>:

> If there are several image types listed in IMAGE_TYPE, we need
> to use the only to start VM. Let first one be the default.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  scripts/start_vm      | 2 ++
>  testsuite/start_vm.py | 2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/start_vm b/scripts/start_vm
> index 28ada30..77c4244 100755
> --- a/scripts/start_vm
> +++ b/scripts/start_vm
> @@ -110,6 +110,8 @@ readonly
> MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf eval
> "$(egrep 'MACHINE_SERIAL|QEMU_' $MACHINE_CONF |bb2sh)" 
>  eval $(bitbake -e mc:qemu$ARCH-$DISTRO:isar-image-base | grep
> "\(^IMAGE_TYPE=\|^IMAGE_FULLNAME=\)") +# Take first image type for VM
> if there are several defined +IMAGE_TYPE=$(echo "$IMAGE_TYPE" | sed
> -e 's/\s.*$//') case "$IMAGE_TYPE" in

i would find " | awk '{print $1}'" much more readable, in which case
the comment can go.

Henning

>      ext4-img)
>      readonly ROOTFS_IMAGE=$IMAGE_FULLNAME.ext4.img
> diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
> index a3e32ac..06fc935 100755
> --- a/testsuite/start_vm.py
> +++ b/testsuite/start_vm.py
> @@ -28,7 +28,7 @@ def format_qemu_cmdline(arch, build, distro):
>      extra_args = ''
>      cpu = ['']
>  
> -    image_type = get_bitbake_var(bb_output, 'IMAGE_TYPE')
> +    image_type = get_bitbake_var(bb_output, 'IMAGE_TYPE').split()[0]
>      deploy_dir_image = get_bitbake_var(bb_output, 'DEPLOY_DIR_IMAGE')
>      if image_type == 'ext4-img':
>          rootfs_image = 'isar-image-base-debian-' + distro + '-qemu'
> + arch + '.ext4.img'


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 4/5] meta-isar: Rework mc:qemuamd64-buster configs
  2021-09-28  7:13 ` [PATCH v2 4/5] meta-isar: Rework mc:qemuamd64-buster configs Uladzimir Bely
@ 2021-10-05  8:54   ` Henning Schild
  0 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-10-05  8:54 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

Am Tue, 28 Sep 2021 09:13:51 +0200
schrieb Uladzimir Bely <ubely@ilbers.de>:

> We remove mc:qemuamd64-buster-tgz config that explicitly creates
> tgz-img, and mc:qemuamd64-buster-cpiogz config that createc cpiogz
> image, but add these image types to common mc:qemuamd64-buster config.
> 
> This gives several output image types for this machine and
> allows to test this feature in CI.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  meta-isar/conf/local.conf.sample                        | 2 --
>  meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf | 9 ---------
>  meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf    | 9 ---------
>  meta-isar/conf/multiconfig/qemuamd64-buster.conf        | 2 ++
>  scripts/ci_build.sh                                     | 5 ++---
>  5 files changed, 4 insertions(+), 23 deletions(-)
>  delete mode 100644
> meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf delete mode
> 100644 meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf
> 
> diff --git a/meta-isar/conf/local.conf.sample
> b/meta-isar/conf/local.conf.sample index 88a8175..d90c739 100644
> --- a/meta-isar/conf/local.conf.sample
> +++ b/meta-isar/conf/local.conf.sample
> @@ -49,8 +49,6 @@ BBMULTICONFIG = " \
>      qemui386-bullseye \
>      qemuamd64-stretch \
>      qemuamd64-buster \
> -    qemuamd64-buster-tgz \
> -    qemuamd64-buster-cpiogz \
>      qemuamd64-bullseye \
>      container-amd64-stretch \
>      container-amd64-buster \
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
> b/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf deleted
> file mode 100644 index cadcdac..0000000
> --- a/meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -# This software is a part of ISAR.
> -# Copyright (c) Siemens AG, 2020
> -#
> -# SPDX-License-Identifier: MIT
> -
> -MACHINE ?= "qemuamd64"
> -DISTRO ?= "debian-buster"
> -
> -IMAGE_TYPE = "cpiogz-img"
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf
> b/meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf deleted file
> mode 100644 index 17de338..0000000
> --- a/meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -# This software is a part of ISAR.
> -# Copyright (c) Siemens AG, 2018
> -#
> -# SPDX-License-Identifier: MIT
> -
> -MACHINE ?= "qemuamd64"
> -DISTRO ?= "debian-buster"
> -
> -IMAGE_TYPE ?= "targz-img"
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster.conf
> b/meta-isar/conf/multiconfig/qemuamd64-buster.conf index
> 3fabd67..d8139f7 100644 ---
> a/meta-isar/conf/multiconfig/qemuamd64-buster.conf +++
> b/meta-isar/conf/multiconfig/qemuamd64-buster.conf @@ -2,3 +2,5 @@
>  
>  MACHINE ?= "qemuamd64"
>  DISTRO ?= "debian-buster"
> +
> +IMAGE_TYPE ?= "wic-img targz-img cpiogz-img"

I think the patch order might be wrong, this one maybe will not yet
work at this point.

> diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
> index 48a51f2..c39ba3b 100755
> --- a/scripts/ci_build.sh
> +++ b/scripts/ci_build.sh
> @@ -36,8 +36,6 @@ TARGETS_SET="\
>              mc:qemui386-buster:isar-image-base \
>              mc:qemuamd64-stretch:isar-image-base \
>              mc:qemuamd64-buster:isar-image-base \
> -            mc:qemuamd64-buster-tgz:isar-image-base \
> -            mc:qemuamd64-buster-cpiogz:isar-image-base \
>              mc:qemuamd64-buster:isar-initramfs \
>              mc:qemumipsel-stretch:isar-image-base \
>              mc:qemumipsel-buster:isar-image-base \
> @@ -196,6 +194,7 @@ if [ -n "$REPRO_BUILD" ]; then
>      sed -i -e 's/ISAR_USE_CACHED_BASE_REPO ?=
> "1"/#ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf sed -i -e
> 's/^BB_NO_NETWORK/#BB_NO_NETWORK/g' conf/local.conf sed -i -e
> 's/^BASE_REPO_KEY/#BASE_REPO_KEY/g' conf/local.conf +
>      bitbake $BB_ARGS $REPRO_TARGETS_SET
>      while [ -e bitbake.sock ]; do sleep 1; done
>      # Enable use of unsigned cached base repository
> @@ -205,6 +204,7 @@ if [ -n "$REPRO_BUILD" ]; then
>      bitbake $BB_ARGS $REPRO_TARGETS_SET
>      while [ -e bitbake.sock ]; do sleep 1; done
>      # Disable use of unsigned cached base repository
> +

a few whitespace ghost changes ... but maybe intended ...

>      sed -i -e 's/ISAR_USE_CACHED_BASE_REPO ?=
> "1"/#ISAR_USE_CACHED_BASE_REPO ?= "1"/g' conf/local.conf sed -i -e
> 's/^BB_NO_NETWORK/#BB_NO_NETWORK/g' conf/local.conf # Try to build
> with changed configuration with no cleanup @@ -273,4 +273,3 @@ while
> [ -e bitbake.sock ]; do sleep 1; done echo 'SDK_FORMATS =
> "docker-archive"' >> conf/local.conf bitbake $BB_ARGS -c
> do_populate_sdk mc:container-amd64-stretch:isar-image-base while [ -e
> bitbake.sock ]; do sleep 1; done -


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 5/5] api: Rename IMAGE_TYPE to IMAGE_FSTYPES
  2021-09-28  7:13 ` [PATCH v2 5/5] api: Rename IMAGE_TYPE to IMAGE_FSTYPES Uladzimir Bely
@ 2021-10-05  8:56   ` Henning Schild
  0 siblings, 0 replies; 12+ messages in thread
From: Henning Schild @ 2021-10-05  8:56 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

Am Tue, 28 Sep 2021 09:13:52 +0200
schrieb Uladzimir Bely <ubely@ilbers.de>:

> The variable is renamed to get closer to OpenEmbedded/Poky
> variables naming. If user still uses IMAGE_TYPE, it will be used
> with the deprecation warning shown.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  RECIPE-API-CHANGELOG.md                       |  5 ++++
>  doc/user_manual.md                            | 23
> +++++++++++-------- meta-isar/conf/machine/bananapi.conf          |
> 2 +- meta-isar/conf/machine/container-amd64.conf   |  2 +-
>  meta-isar/conf/machine/de0-nano-soc.conf      |  2 +-
>  meta-isar/conf/machine/hikey.conf             |  2 +-
>  meta-isar/conf/machine/nand-ubi-demo.conf     |  2 +-
>  meta-isar/conf/machine/nanopi-neo.conf        |  2 +-
>  meta-isar/conf/machine/qemuamd64.conf         |  2 +-
>  meta-isar/conf/machine/qemuarm.conf           |  2 +-
>  meta-isar/conf/machine/qemuarm64.conf         |  2 +-
>  meta-isar/conf/machine/qemui386.conf          |  2 +-
>  meta-isar/conf/machine/qemumipsel.conf        |  2 +-
>  meta-isar/conf/machine/qemuriscv64.conf       |  2 +-
>  meta-isar/conf/machine/rpi.conf               |  2 +-
>  meta-isar/conf/machine/sifive-fu540.conf      |  2 +-
>  meta-isar/conf/machine/stm32mp15x.conf        |  2 +-
>  .../conf/multiconfig/qemuamd64-buster.conf    |  2 +-
>  meta/classes/image.bbclass                    |  6 +++--
>  scripts/start_vm                              |  8 +++----
>  testsuite/start_vm.py                         |  2 +-
>  21 files changed, 44 insertions(+), 32 deletions(-)
> 
> diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
> index 7312d4d..5583625 100644
> --- a/RECIPE-API-CHANGELOG.md
> +++ b/RECIPE-API-CHANGELOG.md
> @@ -301,3 +301,8 @@ Kernel update with "apt-get" will not work since
> bootloader configuration will not be updated. It used to "kind of
> work" for grub and efi, that hack is gone. 
>  When using the plugins it is advised to name the partition "/boot"
> and to exclude boot from the follwing rootfs to not waste space. +
> +### Rename IMAGE_TYPE to IMAGE_FSTYPES

It should be made clear that it now is an array.

> +
> +The variable is renamed to get closer to OE/Poky variables naming.
> The old naming +will still also work, but with deprecation warning
> shown. diff --git a/doc/user_manual.md b/doc/user_manual.md
> index 01fe701..8b17710 100644
> --- a/doc/user_manual.md
> +++ b/doc/user_manual.md
> @@ -209,7 +209,10 @@ tmp/deploy/images/rpi/isar-image-base.rpi-sdimg
>  
>  ### Generate full disk image
>  
> -A bootable disk image is generated if you set IMAGE_TYPE to
> 'wic-img'. Behind the scenes a tool called `wic` is used to assemble
> the images. It is controlled by a `.wks` file which you can choose
> with changing WKS_FILE. Some examples in the tree use that feature
> already. +A bootable disk image is generated if you set IMAGE_FSTYPES
> to 'wic-img'. +Behind the scenes a tool called `wic` is used to
> assemble the images. +It is controlled by a `.wks` file which you can
> choose with changing WKS_FILE. +Some examples in the tree use that
> feature already. ``` # Generate an image for the `i386` target
> architecture $ bitbake mc:qemui386-buster:isar-image-base @@ -245,7
> +248,7 @@ https://github.com/intel/bmap-tools ### Generate container
> image with root filesystem 
> -A runnable container image is generated if you set IMAGE_TYPE to 
> +A runnable container image is generated if you set IMAGE_FSTYPES to
>  'container-img'.

Not "set to" but "contains", that same comment applies for several
places.

Henning

>  Getting a container image can be the main purpose of an Isar
> configuration, but not only.
> @@ -286,8 +289,8 @@ The resulting container image archives (only for
> `docker-archive` and For one-shot builds (use `local.conf` otherwise):
>  
>  ```
> -export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE IMAGE_TYPE
> CONTAINER_FORMAT" -export IMAGE_TYPE="container-img"
> +export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE IMAGE_FSTYPES
> CONTAINER_FORMAT" +export IMAGE_FSTYPES="container-img"
>  export CONTAINER_FORMAT="docker-archive"
>  ```
>  
> @@ -448,7 +451,9 @@ Please refer to `Add a Custom Application`
> section for more information about wr 
>  ## Image Type Selection
>  
> -Isar can generate various images types for specific machine. The
> type of the image to be generated may be specified through the
> `IMAGE_TYPE` variable. Currently, the following image types are
> provided: +Isar can generate various images types for specific
> machine. The type of the +image to be generated may be specified
> through the `IMAGE_FSTYPES` variable. +Currently, the following image
> types are provided: 
>   - `ext4` - Raw ext4 filesystem image (default option for `qemuarm`
> machine).
>   - `rpi-sdimg` - A complete, partitioned Raspberry Pi SD card image
> (default option for the `rpi` machine). @@ -507,7 +512,7 @@ Every
> machine is described in its configuration file. The file defines the
> follo
>   - `KERNEL_IMAGE` - The name of kernel binary that it installed to
> `/boot` folder in target filesystem. This variable is used by Isar to
> extract the kernel binary and put it into the deploy folder. This
> makes sense for embedded devices, where kernel and root filesystem
> are written to different flash partitions. This variable is optional.
>   - `INITRD_IMAGE` - The name of `ramdisk` binary. The meaning of
> this variable is similar to `KERNEL_IMAGE`. This variable is optional.
>   - `MACHINE_SERIAL` - The name of serial device that will be used
> for console output.
> - - `IMAGE_TYPE` - The type of images to be generated for this
> machine.
> + - `IMAGE_FSTYPES` - The type of images to be generated for this
> machine. 
>  Below is an example of machine configuration file for `Raspberry Pi`
> board: ```
> @@ -516,7 +521,7 @@ IMAGE_PREINSTALL = "linux-image-rpi-rpfv \
>  KERNEL_IMAGE = "vmlinuz-4.4.0-1-rpi"
>  INITRD_IMAGE = "initrd.img-4.4.0-1-rpi"
>  MACHINE_SERIAL = "ttyAMA0"
> -IMAGE_TYPE = "rpi-sdimg"
> +IMAGE_FSTYPES = "rpi-sdimg"
>  ```
>  
>  To add new machine user should perform the following steps:
> @@ -549,7 +554,7 @@ The user may use `meta-isar/recipes-core/images`
> as a template for new image rec ### General Information
>  The image recipe in Isar creates a folder with target root
> filesystem. Its default location is: ```
> -tmp/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_TYPE}/${PV}-${PR}/rootfs
> +tmp/work/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_FSTYPES}/${PV}-${PR}/rootfs
>  ```
>  Every image type in Isar is implemented as a `bitbake` class. The
> goal of these classes is to pack root filesystem folder to
> appropriate format. @@ -572,7 +577,7 @@ The content of `do_my_image`
> function can be implemented either in shell or in P 
>  In the machine configuration file, set the following:
>  ```
> -IMAGE_TYPE = "my-image"
> +IMAGE_FSTYPES = "my-image"
>  ```
>  
>  ### Reference Classes
> diff --git a/meta-isar/conf/machine/bananapi.conf
> b/meta-isar/conf/machine/bananapi.conf index cec8057..dd3a066 100644
> --- a/meta-isar/conf/machine/bananapi.conf
> +++ b/meta-isar/conf/machine/bananapi.conf
> @@ -9,6 +9,6 @@ KERNEL_NAME ?= "armmp"
>  
>  IMAGE_INSTALL += "u-boot-script"
>  
> -IMAGE_TYPE ?= "wic-img"
> +IMAGE_FSTYPES ?= "wic-img"
>  WKS_FILE ?= "bananapi"
>  IMAGER_INSTALL += "u-boot-sunxi"
> diff --git a/meta-isar/conf/machine/container-amd64.conf
> b/meta-isar/conf/machine/container-amd64.conf index d2978c4..1f7669a
> 100644 --- a/meta-isar/conf/machine/container-amd64.conf
> +++ b/meta-isar/conf/machine/container-amd64.conf
> @@ -4,4 +4,4 @@
>  # SPDX-License-Identifier: MIT
>  
>  DISTRO_ARCH ?= "amd64"
> -IMAGE_TYPE ?= "container-img"
> +IMAGE_FSTYPES ?= "container-img"
> diff --git a/meta-isar/conf/machine/de0-nano-soc.conf
> b/meta-isar/conf/machine/de0-nano-soc.conf index 5e35602..f822e24
> 100644 --- a/meta-isar/conf/machine/de0-nano-soc.conf
> +++ b/meta-isar/conf/machine/de0-nano-soc.conf
> @@ -11,7 +11,7 @@ PREFERRED_PROVIDER_u-boot-de0-nano-soc =
> "u-boot-de0-nano-soc" U_BOOT_CONFIG_de0-nano-soc =
> "socfpga_de0_nano_soc_defconfig" U_BOOT_BIN_de0-nano-soc =
> "u-boot-with-spl.sfp" 
> -IMAGE_TYPE ?= "wic-img"
> +IMAGE_FSTYPES ?= "wic-img"
>  WKS_FILE ?= "de0-nano-soc.wks.in"
>  IMAGER_INSTALL += "u-boot-de0-nano-soc"
>  IMAGER_BUILD_DEPS += "u-boot-de0-nano-soc"
> diff --git a/meta-isar/conf/machine/hikey.conf
> b/meta-isar/conf/machine/hikey.conf index 09dfaf4..615d674 100644
> --- a/meta-isar/conf/machine/hikey.conf
> +++ b/meta-isar/conf/machine/hikey.conf
> @@ -7,7 +7,7 @@ DISTRO_ARCH = "arm64"
>  
>  KERNEL_NAME ?= "mainline"
>  
> -IMAGE_TYPE = "wic-img"
> +IMAGE_FSTYPES = "wic-img"
>  WKS_FILE ?= "hikey"
>  IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
>  
> diff --git a/meta-isar/conf/machine/nand-ubi-demo.conf
> b/meta-isar/conf/machine/nand-ubi-demo.conf index 25ec72f..5be337f
> 100644 --- a/meta-isar/conf/machine/nand-ubi-demo.conf
> +++ b/meta-isar/conf/machine/nand-ubi-demo.conf
> @@ -8,6 +8,6 @@ BAUDRATE_TTY ?= "115200"
>  
>  MKUBIFS_ARGS := "-m 0x1000 -e 0x3e000 -c 1500"
>  UBINIZE_ARGS = "-vv -m 0x1000 -p 0x40000"
> -IMAGE_TYPE ?= "ubi-ubifs-img"
> +IMAGE_FSTYPES ?= "ubi-ubifs-img"
>  
>  DTB_FILES = "imx6q-sabrelite.dtb"
> diff --git a/meta-isar/conf/machine/nanopi-neo.conf
> b/meta-isar/conf/machine/nanopi-neo.conf index 703b4f4..2475ce9 100644
> --- a/meta-isar/conf/machine/nanopi-neo.conf
> +++ b/meta-isar/conf/machine/nanopi-neo.conf
> @@ -7,7 +7,7 @@ DISTRO_ARCH ?= "armhf"
>  
>  KERNEL_NAME ?= "armmp"
>  
> -IMAGE_TYPE ?= "wic-img"
> +IMAGE_FSTYPES ?= "wic-img"
>  WKS_FILE ?= "nanopi-neo.wks.in"
>  
>  IMAGE_INSTALL += "u-boot-script"
> diff --git a/meta-isar/conf/machine/qemuamd64.conf
> b/meta-isar/conf/machine/qemuamd64.conf index dab4f09..ccfde39 100644
> --- a/meta-isar/conf/machine/qemuamd64.conf
> +++ b/meta-isar/conf/machine/qemuamd64.conf
> @@ -6,7 +6,7 @@ DISTRO_ARCH ?= "amd64"
>  KERNEL_NAME ?= "amd64"
>  KERNEL_NAME_ubuntu-focal ?= "generic"
>  
> -IMAGE_TYPE ?= "wic-img"
> +IMAGE_FSTYPES ?= "wic-img"
>  WKS_FILE ?= "sdimage-efi"
>  IMAGER_INSTALL += "${GRUB_BOOTLOADER_INSTALL}"
>  
> diff --git a/meta-isar/conf/machine/qemuarm.conf
> b/meta-isar/conf/machine/qemuarm.conf index fbbdc23..20a71ea 100644
> --- a/meta-isar/conf/machine/qemuarm.conf
> +++ b/meta-isar/conf/machine/qemuarm.conf
> @@ -5,7 +5,7 @@ DISTRO_ARCH ?= "armhf"
>  
>  KERNEL_NAME ?= "armmp"
>  
> -IMAGE_TYPE ?= "ext4-img"
> +IMAGE_FSTYPES ?= "ext4-img"
>  
>  QEMU_ROOTFS_DEV ?= "vda"
>  
> diff --git a/meta-isar/conf/machine/qemuarm64.conf
> b/meta-isar/conf/machine/qemuarm64.conf index e5e762f..ca23cef 100644
> --- a/meta-isar/conf/machine/qemuarm64.conf
> +++ b/meta-isar/conf/machine/qemuarm64.conf
> @@ -6,7 +6,7 @@ DISTRO_ARCH ?= "arm64"
>  KERNEL_NAME ?= "arm64"
>  KERNEL_NAME_ubuntu-focal ?= "generic"
>  
> -IMAGE_TYPE ?= "ext4-img"
> +IMAGE_FSTYPES ?= "ext4-img"
>  
>  QEMU_ROOTFS_DEV ?= "vda"
>  
> diff --git a/meta-isar/conf/machine/qemui386.conf
> b/meta-isar/conf/machine/qemui386.conf index e6afb06..17cff1e 100644
> --- a/meta-isar/conf/machine/qemui386.conf
> +++ b/meta-isar/conf/machine/qemui386.conf
> @@ -4,7 +4,7 @@ DISTRO_ARCH ?= "i386"
>  
>  KERNEL_NAME ?= "686-pae"
>  
> -IMAGE_TYPE ?= "wic-img"
> +IMAGE_FSTYPES ?= "wic-img"
>  WKS_FILE ?= "directdisk-isar"
>  IMAGER_INSTALL += "${SYSLINUX_BOOTLOADER_INSTALL}"
>  
> diff --git a/meta-isar/conf/machine/qemumipsel.conf
> b/meta-isar/conf/machine/qemumipsel.conf index 85178ee..b34e46d 100644
> --- a/meta-isar/conf/machine/qemumipsel.conf
> +++ b/meta-isar/conf/machine/qemumipsel.conf
> @@ -5,7 +5,7 @@ DISTRO_ARCH ?= "mipsel"
>  
>  KERNEL_NAME ?= "4kc-malta"
>  
> -IMAGE_TYPE ?= "ext4-img"
> +IMAGE_FSTYPES ?= "ext4-img"
>  
>  QEMU_ROOTFS_DEV ?= "sda"
>  
> diff --git a/meta-isar/conf/machine/qemuriscv64.conf
> b/meta-isar/conf/machine/qemuriscv64.conf index f4f5312..5c687a0
> 100644 --- a/meta-isar/conf/machine/qemuriscv64.conf
> +++ b/meta-isar/conf/machine/qemuriscv64.conf
> @@ -8,7 +8,7 @@ DISTRO_ARCH ?= "riscv64"
>  
>  KERNEL_NAME ?= "riscv64"
>  
> -IMAGE_TYPE ?= "ext4-img"
> +IMAGE_FSTYPES ?= "ext4-img"
>  
>  QEMU_ROOTFS_DEV ?= "vda"
>  
> diff --git a/meta-isar/conf/machine/rpi.conf
> b/meta-isar/conf/machine/rpi.conf index 31f2219..61852a9 100644
> --- a/meta-isar/conf/machine/rpi.conf
> +++ b/meta-isar/conf/machine/rpi.conf
> @@ -4,4 +4,4 @@
>  MACHINE_SERIAL ?= "ttyAMA0"
>  BAUDRATE_TTY ?= "9600"
>  
> -IMAGE_TYPE ?= "rpi-sdimg"
> +IMAGE_FSTYPES ?= "rpi-sdimg"
> diff --git a/meta-isar/conf/machine/sifive-fu540.conf
> b/meta-isar/conf/machine/sifive-fu540.conf index c815f4a..d73f047
> 100644 --- a/meta-isar/conf/machine/sifive-fu540.conf
> +++ b/meta-isar/conf/machine/sifive-fu540.conf
> @@ -7,7 +7,7 @@ DISTRO_ARCH = "riscv64"
>  
>  KERNEL_NAME ?= "mainline"
>  
> -IMAGE_TYPE ?= "wic-img"
> +IMAGE_FSTYPES ?= "wic-img"
>  WKS_FILE ?= "sifive-fu540"
>  IMAGER_INSTALL += "opensbi-sifive-fu540"
>  IMAGER_BUILD_DEPS += "opensbi-sifive-fu540"
> diff --git a/meta-isar/conf/machine/stm32mp15x.conf
> b/meta-isar/conf/machine/stm32mp15x.conf index e963d08..22e88ea 100644
> --- a/meta-isar/conf/machine/stm32mp15x.conf
> +++ b/meta-isar/conf/machine/stm32mp15x.conf
> @@ -11,7 +11,7 @@ PREFERRED_PROVIDER_u-boot-stm32mp15x =
> "u-boot-stm32mp15x" U_BOOT_CONFIG_stm32mp15x =
> "stm32mp15_trusted_defconfig" U_BOOT_BIN_stm32mp15x = "u-boot.stm32"
>  
> -IMAGE_TYPE ?= "wic-img"
> +IMAGE_FSTYPES ?= "wic-img"
>  WKS_FILE ?= "stm32mp15x.wks.in"
>  IMAGER_INSTALL += "trusted-firmware-a-stm32mp15x optee-os-stm32mp15x
> u-boot-stm32mp15x" IMAGER_BUILD_DEPS +=
> "trusted-firmware-a-stm32mp15x optee-os-stm32mp15x u-boot-stm32mp15x"
> diff --git a/meta-isar/conf/multiconfig/qemuamd64-buster.conf
> b/meta-isar/conf/multiconfig/qemuamd64-buster.conf index
> d8139f7..26f4f4c 100644 ---
> a/meta-isar/conf/multiconfig/qemuamd64-buster.conf +++
> b/meta-isar/conf/multiconfig/qemuamd64-buster.conf @@ -3,4 +3,4 @@
> MACHINE ?= "qemuamd64" DISTRO ?= "debian-buster"
>  
> -IMAGE_TYPE ?= "wic-img targz-img cpiogz-img"
> +IMAGE_FSTYPES ?= "wic-img targz-img cpiogz-img"
> \ No newline at end of file
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index eecada3..e923318 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -7,7 +7,7 @@ STAMP =
> "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/${PV}-${PR}"
> STAMPCLEAN =
> "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}/*-*"
> IMAGE_INSTALL ?= "" -IMAGE_TYPE    ?= "ext4-img"
> +IMAGE_FSTYPES ?= "${@ d.getVar("IMAGE_TYPE", True) if
> d.getVar("IMAGE_TYPE", True) else "ext4-img"}" IMAGE_ROOTFS ?=
> "${WORKDIR}/rootfs" 
>  IMAGE_INSTALL += "${@ ("linux-image-" + d.getVar("KERNEL_NAME",
> True)) if d.getVar("KERNEL_NAME", True) else ""}" @@ -36,6 +36,8 @@
> BUILDROOT_WORK = "${BUILDCHROOT_DIR}${PP_WORK}" python(){
>      if (d.getVar('IMAGE_TRANSIENT_PACKAGES')):
>          bb.warn("IMAGE_TRANSIENT_PACKAGES is set and no longer
> supported")
> +    if (d.getVar('IMAGE_TYPE')):
> +        bb.warn("IMAGE_TYPE is deprecated, please switch to
> IMAGE_FSTYPES") }
>  
>  def cfg_script(d):
> @@ -220,4 +222,4 @@ EOSUDO
>  addtask rootfs_finalize before do_rootfs after do_rootfs_postprocess
>  
>  # Last so that the image type can overwrite tasks if needed
> -inherit ${IMAGE_TYPE}
> +inherit ${IMAGE_FSTYPES}
> diff --git a/scripts/start_vm b/scripts/start_vm
> index 77c4244..5717c7c 100755
> --- a/scripts/start_vm
> +++ b/scripts/start_vm
> @@ -109,10 +109,10 @@ readonly ISARROOT="$(dirname "$0")"/..
>  readonly MACHINE_CONF=$ISARROOT/meta-isar/conf/machine/qemu$ARCH.conf
>  eval "$(egrep 'MACHINE_SERIAL|QEMU_' $MACHINE_CONF |bb2sh)"
>  
> -eval $(bitbake -e mc:qemu$ARCH-$DISTRO:isar-image-base | grep
> "\(^IMAGE_TYPE=\|^IMAGE_FULLNAME=\)") +eval $(bitbake -e
> mc:qemu$ARCH-$DISTRO:isar-image-base | grep
> "\(^IMAGE_FSTYPES=\|^IMAGE_FULLNAME=\)") # Take first image type for
> VM if there are several defined -IMAGE_TYPE=$(echo "$IMAGE_TYPE" |
> sed -e 's/\s.*$//') -case "$IMAGE_TYPE" in +IMAGE_FSTYPES=$(echo
> "$IMAGE_FSTYPES" | sed -e 's/\s.*$//') +case "$IMAGE_FSTYPES" in
>      ext4-img)
>      readonly ROOTFS_IMAGE=$IMAGE_FULLNAME.ext4.img
>  
> @@ -135,7 +135,7 @@ case "$IMAGE_TYPE" in
>      EXTRA_ARGS="$EXTRA_ARGS -snapshot"
>      ;;
>      *)
> -    echo "IMAGE_TYPE \"$IMAGE_TYPE\" not supported"
> +    echo "IMAGE_FSTYPES \"$IMAGE_FSTYPES\" not supported"
>      exit 1
>      ;;
>  esac
> diff --git a/testsuite/start_vm.py b/testsuite/start_vm.py
> index 06fc935..bbbd2e3 100755
> --- a/testsuite/start_vm.py
> +++ b/testsuite/start_vm.py
> @@ -28,7 +28,7 @@ def format_qemu_cmdline(arch, build, distro):
>      extra_args = ''
>      cpu = ['']
>  
> -    image_type = get_bitbake_var(bb_output, 'IMAGE_TYPE').split()[0]
> +    image_type = get_bitbake_var(bb_output,
> 'IMAGE_FSTYPES').split()[0] deploy_dir_image =
> get_bitbake_var(bb_output, 'DEPLOY_DIR_IMAGE') if image_type ==
> 'ext4-img': rootfs_image = 'isar-image-base-debian-' + distro +
> '-qemu' + arch + '.ext4.img'


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/5] Support multiple image types in one build
  2021-09-28  7:13 [PATCH v2 0/5] Support multiple image types in one build Uladzimir Bely
                   ` (4 preceding siblings ...)
  2021-09-28  7:13 ` [PATCH v2 5/5] api: Rename IMAGE_TYPE to IMAGE_FSTYPES Uladzimir Bely
@ 2021-10-05  9:08 ` Henning Schild
  2021-11-18 13:41   ` Baurzhan Ismagulov
  5 siblings, 1 reply; 12+ messages in thread
From: Henning Schild @ 2021-10-05  9:08 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

In fact having exactly one image type and using multiconfig is already
very powerful. We have layers where we have custom image classes which
include existing ones and are set as the "main type". That is super
flexible already.

I am not a fan of mc, but here we have a proposal that seems to want to
defeat mc and is lacking a clear motivation. At least i do not fully
understand why that change makes sense. The main point could be OE
alignment which might be good enough but not really too important.

A simple array list is much less flexible. Imagine you want to have a
wic-img and an ext4 and your rootfs contains "expand-on-first-boot",
meaning wic will grow once on device ... while ext4 might need another
ROOTFS_EXTRA/_SIZE. In fact one will likely even have different
packages installed depending on the type. While packing the same rootfs
into multiple images will work it is much nicer to adapt the content to
the type. i.e. a container might need less of an init
system/kernel/initrd or filesystem support, a wic will maybe need
bootloader bits, and an ext4 will not need expand-on-first-boot (like
container as well)

Henning


Am Tue, 28 Sep 2021 09:13:47 +0200
schrieb Uladzimir Bely <ubely@ilbers.de>:

> Changes since v1:
> - removed mc:qemuamd64-buster-cpiogz config
> - mc:qemuamd64-buster config now includes cpiogz image type
> 
> The patchset makes possible to build several image types for
> the specific target by listing all them in IMG_FSTYPES variable.
> 
> This also deprecates using IMG_TYPE variable.
> 
> Uladzimir Bely (5):
>   image: Make WORKDIR and STAMPs unrelated to IMAGE_TYPE
>   wic-img: Set weak default value for WKS_FILE
>   start_vm: Use the first image type to start VM
>   meta-isar: Rework mc:qemuamd64-buster configs
>   api: Rename IMAGE_TYPE to IMAGE_FSTYPES
> 
>  RECIPE-API-CHANGELOG.md                       |  5 ++++
>  doc/user_manual.md                            | 23
> +++++++++++-------- meta-isar/conf/local.conf.sample              |
> 2 -- meta-isar/conf/machine/bananapi.conf          |  2 +-
>  meta-isar/conf/machine/container-amd64.conf   |  2 +-
>  meta-isar/conf/machine/de0-nano-soc.conf      |  2 +-
>  meta-isar/conf/machine/hikey.conf             |  2 +-
>  meta-isar/conf/machine/nand-ubi-demo.conf     |  2 +-
>  meta-isar/conf/machine/nanopi-neo.conf        |  2 +-
>  meta-isar/conf/machine/qemuamd64.conf         |  2 +-
>  meta-isar/conf/machine/qemuarm.conf           |  2 +-
>  meta-isar/conf/machine/qemuarm64.conf         |  2 +-
>  meta-isar/conf/machine/qemui386.conf          |  2 +-
>  meta-isar/conf/machine/qemumipsel.conf        |  2 +-
>  meta-isar/conf/machine/qemuriscv64.conf       |  2 +-
>  meta-isar/conf/machine/rpi.conf               |  2 +-
>  meta-isar/conf/machine/sifive-fu540.conf      |  2 +-
>  meta-isar/conf/machine/stm32mp15x.conf        |  2 +-
>  .../multiconfig/qemuamd64-buster-cpiogz.conf  |  9 --------
>  .../multiconfig/qemuamd64-buster-tgz.conf     |  9 --------
>  .../conf/multiconfig/qemuamd64-buster.conf    |  2 ++
>  meta/classes/image.bbclass                    | 12 ++++++----
>  meta/classes/wic-img.bbclass                  |  3 +++
>  scripts/ci_build.sh                           |  5 ++--
>  scripts/start_vm                              |  8 ++++---
>  testsuite/start_vm.py                         |  2 +-
>  26 files changed, 54 insertions(+), 56 deletions(-)
>  delete mode 100644
> meta-isar/conf/multiconfig/qemuamd64-buster-cpiogz.conf delete mode
> 100644 meta-isar/conf/multiconfig/qemuamd64-buster-tgz.conf
> 


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH v2 0/5] Support multiple image types in one build
  2021-10-05  9:08 ` [PATCH v2 0/5] Support multiple image types in one build Henning Schild
@ 2021-11-18 13:41   ` Baurzhan Ismagulov
  0 siblings, 0 replies; 12+ messages in thread
From: Baurzhan Ismagulov @ 2021-11-18 13:41 UTC (permalink / raw)
  To: isar-users

On Tue, Oct 05, 2021 at 11:08:56AM +0200, Henning Schild wrote:
> In fact having exactly one image type and using multiconfig is already
> very powerful. We have layers where we have custom image classes which
> include existing ones and are set as the "main type". That is super
> flexible already.

No question :) .


> I am not a fan of mc, but here we have a proposal that seems to want to
> defeat mc and is lacking a clear motivation. At least i do not fully
> understand why that change makes sense. The main point could be OE
> alignment which might be good enough but not really too important.

I guess we didn't communicate it clearly enough, this change doesn't remove the
existing infrastructure -- the current way is still supported. v2 did touch the
existing testcases -- in v3, we don't change them anymore and add a new case
for testing the new functionality.


> A simple array list is much less flexible. Imagine you want to have a
> wic-img and an ext4 and your rootfs contains "expand-on-first-boot",
> meaning wic will grow once on device ... while ext4 might need another
> ROOTFS_EXTRA/_SIZE. In fact one will likely even have different
> packages installed depending on the type. While packing the same rootfs
> into multiple images will work it is much nicer to adapt the content to
> the type. i.e. a container might need less of an init
> system/kernel/initrd or filesystem support, a wic will maybe need
> bootloader bits, and an ext4 will not need expand-on-first-boot (like
> container as well)

Thanks for the detailed example. For this use case, this approach is fine.

The motivation for multiple image types is that BSP vendors want to provide all
types of images with one image.bb and n machines, without permutations like
mc:machine1-sd mc:machine1-tgz mc:machine2-sd mc:machine2-tgz. This change
implements this use case. We'll send v3 soon.


With kind regards,
Baurzhan.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-11-18 13:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28  7:13 [PATCH v2 0/5] Support multiple image types in one build Uladzimir Bely
2021-09-28  7:13 ` [PATCH v2 1/5] image: Make WORKDIR and STAMPs unrelated to IMAGE_TYPE Uladzimir Bely
2021-09-28  7:13 ` [PATCH v2 2/5] wic-img: Set weak default value for WKS_FILE Uladzimir Bely
2021-10-05  8:49   ` Henning Schild
2021-09-28  7:13 ` [PATCH v2 3/5] start_vm: Use the first image type to start VM Uladzimir Bely
2021-10-05  8:52   ` Henning Schild
2021-09-28  7:13 ` [PATCH v2 4/5] meta-isar: Rework mc:qemuamd64-buster configs Uladzimir Bely
2021-10-05  8:54   ` Henning Schild
2021-09-28  7:13 ` [PATCH v2 5/5] api: Rename IMAGE_TYPE to IMAGE_FSTYPES Uladzimir Bely
2021-10-05  8:56   ` Henning Schild
2021-10-05  9:08 ` [PATCH v2 0/5] Support multiple image types in one build Henning Schild
2021-11-18 13:41   ` Baurzhan Ismagulov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox