Revert "kernel.bbclass: make dependency on lzop-native conditional"

Submitted by Marco Felsch on Oct. 5, 2020, 2:18 p.m. | Patch ID: 176982

Details

Message ID 20201005141838.8559-1-m.felsch@pengutronix.de
State New
Headers show

Commit Message

Marco Felsch Oct. 5, 2020, 2:18 p.m.
This reverts commit 1217ddf070261c5fe523729b2a833bd38f1e4ccd.

This commit breaks compiling if no initramfs is used because the kernel
image can be compressed too using lzo.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
 meta/classes/kernel.bbclass | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 78def5bbc1..06150e8072 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -4,8 +4,7 @@  KERNEL_PACKAGE_NAME ??= "kernel"
 KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
 
 PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }"
-DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native bison-native"
-DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", "lzop-native", "", d)}"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native bison-native"
 DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", "lz4-native", "", d)}"
 PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
 

Comments

Richard Purdie Oct. 6, 2020, 1:27 p.m.
On Mon, 2020-10-05 at 16:18 +0200, Marco Felsch wrote:
> This reverts commit 1217ddf070261c5fe523729b2a833bd38f1e4ccd.
> 
> This commit breaks compiling if no initramfs is used because the
> kernel image can be compressed too using lzo.

Can we detect if the kernel is due to be compressed with lzo through
any of our configuration variables?

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#143039): https://lists.openembedded.org/g/openembedded-core/message/143039
Mute This Topic: https://lists.openembedded.org/mt/77319574/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Marco Felsch Oct. 6, 2020, 2:26 p.m.
On 20-10-06 14:27, Richard Purdie wrote:
> On Mon, 2020-10-05 at 16:18 +0200, Marco Felsch wrote:
> > This reverts commit 1217ddf070261c5fe523729b2a833bd38f1e4ccd.
> > 
> > This commit breaks compiling if no initramfs is used because the
> > kernel image can be compressed too using lzo.
> 
> Can we detect if the kernel is due to be compressed with lzo through
> any of our configuration variables?

I thought about it too.. We need to grep the .config and check if the
Kconfig was set either by the defconfig we are providing or by some
inheritance.

Regards,
  Marco

> 
> Cheers,
> 
> Richard
> 
>
Richard Purdie Oct. 6, 2020, 2:27 p.m.
On Tue, 2020-10-06 at 16:26 +0200, Marco Felsch wrote:
> On 20-10-06 14:27, Richard Purdie wrote:
> > On Mon, 2020-10-05 at 16:18 +0200, Marco Felsch wrote:
> > > This reverts commit 1217ddf070261c5fe523729b2a833bd38f1e4ccd.
> > > 
> > > This commit breaks compiling if no initramfs is used because the
> > > kernel image can be compressed too using lzo.
> > 
> > Can we detect if the kernel is due to be compressed with lzo
> > through
> > any of our configuration variables?
> 
> I thought about it too.. We need to grep the .config and check if the
> Kconfig was set either by the defconfig we are providing or by some
> inheritance.

Grepping the .config isn't an option as we need to determine this at
parse time. I did wondering the kernel type/output name style variables
would tell us but it sounds like that isn't the case :(

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#143041): https://lists.openembedded.org/g/openembedded-core/message/143041
Mute This Topic: https://lists.openembedded.org/mt/77319574/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Marco Felsch Oct. 6, 2020, 3:57 p.m.
On 20-10-06 15:27, Richard Purdie wrote:
> On Tue, 2020-10-06 at 16:26 +0200, Marco Felsch wrote:
> > On 20-10-06 14:27, Richard Purdie wrote:
> > > On Mon, 2020-10-05 at 16:18 +0200, Marco Felsch wrote:
> > > > This reverts commit 1217ddf070261c5fe523729b2a833bd38f1e4ccd.
> > > > 
> > > > This commit breaks compiling if no initramfs is used because the
> > > > kernel image can be compressed too using lzo.
> > > 
> > > Can we detect if the kernel is due to be compressed with lzo
> > > through
> > > any of our configuration variables?
> > 
> > I thought about it too.. We need to grep the .config and check if the
> > Kconfig was set either by the defconfig we are providing or by some
> > inheritance.
> 
> Grepping the .config isn't an option as we need to determine this at
> parse time.

That was my conclusion too.

> I did wondering the kernel type/output name style variables
> would tell us but it sounds like that isn't the case :(

Nope you can't, e.g. arm compressed images are always named
zImage.

Regards,
  Marco
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#143043): https://lists.openembedded.org/g/openembedded-core/message/143043
Mute This Topic: https://lists.openembedded.org/mt/77319574/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Richard Purdie Oct. 7, 2020, 11:28 a.m.
On Mon, 2020-10-05 at 16:18 +0200, Marco Felsch wrote:
> This reverts commit 1217ddf070261c5fe523729b2a833bd38f1e4ccd.
> 
> This commit breaks compiling if no initramfs is used because the kernel
> image can be compressed too using lzo.
> 
> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> ---
>  meta/classes/kernel.bbclass | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 78def5bbc1..06150e8072 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -4,8 +4,7 @@ KERNEL_PACKAGE_NAME ??= "kernel"
>  KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
>  
>  PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }"
> -DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native bison-native"
> -DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", "lzop-native", "", d)}"
> +DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native bison-native"
>  DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", "lz4-native", "", d)}"
>  PACKAGE_WRITE_DEPS += "depmodwrapper-cross"

I've been giving this more thought, we can't simply add every possible
DEPENDS in kernel.bbclass.

In this case if a recipe is enabling lzo compression on the kernel,
perhaps it should just add DEPENDS += "lzop-native" itself?

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#143081): https://lists.openembedded.org/g/openembedded-core/message/143081
Mute This Topic: https://lists.openembedded.org/mt/77319574/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-
Marco Felsch Oct. 7, 2020, 3:59 p.m.
On 20-10-07 12:28, Richard Purdie wrote:
> On Mon, 2020-10-05 at 16:18 +0200, Marco Felsch wrote:
> > This reverts commit 1217ddf070261c5fe523729b2a833bd38f1e4ccd.
> > 
> > This commit breaks compiling if no initramfs is used because the kernel
> > image can be compressed too using lzo.
> > 
> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
> > ---
> >  meta/classes/kernel.bbclass | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> > index 78def5bbc1..06150e8072 100644
> > --- a/meta/classes/kernel.bbclass
> > +++ b/meta/classes/kernel.bbclass
> > @@ -4,8 +4,7 @@ KERNEL_PACKAGE_NAME ??= "kernel"
> >  KERNEL_DEPLOYSUBDIR ??= "${@ "" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else d.getVar("KERNEL_PACKAGE_NAME") }"
> >  
> >  PROVIDES += "${@ "virtual/kernel" if (d.getVar("KERNEL_PACKAGE_NAME") == "kernel") else "" }"
> > -DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native bison-native"
> > -DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lzo", "lzop-native", "", d)}"
> > +DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native bc-native lzop-native bison-native"
> >  DEPENDS += "${@bb.utils.contains("INITRAMFS_FSTYPES", "cpio.lz4", "lz4-native", "", d)}"
> >  PACKAGE_WRITE_DEPS += "depmodwrapper-cross"
> 
> I've been giving this more thought, we can't simply add every possible
> DEPENDS in kernel.bbclass.
> 
> In this case if a recipe is enabling lzo compression on the kernel,
> perhaps it should just add DEPENDS += "lzop-native" itself?

You're absolutely right and I would have no doubts going this way if we
won't have this dependency since 2016. I think this will break a lot of
builds. We can go this if that doesn't matter, but I would drop the
dynamically added DEPENDS which would be added in case of
INITRAMFS_FSTYPES. So the BSP needs to specify the correct DEPS all the
time.

Regards,
  Marco
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#143086): https://lists.openembedded.org/g/openembedded-core/message/143086
Mute This Topic: https://lists.openembedded.org/mt/77319574/3617530
Group Owner: openembedded-core+owner@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [oe-patchwork@oe-patch.openembedded.org]
-=-=-=-=-=-=-=-=-=-=-=-