summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-31 13:27:50 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-01-18 10:15:58 +0000
commitc917323a39da6fc3e8d92b2fe907d0357149c9bb (patch)
tree254fd4963f6a7c0f65f5cc9aa1834158fc94b457 /meta/classes-recipe
parentbc883e49912b8d0cdc9ea403e85f2cb3198b48ff (diff)
downloadpoky-c917323a39da6fc3e8d92b2fe907d0357149c9bb.tar.gz
classes/recipes: Switch to use inherit_defer
Now that bitbake supports the use of inherit_defer, switch all conditional (variable based) inherits to use this instead. This leads to more a more deterministic user experience since there is no longer an immediate expansion and later changes to the variables in question (e.g. a bbappend) are accounted for. This patch tries to ensure the behaviour before/after remains as unchanged as it reasonably can, e.g. by always inherting populate_sdk_base. native and nativesdk continue to need to be inherited last, hence being used with inherit_defer in a handful of very specific cases. (From OE-Core rev: 451363438d38bd4552d5bcec4a92332f5819a5d4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r--meta/classes-recipe/baremetal-image.bbclass2
-rw-r--r--meta/classes-recipe/gnomebase.bbclass3
-rw-r--r--meta/classes-recipe/image.bbclass5
-rw-r--r--meta/classes-recipe/image_types_wic.bbclass2
-rw-r--r--meta/classes-recipe/kernel.bbclass2
-rw-r--r--meta/classes-recipe/live-vm-common.bbclass4
-rw-r--r--meta/classes-recipe/packagegroup.bbclass2
-rw-r--r--meta/classes-recipe/populate_sdk_base.bbclass2
8 files changed, 12 insertions, 10 deletions
diff --git a/meta/classes-recipe/baremetal-image.bbclass b/meta/classes-recipe/baremetal-image.bbclass
index 70791f999a..b9a584351a 100644
--- a/meta/classes-recipe/baremetal-image.bbclass
+++ b/meta/classes-recipe/baremetal-image.bbclass
@@ -110,7 +110,7 @@ CFLAGS:append:qemuriscv64 = " -mcmodel=medany"
110# Handle inherits of any of the image classes we need 110# Handle inherits of any of the image classes we need
111IMAGE_CLASSES ??= "" 111IMAGE_CLASSES ??= ""
112IMGCLASSES = " ${IMAGE_CLASSES}" 112IMGCLASSES = " ${IMAGE_CLASSES}"
113inherit ${IMGCLASSES} 113inherit_defer ${IMGCLASSES}
114# Set defaults to satisfy IMAGE_FEATURES check 114# Set defaults to satisfy IMAGE_FEATURES check
115IMAGE_FEATURES ?= "" 115IMAGE_FEATURES ?= ""
116IMAGE_FEATURES[type] = "list" 116IMAGE_FEATURES[type] = "list"
diff --git a/meta/classes-recipe/gnomebase.bbclass b/meta/classes-recipe/gnomebase.bbclass
index a12e9f31a9..74073321b8 100644
--- a/meta/classes-recipe/gnomebase.bbclass
+++ b/meta/classes-recipe/gnomebase.bbclass
@@ -28,7 +28,8 @@ FILES:${PN} += "${datadir}/application-registry \
28FILES:${PN}-doc += "${datadir}/devhelp" 28FILES:${PN}-doc += "${datadir}/devhelp"
29 29
30GNOMEBASEBUILDCLASS ??= "meson" 30GNOMEBASEBUILDCLASS ??= "meson"
31inherit ${GNOMEBASEBUILDCLASS} pkgconfig 31inherit pkgconfig
32inherit_defer ${GNOMEBASEBUILDCLASS}
32 33
33do_install:append() { 34do_install:append() {
34 rm -rf ${D}${localstatedir}/lib/scrollkeeper/* 35 rm -rf ${D}${localstatedir}/lib/scrollkeeper/*
diff --git a/meta/classes-recipe/image.bbclass b/meta/classes-recipe/image.bbclass
index 6bdddc0134..28be6c6362 100644
--- a/meta/classes-recipe/image.bbclass
+++ b/meta/classes-recipe/image.bbclass
@@ -14,14 +14,15 @@ ROOTFS_BOOTSTRAP_INSTALL = "run-postinsts"
14IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" 14IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}"
15# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base 15# Only Linux SDKs support populate_sdk_ext, fall back to populate_sdk_base
16# in the non-Linux SDK_OS case, such as mingw32 16# in the non-Linux SDK_OS case, such as mingw32
17IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" 17inherit populate_sdk_base
18IMGCLASSES += "${@['', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}"
18IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" 19IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}"
19IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" 20IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}"
20IMGCLASSES += "image_types_wic" 21IMGCLASSES += "image_types_wic"
21IMGCLASSES += "rootfs-postcommands" 22IMGCLASSES += "rootfs-postcommands"
22IMGCLASSES += "image-postinst-intercepts" 23IMGCLASSES += "image-postinst-intercepts"
23IMGCLASSES += "overlayfs-etc" 24IMGCLASSES += "overlayfs-etc"
24inherit ${IMGCLASSES} 25inherit_defer ${IMGCLASSES}
25 26
26TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" 27TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
27TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" 28TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}"
diff --git a/meta/classes-recipe/image_types_wic.bbclass b/meta/classes-recipe/image_types_wic.bbclass
index 669606da75..00620fdc9d 100644
--- a/meta/classes-recipe/image_types_wic.bbclass
+++ b/meta/classes-recipe/image_types_wic.bbclass
@@ -38,7 +38,7 @@ WICVARS ?= "\
38 TARGET_SYS \ 38 TARGET_SYS \
39" 39"
40 40
41inherit ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)} 41inherit_defer ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)}
42 42
43WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks" 43WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks"
44WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks" 44WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks"
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass
index 9ff37f5c38..a76aaee5ba 100644
--- a/meta/classes-recipe/kernel.bbclass
+++ b/meta/classes-recipe/kernel.bbclass
@@ -171,7 +171,7 @@ set -e
171# image types. 171# image types.
172 172
173KERNEL_CLASSES ?= " kernel-uimage " 173KERNEL_CLASSES ?= " kernel-uimage "
174inherit ${KERNEL_CLASSES} 174inherit_defer ${KERNEL_CLASSES}
175 175
176# Old style kernels may set ${S} = ${WORKDIR}/git for example 176# Old style kernels may set ${S} = ${WORKDIR}/git for example
177# We need to move these over to STAGING_KERNEL_DIR. We can't just 177# We need to move these over to STAGING_KERNEL_DIR. We can't just
diff --git a/meta/classes-recipe/live-vm-common.bbclass b/meta/classes-recipe/live-vm-common.bbclass
index b619f3a4be..d90cc67ebc 100644
--- a/meta/classes-recipe/live-vm-common.bbclass
+++ b/meta/classes-recipe/live-vm-common.bbclass
@@ -68,8 +68,8 @@ efi_hddimg_populate() {
68 efi_populate $1 68 efi_populate $1
69} 69}
70 70
71inherit ${EFI_CLASS} 71inherit_defer ${EFI_CLASS}
72inherit ${PCBIOS_CLASS} 72inherit_defer ${PCBIOS_CLASS}
73 73
74populate_kernel() { 74populate_kernel() {
75 dest=$1 75 dest=$1
diff --git a/meta/classes-recipe/packagegroup.bbclass b/meta/classes-recipe/packagegroup.bbclass
index c2db664904..cf6fc354a8 100644
--- a/meta/classes-recipe/packagegroup.bbclass
+++ b/meta/classes-recipe/packagegroup.bbclass
@@ -22,7 +22,7 @@ PACKAGE_ARCH_EXPANDED := "${PACKAGE_ARCH}"
22 22
23LICENSE ?= "MIT" 23LICENSE ?= "MIT"
24 24
25inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')} 25inherit_defer ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')}
26 26
27# This automatically adds -dbg and -dev flavours of all PACKAGES 27# This automatically adds -dbg and -dev flavours of all PACKAGES
28# to the list. Their dependencies (RRECOMMENDS) are handled as usual 28# to the list. Their dependencies (RRECOMMENDS) are handled as usual
diff --git a/meta/classes-recipe/populate_sdk_base.bbclass b/meta/classes-recipe/populate_sdk_base.bbclass
index 8fadfef942..81896d808f 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -37,7 +37,7 @@ SDK_PACKAGE_ARCHS += "sdk-provides-dummy-${SDKPKGSUFFIX}"
37# List of locales to install, or "all" for all of them, or unset for none. 37# List of locales to install, or "all" for all of them, or unset for none.
38SDKIMAGE_LINGUAS ?= "all" 38SDKIMAGE_LINGUAS ?= "all"
39 39
40inherit rootfs_${IMAGE_PKGTYPE} 40inherit_defer rootfs_${IMAGE_PKGTYPE}
41 41
42SDK_DIR = "${WORKDIR}/sdk" 42SDK_DIR = "${WORKDIR}/sdk"
43SDK_OUTPUT = "${SDK_DIR}/image" 43SDK_OUTPUT = "${SDK_DIR}/image"