diff mbox series

[isar-cip-core,v2] Refactor tar.gz image option

Message ID 075ca777-ce0f-44aa-bbb5-4c5645fdb02d@siemens.com (mailing list archive)
State Accepted
Headers show
Series [isar-cip-core,v2] Refactor tar.gz image option | expand

Commit Message

Jan Kiszka May 17, 2024, 4:07 p.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

We have wic-targz.img, we have targz-img - that'c confusion. What we
need is a way to say "generate (also) tarball of the image" so that we
can feed LAVA specifically. If the normal target image is wic or already
a raw partition (simple QEMU targets) should not matter.

So, consolidate the kas options and the kconfig menu. Furthermore,
simplify the CI options so that tarballs are by default on and turn it
off actively in case that format has no user or cannot work in the first
place.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - fix kconfig menu, making targz now depend on the absence of swupdate

 .gitlab-ci.yml                       | 40 +++++++---------------------
 Kconfig                              | 27 +++++++------------
 kas/opt/{targz-img.yml => targz.yml} |  4 +--
 kas/opt/wic-targz-img.yml            | 20 --------------
 4 files changed, 21 insertions(+), 70 deletions(-)
 rename kas/opt/{targz-img.yml => targz.yml} (71%)
 delete mode 100644 kas/opt/wic-targz-img.yml
diff mbox series

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 72084f33..b4291d0d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -20,8 +20,7 @@  variables:
   extension: none
   use_rt: enable
   encrypt: disable
-  wic_targz: enable
-  targz: disable
+  targz: enable
   dtb: none
   deploy: enable
   deploy_kernelci: disable
@@ -58,8 +57,7 @@  default:
   script:
     - if [ "${use_rt}" = "enable" ]; then base_yaml="${base_yaml}:kas/opt/rt.yml"; fi
     - if [ "${extension}" != "none" ]; then base_yaml="${base_yaml}:kas/opt/${extension}.yml"; fi
-    - if [ "${wic_targz}" = "enable" ]; then base_yaml="${base_yaml}:kas/opt/wic-targz-img.yml"; fi
-    - if [ "${targz}" = "enable" ]; then base_yaml="${base_yaml}:kas/opt/targz-img.yml"; fi
+    - if [ "${targz}" = "enable" ]; then base_yaml="${base_yaml}:kas/opt/targz.yml"; fi
     - if [ "${release}" = "buster" ]; then base_yaml="${base_yaml}:kas/opt/buster.yml"; fi
     - if [ "${release}" = "bullseye" ]; then base_yaml="${base_yaml}:kas/opt/bullseye.yml"; fi
     - if [ "${release}" = "bookworm" ]; then base_yaml="${base_yaml}:kas/opt/bookworm.yml"; fi
@@ -111,8 +109,6 @@  build:qemu-amd64-base:
     target: qemu-amd64
     extension: security
     use_rt: disable
-    wic_targz: disable
-    targz: enable
     build_swu_v2: enable
 
 build:qemu-amd64-base-kernelci:
@@ -122,8 +118,6 @@  build:qemu-amd64-base-kernelci:
     target: qemu-amd64
     extension: kernelci
     use_rt: disable
-    wic_targz: disable
-    targz: enable
     deploy: disable
     deploy_kernelci: enable
 
@@ -134,8 +128,6 @@  build:qemu-arm64-base:
     target: qemu-arm64
     extension: security
     use_rt: disable
-    wic_targz: disable
-    targz: enable
     build_swu_v2: enable
 
 build:qemu-arm64-base-kernelci:
@@ -145,8 +137,6 @@  build:qemu-arm64-base-kernelci:
     target: qemu-arm64
     extension: kernelci
     use_rt: disable
-    wic_targz: disable
-    targz: enable
     deploy: disable
     deploy_kernelci: enable
 
@@ -157,8 +147,6 @@  build:qemu-arm-base:
     target: qemu-arm
     extension: security
     use_rt: disable
-    wic_targz: disable
-    targz: enable
     build_swu_v2: enable
 
 build:qemu-arm-base-kernelci:
@@ -168,8 +156,6 @@  build:qemu-arm-base-kernelci:
     target: qemu-arm
     extension: kernelci
     use_rt: disable
-    wic_targz: disable
-    targz: enable
     deploy: disable
     deploy_kernelci: enable
 
@@ -211,8 +197,6 @@  build:qemu-amd64-test:
   variables:
     target:  qemu-amd64
     extension: test
-    wic_targz: disable
-    targz: enable
 
 build:qemu-arm64-test:
   extends:
@@ -220,8 +204,6 @@  build:qemu-arm64-test:
   variables:
     target:  qemu-arm64
     extension: test
-    wic_targz: disable
-    targz: enable
 
 build:qemu-arm-test:
   extends:
@@ -229,8 +211,6 @@  build:qemu-arm-test:
   variables:
     target:  qemu-arm
     extension: test
-    wic_targz: disable
-    targz: enable
 
 # secure boot images
 build:qemu-amd64-secure-boot:
@@ -240,7 +220,7 @@  build:qemu-amd64-secure-boot:
     target: qemu-amd64
     extension: ebg-secure-boot-snakeoil
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
 
 build:qemu-amd64-secure-boot-encrypt:
@@ -250,7 +230,7 @@  build:qemu-amd64-secure-boot-encrypt:
     target: qemu-amd64
     extension: ebg-secure-boot-snakeoil
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
     encrypt: enable
 
@@ -261,7 +241,7 @@  build:qemu-amd64-swupdate:
     target: qemu-amd64
     extension: ebg-swu
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
 
 # secure boot images arm64
@@ -272,7 +252,7 @@  build:qemu-arm64-secure-boot:
     target: qemu-arm64
     extension: ebg-secure-boot-snakeoil
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
 
 # secure boot images arm
@@ -283,7 +263,7 @@  build:qemu-arm-secure-boot:
     target: qemu-arm
     extension: ebg-secure-boot-snakeoil
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
 
 # bullseye images
@@ -312,7 +292,7 @@  build:qemu-amd64-secure-boot-bullseye:
     target: qemu-amd64
     extension: ebg-secure-boot-snakeoil
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
     swupdate_version: "2022.12"
 
@@ -342,7 +322,7 @@  build:qemu-amd64-secure-boot-buster:
     target: qemu-amd64
     extension: ebg-secure-boot-snakeoil
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
     encrypt: enable
 
@@ -354,7 +334,7 @@  build:qemu-riscv64:
     target: qemu-riscv64
     release: sid
     use_rt: disable
-    wic_targz: disable
+    targz: disable
     deploy: disable
 
 cve-checks:
diff --git a/Kconfig b/Kconfig
index 600e568a..62be071f 100644
--- a/Kconfig
+++ b/Kconfig
@@ -151,23 +151,6 @@  config KAS_INCLUDE_DEBIAN
 
 comment "Image features"
 
-choice
-	prompt "Image formats"
-	default IMAGE_FLASH
-
-config IMAGE_FLASH
-	bool "Flashable image"
-
-config IMAGE_ARTIFACTS
-	bool "Separate artifacts for NFS boot"
-
-endchoice
-
-config KAS_INCLUDE_IMAGE_FORMAT
-	string
-	default "kas/opt/targz-img.yml" if IMAGE_ARTIFACTS && (TARGET_QEMU_AMD64 || TARGET_QEMU_ARM64 || TARGET_QEMU_ARM)
-	default "kas/opt/wic-targz-img.yml" if IMAGE_ARTIFACTS && !(TARGET_QEMU_AMD64 || TARGET_QEMU_ARM64 || TARGET_QEMU_ARM)
-
 config IMAGE_SECURITY
 	bool "Security extensions"
 	select IMAGE_DATA_ENCRYPTION
@@ -186,7 +169,7 @@  config KAS_INCLUDE_TESTING
 	string
 	default "kas/opt/test.yml" if IMAGE_TESTING
 
-if IMAGE_FLASH && !KERNEL_4_4 && !KERNEL_4_19
+if !KERNEL_4_4 && !KERNEL_4_19
 
 config IMAGE_SWUPDATE
 	bool "SWUpdate support for root partition"
@@ -242,3 +225,11 @@  config KAS_INCLUDE_FULL_ENCRYPTION
 	default "kas/opt/encrypt-all.yml" if IMAGE_FULL_ENCRYPTION
 
 endif
+
+config IMAGE_TAR_FORMAT
+	bool "Separate artifacts for NFS boot"
+	depends on !IMAGE_SWUPDATE
+
+config KAS_INCLUDE_TAR_FORMAT
+	string
+	default "kas/opt/targz.yml" if IMAGE_TAR_FORMAT
diff --git a/kas/opt/targz-img.yml b/kas/opt/targz.yml
similarity index 71%
rename from kas/opt/targz-img.yml
rename to kas/opt/targz.yml
index fd8303e4..5c0b87bf 100644
--- a/kas/opt/targz-img.yml
+++ b/kas/opt/targz.yml
@@ -1,7 +1,7 @@ 
 #
 # CIP Core, generic profile
 #
-# Copyright (c) Siemens AG, 2019
+# Copyright (c) Siemens AG, 2019-2024
 #
 # Authors:
 #  Quirin Gylstorff <quirin.gylstorff@siemens.com>
@@ -14,4 +14,4 @@  header:
 
 local_conf_header:
   image-type: |
-    IMAGE_FSTYPES = "tar.gz"
+    IMAGE_FSTYPES:append = " tar.gz"
diff --git a/kas/opt/wic-targz-img.yml b/kas/opt/wic-targz-img.yml
deleted file mode 100644
index 74053f52..00000000
--- a/kas/opt/wic-targz-img.yml
+++ /dev/null
@@ -1,20 +0,0 @@ 
-#
-# CIP Core, generic profile
-#
-# Copyright (c) Siemens AG, 2019
-#
-# Authors:
-#  Quirin Gylstorff <quirin.gylstorff@siemens.com>
-#
-# SPDX-License-Identifier: MIT
-#
-
-header:
-  version: 14
-
-# lava uses nfs to deploy the image. For this we need a tarball instead of
-# full image
-
-local_conf_header:
-  image-type: |
-    IMAGE_FSTYPES = "wic tar.gz"