[PATCH 0/2] Set reasonable defaults for WKS_FILE value

10 views
Skip to first unread message

Anton Mikanovich

unread,
Nov 14, 2024, 8:48:39 AM11/14/24
to isar-...@googlegroups.com, Anton Mikanovich
Current default for WKS_FILE supposed to be used on targets with EFI
support, so targets with architectures riscv64 and mipsel will fail on
using it. Set some other WKS_FILE defaults supported by that targets.

This change requires COREBASE variable set by meta layer (just like it
is implemented in OE). This variable specifies the parent directory of
meta layer and was used in bitbake and Isar code without being
initialized.

Anton Mikanovich (2):
meta: Add missing COREBASE variable
wic: Set default WKS_FILE for non efi targets

meta-isar/scripts/lib/wic/canned-wks/qemudefault.wks | 5 +++++
meta/classes/imagetypes_wic.bbclass | 3 +++
meta/conf/layer.conf | 3 +++
3 files changed, 11 insertions(+)
create mode 100644 meta-isar/scripts/lib/wic/canned-wks/qemudefault.wks

--
2.34.1

Anton Mikanovich

unread,
Nov 14, 2024, 8:48:40 AM11/14/24
to isar-...@googlegroups.com, Anton Mikanovich
This variable specifies the parent directory of meta layer and was used
in bitbake and Isar code without being initialized.
Setting this variable will fix the usage of WKS_FILES from default WIC.

Signed-off-by: Anton Mikanovich <ami...@ilbers.de>
---
meta/conf/layer.conf | 3 +++
1 file changed, 3 insertions(+)

diff --git a/meta/conf/layer.conf b/meta/conf/layer.conf
index b622ce69..15f01233 100644
--- a/meta/conf/layer.conf
+++ b/meta/conf/layer.conf
@@ -19,3 +19,6 @@ LAYERVERSION_core = "1"
LAYERSERIES_COMPAT_core = "v0.6"

LAYERDIR_core = "${LAYERDIR}"
+
+# Set a variable to get to the top of the metadata location
+COREBASE = '${@os.path.normpath("${LAYERDIR}/../")}'
--
2.34.1

Anton Mikanovich

unread,
Nov 14, 2024, 8:48:41 AM11/14/24
to isar-...@googlegroups.com, Anton Mikanovich
As riscv64 and mipsel are not supported by grub-efi set other default
WKS_FILE values for them.

Signed-off-by: Anton Mikanovich <ami...@ilbers.de>
---
meta-isar/scripts/lib/wic/canned-wks/qemudefault.wks | 5 +++++
meta/classes/imagetypes_wic.bbclass | 3 +++
2 files changed, 8 insertions(+)
create mode 100644 meta-isar/scripts/lib/wic/canned-wks/qemudefault.wks

diff --git a/meta-isar/scripts/lib/wic/canned-wks/qemudefault.wks b/meta-isar/scripts/lib/wic/canned-wks/qemudefault.wks
new file mode 100644
index 00000000..02a9fdf2
--- /dev/null
+++ b/meta-isar/scripts/lib/wic/canned-wks/qemudefault.wks
@@ -0,0 +1,5 @@
+# short-description: Create qcow2 image for QEMU machines
+
+part / --source rootfs --fstype=ext4 --label root --align 4096 --size 4G
+
+bootloader
diff --git a/meta/classes/imagetypes_wic.bbclass b/meta/classes/imagetypes_wic.bbclass
index 3b697cdd..0a8d4b4d 100644
--- a/meta/classes/imagetypes_wic.bbclass
+++ b/meta/classes/imagetypes_wic.bbclass
@@ -8,6 +8,9 @@ USING_WIC = "${@bb.utils.contains('IMAGE_BASETYPES', 'wic', '1', '0', d)}"
WKS_FILE_CHECKSUM = "${@'${WKS_FULL_PATH}:%s' % os.path.exists('${WKS_FULL_PATH}') if bb.utils.to_boolean(d.getVar('USING_WIC')) else ''}"

WKS_FILE ??= "sdimage-efi"
+# grub-efi is incompatible with targets riscv64 and mipsel
+WKS_FILE:riscv64 ??= "qemuriscv"
+WKS_FILE:mipsel ??= "qemudefault"

do_copy_wks_template[file-checksums] += "${WKS_FILE_CHECKSUM}"
do_copy_wks_template[vardepsexclude] += "WKS_TEMPLATE_PATH"
--
2.34.1

Uladzimir Bely

unread,
Nov 21, 2024, 1:49:08 AM11/21/24
to Anton Mikanovich, isar-...@googlegroups.com
Applied to next.

--
Best regards,
Uladzimir.

Jan Kiszka

unread,
Jan 17, 2025, 8:05:45 AM1/17/25
to Anton Mikanovich, isar-...@googlegroups.com
This part was wrong, breaking downstream layers: overrides win over
normal assignments. So,

WKS_FILE = "my-file"

will lose in the face of the above. Fixing...

Jan

--
Siemens AG, Foundational Technologies
Linux Expert Center

Anton Mikanovich

unread,
Jan 17, 2025, 8:45:35 AM1/17/25
to Jan Kiszka, isar-...@googlegroups.com
Hello Jan,

Thanks for checking. This change was introduced as a hotfix for the
installer
image creation of riscv64 and mipsel targets with no WKS_FILE provided in
machine config (to make it works just like any other arch). As this
syntax is
wrong we need to find some other style for the fix.

Reply all
Reply to author
Forward
0 new messages