All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-virtualization][PATCH] classes/image-oci: Map x86_64 -> amd64
@ 2023-10-16 21:26 Joshua Watt
  2023-10-17  1:35 ` Bruce Ashfield
  2023-10-30 19:08 ` [meta-virtualization][PATCH v2] classes/image-oci: Map image architecture correctly Joshua Watt
  0 siblings, 2 replies; 11+ messages in thread
From: Joshua Watt @ 2023-10-16 21:26 UTC (permalink / raw)
  To: meta-virtualization; +Cc: Joshua Watt

OCI requires that the architecture [1] be a valid GOARCH [2]. "x86_64"
is not a valid GOARCH so map it to the correct "amd64" value.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>

[1]: https://github.com/opencontainers/image-spec/blob/main/config.md#properties
[2]: https://go.dev/doc/install/source#environment

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 classes/image-oci.bbclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/classes/image-oci.bbclass b/classes/image-oci.bbclass
index 9ddb88b..3370f86 100644
--- a/classes/image-oci.bbclass
+++ b/classes/image-oci.bbclass
@@ -52,7 +52,7 @@ OCI_IMAGE_AUTHOR_EMAIL ?= "${PATCH_GIT_USER_EMAIL}"
 OCI_IMAGE_TAG ?= "latest"
 OCI_IMAGE_RUNTIME_UID ?= ""
 
-OCI_IMAGE_ARCH ?= "${TARGET_ARCH}"
+OCI_IMAGE_ARCH ?= "${@oci_map_arch(d.getVar('TARGET_ARCH'))}"
 OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
 
 OCI_IMAGE_ENTRYPOINT ?= "sh"
@@ -74,6 +74,13 @@ OCI_IMAGE_ENV_VARS ?= ""
 # bundled into a tarball.
 OCI_IMAGE_TAR_OUTPUT ?= "true"
 
+# Map architectures to a valid container arch. Note that the container archs
+# should be a valid GOARCH
+def oci_map_arch(a):
+    if a == "x86_64":
+        return "amd64"
+    return a
+
 # Generate a subarch that is appropriate to OCI image
 # types. This is typically only ARM architectures at the
 # moment.
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread
* Re: [meta-virtualization][PATCH v2] classes/image-oci: Map image architecture correctly
@ 2023-11-07 10:37 Ross Burton
  2023-11-07 13:00 ` Bruce Ashfield
  0 siblings, 1 reply; 11+ messages in thread
From: Ross Burton @ 2023-11-07 10:37 UTC (permalink / raw)
  To: Bruce Ashfield; +Cc: Joshua Watt, meta-virtualization@lists.yoctoproject.org

This patch depends on changes in oe-core master, but as there is no nanbield branch of meta-virtualisation at present it’s not possible to use meta-virt with nanbield anymore.

Can this either be reverted, or a branch created?

Ross

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

end of thread, other threads:[~2023-11-07 15:34 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-16 21:26 [meta-virtualization][PATCH] classes/image-oci: Map x86_64 -> amd64 Joshua Watt
2023-10-17  1:35 ` Bruce Ashfield
2023-10-17 13:46   ` Joshua Watt
2023-10-17 14:01     ` Bruce Ashfield
2023-10-30 19:08 ` [meta-virtualization][PATCH v2] classes/image-oci: Map image architecture correctly Joshua Watt
2023-11-03  3:25   ` Bruce Ashfield
  -- strict thread matches above, loose matches on Subject: below --
2023-11-07 10:37 Ross Burton
2023-11-07 13:00 ` Bruce Ashfield
2023-11-07 14:51   ` Ross Burton
2023-11-07 15:31     ` Bruce Ashfield
2023-11-07 15:33       ` Joshua Watt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.