diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-31 13:27:50 +0000 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-01-18 10:15:58 +0000 |
| commit | c917323a39da6fc3e8d92b2fe907d0357149c9bb (patch) | |
| tree | 254fd4963f6a7c0f65f5cc9aa1834158fc94b457 /meta/classes-recipe | |
| parent | bc883e49912b8d0cdc9ea403e85f2cb3198b48ff (diff) | |
| download | poky-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.bbclass | 2 | ||||
| -rw-r--r-- | meta/classes-recipe/gnomebase.bbclass | 3 | ||||
| -rw-r--r-- | meta/classes-recipe/image.bbclass | 5 | ||||
| -rw-r--r-- | meta/classes-recipe/image_types_wic.bbclass | 2 | ||||
| -rw-r--r-- | meta/classes-recipe/kernel.bbclass | 2 | ||||
| -rw-r--r-- | meta/classes-recipe/live-vm-common.bbclass | 4 | ||||
| -rw-r--r-- | meta/classes-recipe/packagegroup.bbclass | 2 | ||||
| -rw-r--r-- | meta/classes-recipe/populate_sdk_base.bbclass | 2 |
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 |
| 111 | IMAGE_CLASSES ??= "" | 111 | IMAGE_CLASSES ??= "" |
| 112 | IMGCLASSES = " ${IMAGE_CLASSES}" | 112 | IMGCLASSES = " ${IMAGE_CLASSES}" |
| 113 | inherit ${IMGCLASSES} | 113 | inherit_defer ${IMGCLASSES} |
| 114 | # Set defaults to satisfy IMAGE_FEATURES check | 114 | # Set defaults to satisfy IMAGE_FEATURES check |
| 115 | IMAGE_FEATURES ?= "" | 115 | IMAGE_FEATURES ?= "" |
| 116 | IMAGE_FEATURES[type] = "list" | 116 | IMAGE_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 \ | |||
| 28 | FILES:${PN}-doc += "${datadir}/devhelp" | 28 | FILES:${PN}-doc += "${datadir}/devhelp" |
| 29 | 29 | ||
| 30 | GNOMEBASEBUILDCLASS ??= "meson" | 30 | GNOMEBASEBUILDCLASS ??= "meson" |
| 31 | inherit ${GNOMEBASEBUILDCLASS} pkgconfig | 31 | inherit pkgconfig |
| 32 | inherit_defer ${GNOMEBASEBUILDCLASS} | ||
| 32 | 33 | ||
| 33 | do_install:append() { | 34 | do_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" | |||
| 14 | IMGCLASSES = "rootfs_${IMAGE_PKGTYPE} image_types ${IMAGE_CLASSES}" | 14 | IMGCLASSES = "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 |
| 17 | IMGCLASSES += "${@['populate_sdk_base', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" | 17 | inherit populate_sdk_base |
| 18 | IMGCLASSES += "${@['', 'populate_sdk_ext']['linux' in d.getVar("SDK_OS")]}" | ||
| 18 | IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" | 19 | IMGCLASSES += "${@bb.utils.contains_any('IMAGE_FSTYPES', 'live iso hddimg', 'image-live', '', d)}" |
| 19 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" | 20 | IMGCLASSES += "${@bb.utils.contains('IMAGE_FSTYPES', 'container', 'image-container', '', d)}" |
| 20 | IMGCLASSES += "image_types_wic" | 21 | IMGCLASSES += "image_types_wic" |
| 21 | IMGCLASSES += "rootfs-postcommands" | 22 | IMGCLASSES += "rootfs-postcommands" |
| 22 | IMGCLASSES += "image-postinst-intercepts" | 23 | IMGCLASSES += "image-postinst-intercepts" |
| 23 | IMGCLASSES += "overlayfs-etc" | 24 | IMGCLASSES += "overlayfs-etc" |
| 24 | inherit ${IMGCLASSES} | 25 | inherit_defer ${IMGCLASSES} |
| 25 | 26 | ||
| 26 | TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" | 27 | TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}" |
| 27 | TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}" | 28 | TOOLCHAIN_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 | ||
| 41 | inherit ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)} | 41 | inherit_defer ${@bb.utils.contains('INITRAMFS_IMAGE_BUNDLE', '1', 'kernel-artifact-names', '', d)} |
| 42 | 42 | ||
| 43 | WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks" | 43 | WKS_FILE ??= "${IMAGE_BASENAME}.${MACHINE}.wks" |
| 44 | WKS_FILES ?= "${WKS_FILE} ${IMAGE_BASENAME}.wks" | 44 | WKS_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 | ||
| 173 | KERNEL_CLASSES ?= " kernel-uimage " | 173 | KERNEL_CLASSES ?= " kernel-uimage " |
| 174 | inherit ${KERNEL_CLASSES} | 174 | inherit_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 | ||
| 71 | inherit ${EFI_CLASS} | 71 | inherit_defer ${EFI_CLASS} |
| 72 | inherit ${PCBIOS_CLASS} | 72 | inherit_defer ${PCBIOS_CLASS} |
| 73 | 73 | ||
| 74 | populate_kernel() { | 74 | populate_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 | ||
| 23 | LICENSE ?= "MIT" | 23 | LICENSE ?= "MIT" |
| 24 | 24 | ||
| 25 | inherit ${@oe.utils.ifelse(d.getVar('PACKAGE_ARCH_EXPANDED') == 'all', 'allarch', '')} | 25 | inherit_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. |
| 38 | SDKIMAGE_LINGUAS ?= "all" | 38 | SDKIMAGE_LINGUAS ?= "all" |
| 39 | 39 | ||
| 40 | inherit rootfs_${IMAGE_PKGTYPE} | 40 | inherit_defer rootfs_${IMAGE_PKGTYPE} |
| 41 | 41 | ||
| 42 | SDK_DIR = "${WORKDIR}/sdk" | 42 | SDK_DIR = "${WORKDIR}/sdk" |
| 43 | SDK_OUTPUT = "${SDK_DIR}/image" | 43 | SDK_OUTPUT = "${SDK_DIR}/image" |
