[kirkstone,27/31] image.bbclass: allow overriding dependency on virtual/kernel:do_deploy

Message ID 4caf244256e150fea19cd4f2ca04c13d95d49fee.1652811454.git.steve@sakoman.com
State Accepted, archived
Commit 4caf244256e150fea19cd4f2ca04c13d95d49fee
Headers show
Series [kirkstone,01/31] freetype: backport patch for CVE-2022-27404 | expand

Commit Message

Steve Sakoman May 17, 2022, 6:24 p.m. UTC
From: Dmitry Baryshkov <dbaryshkov@gmail.com>

Since the commit fe26b2379ecd ("image.bbclass: Depend on
virtual/kernel:do_deploy"), the image.bbclass made building images
depend on virtual/kernel. For some images, including small initramfs,
this is not the case. Allow overriding this dependency in case
developers knows what they are doing.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 55875f68212657167ac6dc26f5fd93eac24b098e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/classes/image.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 7f1f6f80a4..2139a7e576 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -132,7 +132,12 @@  def rootfs_variables(d):
 
 do_rootfs[vardeps] += "${@rootfs_variables(d)}"
 
-do_build[depends] += "virtual/kernel:do_deploy"
+# This is needed to have kernel image in DEPLOY_DIR.
+# This follows many common usecases and user expectations.
+# But if you are building an image which doesn't need the kernel image at all,
+# you can unset this variable manually.
+KERNEL_DEPLOY_DEPEND ?= "virtual/kernel:do_deploy"
+do_build[depends] += "${KERNEL_DEPLOY_DEPEND}"
 
 
 python () {