image.bbclass: allow overriding dependency on virtual/kernel:do_deploy

Message ID 20220427073739.4015660-1-dmitry.baryshkov@linaro.org
State Accepted, archived
Commit dcf9dfa4e6305786cd713aa28deda94a50bd6635
Headers show
Series image.bbclass: allow overriding dependency on virtual/kernel:do_deploy | expand

Commit Message

Dmitry Baryshkov April 27, 2022, 7:37 a.m. UTC
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>
---
 meta/classes/image.bbclass | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Jacob Kroon April 29, 2022, 8:53 p.m. UTC | #1
On 4/27/22 09:37, Dmitry Baryshkov wrote:
> 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>
> ---
>  meta/classes/image.bbclass | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 7f1f6f80a464..47776db2b0e6 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 follow 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.
> +KERNELDEPLOYDEPEND ?= "virtual/kernel:do_deploy"
> +do_build[depends] += "${KERNELDEPMODDEPEND}"
>  

I saw this got merged to master.

The patch doesn't make sense.

It sets

KERNELDEPLOYDEPEND

then uses

KERNELDEPMODDEPEND

?

And please make it readable by adding some underscores, like

KERNEL_DEPLOY_DEPEND

Jacob
Jacob Kroon May 4, 2022, 8:50 a.m. UTC | #2
Hi Dmitry,

Do you want to send a patch for fixing this ? Otherwise I'll send a
patch reverting the changes.

Jacob

On 4/29/22 22:53, Jacob Kroon wrote:
> On 4/27/22 09:37, Dmitry Baryshkov wrote:
>> 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>
>> ---
>>  meta/classes/image.bbclass | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index 7f1f6f80a464..47776db2b0e6 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 follow 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.
>> +KERNELDEPLOYDEPEND ?= "virtual/kernel:do_deploy"
>> +do_build[depends] += "${KERNELDEPMODDEPEND}"
>>  
> 
> I saw this got merged to master.
> 
> The patch doesn't make sense.
> 
> It sets
> 
> KERNELDEPLOYDEPEND
> 
> then uses
> 
> KERNELDEPMODDEPEND
> 
> ?
> 
> And please make it readable by adding some underscores, like
> 
> KERNEL_DEPLOY_DEPEND
> 
> Jacob

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 7f1f6f80a464..47776db2b0e6 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 follow 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.
+KERNELDEPLOYDEPEND ?= "virtual/kernel:do_deploy"
+do_build[depends] += "${KERNELDEPMODDEPEND}"
 
 
 python () {