summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/image-oci.bbclass35
1 files changed, 34 insertions, 1 deletions
diff --git a/classes/image-oci.bbclass b/classes/image-oci.bbclass
index 0ec5c487..4453b709 100644
--- a/classes/image-oci.bbclass
+++ b/classes/image-oci.bbclass
@@ -52,7 +52,7 @@ OCI_IMAGE_AUTHOR_EMAIL ?= "${PATCH_GIT_USER_EMAIL}"
52OCI_IMAGE_TAG ?= "latest" 52OCI_IMAGE_TAG ?= "latest"
53OCI_IMAGE_RUNTIME_UID ?= "" 53OCI_IMAGE_RUNTIME_UID ?= ""
54 54
55OCI_IMAGE_ARCH ?= "${@oe.go.map_arch(d.getVar('TARGET_ARCH'))}" 55OCI_IMAGE_ARCH ?= "${@oci_map_arch(d.getVar('TARGET_ARCH'), d)}"
56OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}" 56OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"
57 57
58OCI_IMAGE_ENTRYPOINT ?= "sh" 58OCI_IMAGE_ENTRYPOINT ?= "sh"
@@ -74,6 +74,39 @@ OCI_IMAGE_ENV_VARS ?= ""
74# bundled into a tarball. 74# bundled into a tarball.
75OCI_IMAGE_TAR_OUTPUT ?= "true" 75OCI_IMAGE_TAR_OUTPUT ?= "true"
76 76
77# this is from goarch.bbclass. We currently can't inherit
78# the entire goarch bbclass, so we duplicate the function
79# here. This moves to a library function in newer releases
80# so we no longer need this.
81def oci_map_arch(a, d):
82 import re
83 if re.match('i.86', a):
84 return '386'
85 elif a == 'x86_64':
86 return 'amd64'
87 elif re.match('arm.*', a):
88 return 'arm'
89 elif re.match('aarch64.*', a):
90 return 'arm64'
91 elif re.match('mips64el.*', a):
92 return 'mips64le'
93 elif re.match('mips64.*', a):
94 return 'mips64'
95 elif a == 'mips':
96 return 'mips'
97 elif a == 'mipsel':
98 return 'mipsle'
99 elif re.match('p(pc|owerpc)(64le)', a):
100 return 'ppc64le'
101 elif re.match('p(pc|owerpc)(64)', a):
102 return 'ppc64'
103 elif a == 'riscv64':
104 return 'riscv64'
105 elif a == 'loongarch64':
106 return 'loong64'
107 else:
108 raise bb.parse.SkipRecipe("Unsupported CPU architecture: %s" % a)
109
77# Generate a subarch that is appropriate to OCI image 110# Generate a subarch that is appropriate to OCI image
78# types. This is typically only ARM architectures at the 111# types. This is typically only ARM architectures at the
79# moment. 112# moment.