Skip to contentSkip to conversation

kernel.bbclass: add lzop dependency

PATCH In review Trevor Woerner 6 participants 12 messages Aug 1, 2016 – Aug 10, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel.bbclass: add lzop dependency

If the initramfs image is type lzo, then a native lzop is needed.

---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -1
index fa76a14..db42744 100644
@@ -1,7 +1,7 @@
 inherit linux-kernel-base kernel-module-split
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native lzop-native"
 
 S = "${STAGING_KERNEL_DIR}"
 B = "${WORKDIR}/build"
Signature · 1 line
2.9.2
#1 lore raw
Quoted 2 lines · Trevor Woerner

If the initramfs image is type lzo, then a native lzop is needed.

Not a large dependency, but it does bring to mind the question if this could be conditional on the type of image being built ? via distro feature, some other mechanism ?

Bruce

Quoted 30 lines
---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel.bbclass +0 -1
index fa76a14..db42744 100644
@@ -1,7 +1,7 @@
 inherit linux-kernel-base kernel-module-split
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc

kmod-native depmodwrapper-cross bc-native"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native lzop-native"

S = "${STAGING_KERNEL_DIR}"
B = "${WORKDIR}/build"
--
2.9.2

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#2 lore raw
Quoted 4 lines · Bruce Ashfield

Not a large dependency, but it does bring to mind the question if this could be conditional on the type of image being built ? via distro feature, some other mechanism ?

Exactly this: image building adds dependencies automatically based on what is actually being used, so can the kernel do this too?

Ross

#3 lore raw
Quoted 9 lines · Ross
Quoted 4 lines · Bruce Ashfield

Not a large dependency, but it does bring to mind the question if this could be conditional on the type of image being built ? via distro feature, some other mechanism ?

Exactly this: image building adds dependencies automatically based on what is actually being used, so can the kernel do this too?

I'm uncertain regarding the status of this patch:

1) will it be applied? (doesn't sound like it)

2) do you want me to work on it some more? (i'll look for other examples of conditional DEPENDS, i'm not aware of any off the top of my head)

3) should i be looking to push this into a BSP layer? (since BSPs usually choose their kernel)

#4 lore raw
In reply to Burton, Ross
Quoted 9 lines · Ross
Quoted 4 lines · Bruce Ashfield

Not a large dependency, but it does bring to mind the question if this could be conditional on the type of image being built ? via distro feature, some other mechanism ?

Exactly this: image building adds dependencies automatically based on what is actually being used, so can the kernel do this too?

The way the build knows which image was built is to build the kernel then look in the output directory to see what extension was given to the artifact. iow, it only discovers the dependency partway through the build; it doesn't know the dependency when the build starts.

Either bitbake will have to put together the kernel's config at the start of the build, then parse through it to try to determine which kernel will be built, or we need some sort of mechanism that allows us to add dependencies partway through a build, or we can add (yet another) build variable and hope people are able to keep it in sync.

...or we could just add lzop-native as a static dependency in the off-chance that it's needed.

#5 lore raw
Quoted 20 lines · Trevor Woerner
Quoted 1 line · Ross

On 1 August 2016 at 15:07, Bruce Ashfield <[email protected]>

Quoted 7 lines · wrote:
Quoted 5 lines

Not a large dependency, but it does bring to mind the question if this could be conditional on the type of image being built ? via distro feature, some other mechanism ?

Exactly this: image building adds dependencies automatically based on

what

Quoted 1 line

is actually being used, so can the kernel do this too?

The way the build knows which image was built is to build the kernel then look
in the output directory to see what extension was given to the artifact. iow,
it only discovers the dependency partway through the build; it doesn't know the dependency when the build starts.

Quoted 9 lines

Either bitbake will have to put together the kernel's config at the start of
the build, then parse through it to try to determine which kernel will be built, or we need some sort of mechanism that allows us to add dependencies partway through a build, or we can add (yet another) build variable and hope
people are able to keep it in sync.

I'm on vacation for the next two weeks, so sorry for the slow reply.

Wouldn't something like PACKAGECONFIG work here ? Something automatic is going to be complex (like you describe), but something like this would be an
easy way for a BSP (or other) layer to bbappend the kernel and add this as a dependency.

... but then again, I suppose they could currently just bbappend the kernel recipe
and add it directly to the DEPENDS.

Bruce

Quoted 5 lines

...or we could just add lzop-native as a static dependency in the off-chance that
it's needed.

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#6 lore raw
Quoted 31 lines · Bruce Ashfield
Quoted 20 lines · Trevor Woerner
Quoted 1 line · Ross

On 1 August 2016 at 15:07, Bruce Ashfield <[email protected]>

Quoted 7 lines · wrote:
Quoted 5 lines

Not a large dependency, but it does bring to mind the question if this could be conditional on the type of image being built ? via distro feature, some other mechanism ?

Exactly this: image building adds dependencies automatically based on

what

Quoted 1 line

is actually being used, so can the kernel do this too?

The way the build knows which image was built is to build the kernel then look
in the output directory to see what extension was given to the artifact. iow,
it only discovers the dependency partway through the build; it doesn't know the dependency when the build starts.

Quoted 9 lines

Either bitbake will have to put together the kernel's config at the start of
the build, then parse through it to try to determine which kernel will be built, or we need some sort of mechanism that allows us to add dependencies partway through a build, or we can add (yet another) build variable and hope
people are able to keep it in sync.

Quoted 1 line

I'm on vacation for the next two weeks, so sorry for the slow reply.

np enjoy! "'tis the season" :-)

Quoted 10 lines

Wouldn't something like PACKAGECONFIG work here ? Something automatic is going to be complex (like you describe), but something like this would be an
easy way for a BSP (or other) layer to bbappend the kernel and add this as a dependency.

... but then again, I suppose they could currently just bbappend the kernel recipe
and add it directly to the DEPENDS.

I've proposed a change to the kernel.bbclass to add the lzop-native DEPENDS to the existing

	DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native"

because it's in this file that the lzop program is being called.

It seems as though your suggestions are discussing changes to a recipe (?) which is fine, I'll propose a patch to the BSP-in-question's kernel recipe.

Quoted 12 lines
Quoted 6 lines

...or we could just add lzop-native as a static dependency in the off-chance that
it's needed.

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"
#7 lore raw
In reply to Trevor Woerner

I've been adding "lzop-native" to a lot of kernel recipes because you also need it when generating an LZO compressed kernel (I like my boot time to be under 1 second).

It's a small dependency which is hard to automatically figure out, since there are a number of ways to trigger it (we just found two). I would welcome this patch very much, and I don't think many will suffer...

Quoted 21 lines · Trevor Woerner

If the initramfs image is type lzo, then a native lzop is needed.

---
  meta/classes/kernel.bbclass | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel.bbclass +1 -1
index fa76a14..db42744 100644
@@ -1,7 +1,7 @@
  inherit linux-kernel-base kernel-module-split
 
  PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native lzop-native"
 
  S = "${STAGING_KERNEL_DIR}"
  B = "${WORKDIR}/build"
#8 lore raw
Quoted 6 lines · Mike Looijmans

I've been adding "lzop-native" to a lot of kernel recipes because you also need it when generating an LZO compressed kernel (I like my boot time to be under 1 second).

It's a small dependency which is hard to automatically figure out, since there are a number of ways to trigger it (we just found two). I would welcome this patch very much, and I don't think many will suffer…

From linux.inc days there is a python snippet which can do this conditionally e.g. see

https://github.com/kraj/meta-raspberrypi/blob/master/recipes-kernel/linux/linux-rpi.inc#L121

Quoted 30 lines · Trevor Woerner
Quoted 13 lines

If the initramfs image is type lzo, then a native lzop is needed.

---
 meta/classes/kernel.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/kernel.bbclass +0 -0
index fa76a14..db42744 100644

meta/classes/kernel.bbclass line 7

Quoted 8 lines
meta/classes/kernel.bbclass +1 -1
@@ -1,7 +1,7 @@
 inherit linux-kernel-base kernel-module-split
 
 PROVIDES += "virtual/kernel"
-DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native"
+DEPENDS += "virtual/${TARGET_PREFIX}binutils virtual/${TARGET_PREFIX}gcc kmod-native depmodwrapper-cross bc-native lzop-native"
 
 S = "${STAGING_KERNEL_DIR}"
 B = "${WORKDIR}/build"

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#9 lore raw
Quoted 12 lines · Khem Raj
Quoted 11 lines

On Aug 9, 2016, at 5:08 AM, Mike Looijmans <[email protected]

Quoted 1 line

wrote:

I've been adding "lzop-native" to a lot of kernel recipes because you also need it when generating an LZO compressed kernel (I like my boot time to be under 1 second).

It's a small dependency which is hard to automatically figure out, since there are a number of ways to trigger it (we just found two). I would welcome this patch very much, and I don't think many will suffer…

Quoted 5 lines

From linux.inc days there is a python snippet which can do this conditionally e.g. see

https://github.com/kraj/meta-raspberrypi/blob/master/recipes-kernel/l
inux/linux-rpi.inc#L121

Which is fine if you have a prebuild defconfig file however in many cases we don't have that :(

Cheers,

Richard

#10 lore raw
Quoted 14 lines · Richard Purdie
Quoted 12 lines · Khem Raj
Quoted 11 lines

On Aug 9, 2016, at 5:08 AM, Mike Looijmans <[email protected]

Quoted 1 line

wrote:

I've been adding "lzop-native" to a lot of kernel recipes because you also need it when generating an LZO compressed kernel (I like my boot time to be under 1 second).

It's a small dependency which is hard to automatically figure out, since there are a number of ways to trigger it (we just found two). I would welcome this patch very much, and I don't think many will suffer…

Quoted 9 lines
Quoted 5 lines

From linux.inc days there is a python snippet which can do this conditionally e.g. see

https://github.com/kraj/meta-raspberrypi/blob/master/recipes-kernel/l
inux/linux-rpi.inc#L121

Which is fine if you have a prebuild defconfig file however in many cases we don't have that :(

Thats right perhaps dependency could be conputed after configure task and added to say compile task

Quoted 3 lines

Cheers,

Richard

#11 lore raw
Quoted 26 lines · Khem Raj
Quoted 3 lines · Richard Purdie
Quoted 1 line · Khem Raj
Quoted 1 line

On Aug 9, 2016, at 5:08 AM, Mike Looijmans <

[email protected]

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

wrote:

I've been adding "lzop-native" to a lot of kernel recipes

because

Quoted 1 line
Quoted 1 line
Quoted 1 line

you also need it when generating an LZO compressed kernel (I

like

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

my boot time to be under 1 second).

It's a small dependency which is hard to automatically figure

out,

Quoted 1 line
Quoted 1 line
Quoted 1 line

since there are a number of ways to trigger it (we just found

two).

Quoted 1 line
Quoted 1 line
Quoted 1 line

I would welcome this patch very much, and I don't think many

will

Quoted 6 lines
Quoted 6 lines
Quoted 1 line

suffer…

From linux.inc days there is a python snippet which can do this conditionally e.g. see

Quoted 8 lines

https://github.com/kraj/meta-raspberrypi/blob/master/recipes-kernel/l

Quoted 5 lines
Quoted 1 line

inux/linux-rpi.inc#L121

Which is fine if you have a prebuild defconfig file however in many cases we don't have that :(

Thats right perhaps dependency could be conputed after configure task and added to say compile task

Bitbake computes the dependency trees in advance, not on the fly so its sadly not possible to change the dependency graph during a running build. I'm sure you could design such a system but its not what we have today, nor does it likely warrant the extra complexity it could involve.

Cheers,

Richard