Skip to contentSkip to conversation

Building a kernel with builtin initramfs

DISCUSSION Paul Sokolovsky 5 participants 16 messages Feb 14, 2008 – Feb 17, 2008

lore
Share & tools
lore
#0 lore raw

Hello,

Sometimes, it may be necessary to have a kernel with builtin initramfs. Initramfs commonly kernel modules, so we have kernel build recursion. Standard way to break this loop is to split procedure causing recursion into independent steps, so we'd first build kernel modules, then build initramfs, then build a kernel image.

The question, is how to express this with bitbake and OE. Skipping various ideas, here's the one which promise viability:

1. Have a kernel-modules.bb, which will execute bitbake recursively to build a PREFERRED_PROVIDER_virtual/kernel, and will pass a special flag variable.

2. Detecting that flag, kernel.bbclass will build/package only modules.

3. Then, have a kernel-initramfs.bb (DEPENDS=kernel-modules) which will take a variable defining which initramfs image to build, if any, and execute bitbake recursively with IMAGE_FSTYPES=cpio.gz on that.

4. Make a task in kernel.bbclass depend on kernel-initramfs.bb (build task of it).

Again, that appears to be something working, at least from 1st look. However, it introduces new trick - recursive execution of bitbake, what, as far as I know, never happened so far. Well, for "make" such usage is commodity, and the fact that it is required 2 times in the above scenario show that it is useful ;-).

Other ideas?

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#1 lore raw
Quoted 25 lines · Paul Sokolovsky

Hello,

Sometimes, it may be necessary to have a kernel with builtin initramfs. Initramfs commonly kernel modules, so we have kernel build recursion. Standard way to break this loop is to split procedure causing recursion into independent steps, so we'd first build kernel modules, then build initramfs, then build a kernel image.

The question, is how to express this with bitbake and OE. Skipping various ideas, here's the one which promise viability:

1. Have a kernel-modules.bb, which will execute bitbake recursively to build a PREFERRED_PROVIDER_virtual/kernel, and will pass a special flag variable.

2. Detecting that flag, kernel.bbclass will build/package only modules.

3. Then, have a kernel-initramfs.bb (DEPENDS=kernel-modules) which will take a variable defining which initramfs image to build, if any, and execute bitbake recursively with IMAGE_FSTYPES=cpio.gz on that.

4. Make a task in kernel.bbclass depend on kernel-initramfs.bb (build task of it).

Quoted 8 lines

Again, that appears to be something working, at least from 1st look. However, it introduces new trick - recursive execution of bitbake, what, as far as I know, never happened so far. Well, for "make" such usage is commodity, and the fact that it is required 2 times in the above scenario show that it is useful ;-).

Other ideas?

Split the module generation out of the main compile/install/package tasks in kernel.bbclass and have kernel-initrmfs.bb's do_initramfs depend on that.
Can we have conditional inter-task dependencies in bitbake recipes?

regards
Philipp

#2 lore raw

Hello,

Quoted 14 lines · On Thu, 14 Feb 2008 11:55:28 +0100 "pHilipp Zabel" <[email protected]>…
Quoted 12 lines · Paul Sokolovsky

Hello,

Sometimes, it may be necessary to have a kernel with builtin
initramfs. Initramfs commonly kernel modules, so we have kernel build recursion. Standard way to break this loop is to split procedure causing recursion into independent steps, so we'd first build kernel modules, then build initramfs, then build a kernel image.

The question, is how to express this with bitbake and OE. Skipping various ideas, here's the one which promise viability:

Quoted 6 lines
Quoted 6 lines

1. Have a kernel-modules.bb, which will execute bitbake
recursively to build a PREFERRED_PROVIDER_virtual/kernel, and will pass a special flag variable.

2. Detecting that flag, kernel.bbclass will build/package only
modules.

Ok, this is not going to work due to timestamps.

Quoted 17 lines
Quoted 17 lines

3. Then, have a kernel-initramfs.bb (DEPENDS=kernel-modules) which
will take a variable defining which initramfs image to build, if any, and execute bitbake recursively with IMAGE_FSTYPES=cpio.gz on that.

4. Make a task in kernel.bbclass depend on kernel-initramfs.bb
(build task of it).

Again, that appears to be something working, at least from 1st
look. However, it introduces new trick - recursive execution of bitbake, what, as far as I know, never happened so far. Well, for "make" such usage is commodity, and the fact that it is required 2 times in the above scenario show that it is useful ;-).

Quoted 5 lines
Quoted 1 line

Other ideas?

Split the module generation out of the main compile/install/package tasks in kernel.bbclass and have kernel-initrmfs.bb's do_initramfs depend on that.

Well, that's of course how I started. So, in kernel.bbclass I have

do_compile_modules ()
addtask compile_modules after do_patch

do_install_modules()
addtask install_modules after do_compile_modules

That works, but that's where I stopped: how to package just modules - fork whole packaging class(es) like compile/install tasks forked above?

Quoted 1 line

Can we have conditional inter-task dependencies in bitbake recipes?

There're apparently many things bitbake can't, and is not going to do. For example, running subset of tasks in different context. Consider for example the fact that initramfs built for glibc-compiled kernel should be built using uclibc, etc, etc. Recursive invocation is a kinda meta-solution for such issues, modulo different constraints it brings ;-). Nontheless, it works - I committed initrdscripts/initramfs-image-ipk_1.0.bb yesterday.

Quoted 4 lines

regards
Philipp

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#3 lore raw
Quoted 19 lines · Paul Sokolovsky

Hello,

Quoted 14 lines · On Thu, 14 Feb 2008 11:55:28 +0100 "pHilipp Zabel" <[email protected]>…
Quoted 12 lines · Paul Sokolovsky

Hello,

Sometimes, it may be necessary to have a kernel with builtin
initramfs. Initramfs commonly kernel modules, so we have kernel build recursion. Standard way to break this loop is to split procedure causing recursion into independent steps, so we'd first build kernel modules, then build initramfs, then build a kernel image.

The question, is how to express this with bitbake and OE. Skipping various ideas, here's the one which promise viability:

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines

1. Have a kernel-modules.bb, which will execute bitbake
recursively to build a PREFERRED_PROVIDER_virtual/kernel, and will pass a special flag variable.

2. Detecting that flag, kernel.bbclass will build/package only
modules.

Ok, this is not going to work due to timestamps.

The problem is that this whole kernel/module issue is more like two intertwined recipes. We'd need separate timestamps for modules and kernel image. I'd prefer using the task dependency system to solve this.

Quoted 22 lines
Quoted 16 lines
Quoted 16 lines

3. Then, have a kernel-initramfs.bb (DEPENDS=kernel-modules) which
will take a variable defining which initramfs image to build, if any, and execute bitbake recursively with IMAGE_FSTYPES=cpio.gz on that.

4. Make a task in kernel.bbclass depend on kernel-initramfs.bb
(build task of it).

Again, that appears to be something working, at least from 1st
look. However, it introduces new trick - recursive execution of bitbake, what, as far as I know, never happened so far. Well, for "make" such usage is commodity, and the fact that it is required 2 times in the above scenario show that it is useful ;-).

Quoted 5 lines
Quoted 1 line

Other ideas?

Split the module generation out of the main compile/install/package tasks in kernel.bbclass and have kernel-initrmfs.bb's do_initramfs depend on that.

Quoted 7 lines

Well, that's of course how I started. So, in kernel.bbclass I have

do_compile_modules ()
addtask compile_modules after do_patch

do_install_modules()
addtask install_modules after do_compile_modules

Ok, that's what I was thinking about.

Quoted 2 lines

That works, but that's where I stopped: how to package just modules - fork whole packaging class(es) like compile/install tasks forked above?

We could make the ${WORKDIR}/install and ${WORKDIR}/image directories configurable and then call the original tasks from wrapper tasks setting those variables.

do_package() {
    PACKAGE_INSTALL_DIR=${WORKDIR}/install-kernel
    PACKAGE_IMAGE_DIR=${WORKDIR}/image-kernel
    package_do_package
}
do_package_modules() {
    PACKAGE_INSTALL_DIR=${WORKDIR}/install-modules
    PACKAGE_IMAGE_DIR=${WORKDIR}/image-modules
    package_do_package
}

Could something like this work?

Quoted 9 lines
Quoted 1 line

Can we have conditional inter-task dependencies in bitbake recipes?

There're apparently many things bitbake can't, and is not going to do. For example, running subset of tasks in different context. Consider for example the fact that initramfs built for glibc-compiled kernel should be built using uclibc, etc, etc. Recursive invocation is a kinda meta-solution for such issues, modulo different constraints it brings ;-). Nontheless, it works - I committed initrdscripts/initramfs-image-ipk_1.0.bb yesterday.

Very good, I guess we won't get around recursive invocation in the case of libc switching. Too many things depend on that. Looking forward to more modular kernels soon.

regards
Philipp

#4 lore raw

Hello,

Quoted 82 lines · On Fri, 15 Feb 2008 10:41:01 +0100 "pHilipp Zabel" <[email protected]>…
Quoted 19 lines · Paul Sokolovsky

Hello,

Quoted 14 lines · On Thu, 14 Feb 2008 11:55:28 +0100 "pHilipp Zabel" <[email protected]>…
Quoted 12 lines · Paul Sokolovsky

Hello,

Sometimes, it may be necessary to have a kernel with builtin
initramfs. Initramfs commonly kernel modules, so we have kernel build recursion. Standard way to break this loop is to split procedure causing recursion into independent steps, so we'd first build kernel modules, then build initramfs, then build a kernel image.

The question, is how to express this with bitbake and OE.
Skipping various ideas, here's the one which promise viability:

Quoted 8 lines
Quoted 6 lines
Quoted 6 lines

1. Have a kernel-modules.bb, which will execute bitbake
recursively to build a PREFERRED_PROVIDER_virtual/kernel, and will pass a special flag variable.

2. Detecting that flag, kernel.bbclass will build/package only
modules.

Ok, this is not going to work due to timestamps.

The problem is that this whole kernel/module issue is more like two intertwined recipes. We'd need separate timestamps for modules and kernel image. I'd prefer using the task dependency system to solve this.

Quoted 23 lines
Quoted 17 lines
Quoted 17 lines

3. Then, have a kernel-initramfs.bb (DEPENDS=kernel-modules)
which will take a variable defining which initramfs image to build, if any, and execute bitbake recursively with IMAGE_FSTYPES=cpio.gz on that.

4. Make a task in kernel.bbclass depend on kernel-initramfs.bb
(build task of it).

Again, that appears to be something working, at least from 1st
look. However, it introduces new trick - recursive execution of bitbake, what, as far as I know, never happened so far. Well, for "make" such usage is commodity, and the fact that it is required 2 times in the above scenario show that it is useful ;-).

Quoted 5 lines
Quoted 1 line

Other ideas?

Split the module generation out of the main compile/install/package tasks in kernel.bbclass and have kernel-initrmfs.bb's do_initramfs depend on that.

Quoted 7 lines

Well, that's of course how I started. So, in kernel.bbclass I have

do_compile_modules ()
addtask compile_modules after do_patch

do_install_modules()
addtask install_modules after do_compile_modules

Ok, that's what I was thinking about.

Quoted 3 lines

That works, but that's where I stopped: how to package just
modules - fork whole packaging class(es) like compile/install tasks forked above?

We could make the ${WORKDIR}/install and ${WORKDIR}/image directories configurable and then call the original tasks from wrapper tasks setting those variables.

do_package() {
    PACKAGE_INSTALL_DIR=${WORKDIR}/install-kernel
    PACKAGE_IMAGE_DIR=${WORKDIR}/image-kernel
    package_do_package
}
Quoted 7 lines
do_package_modules() {
    PACKAGE_INSTALL_DIR=${WORKDIR}/install-modules
    PACKAGE_IMAGE_DIR=${WORKDIR}/image-modules
    package_do_package
}

Could something like this work?

python package_do_package () {
[]
}
do_package[dirs] = "${D}"

Note sure how such declarative stuff can be converted to imperative style like above. Also, do_package is only part of the picture. Important thing is package_write. And the way it is implemented now, do_package_write is just a dummy anchor task. Subclasses do not implement it, but instead anchor using it in task sequence:

addtask package_write_ipk before do_package_write after do_package

This is weird. Richard, was it done this way? It makes impossible to imperatively call package writeout task ;-((.

Otherwise, regarding producing initramfs'ed kernel, I switched to the solution a-la initramfs-image-ipk - instead of trying to plug into existing kernel.bbclass task sequence, I made a separate task which builds kernel with initramfs included. Of course, that's not ideal - package with non-initramfsed kernel already written by that time, so new package would need to overwrite it ;-\. If package writing were possible at all, but it's not due to the above.

My current idea is to write package in separate recipe at all, stealing PV from the file.

[]

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#5 lore raw

Sorry, I am aware of the thread but I haven't had time to respond much :(.

Quoted 11 lines · Paul Sokolovsky

python package_do_package () {
[]
}
do_package[dirs] = "${D}"

Note sure how such declarative stuff can be converted to imperative style like above. Also, do_package is only part of the picture. Important thing is package_write. And the way it is implemented now, do_package_write is just a dummy anchor task. Subclasses do not implement it, but instead anchor using it in task sequence:

Quoted 4 lines

addtask package_write_ipk before do_package_write after do_package

This is weird. Richard, was it done this way? It makes impossible to imperatively call package writeout task ;-((.

This is deliberate. Its so if you have "deb" packaging enabled and then switch to "ipk", everything just works since bitbake realises which stamps are missing and builds the missing parts.

Quoted 10 lines

Otherwise, regarding producing initramfs'ed kernel, I switched to the solution a-la initramfs-image-ipk - instead of trying to plug into existing kernel.bbclass task sequence, I made a separate task which builds kernel with initramfs included. Of course, that's not ideal - package with non-initramfsed kernel already written by that time, so new package would need to overwrite it ;-\. If package writing were possible at all, but it's not due to the above.

My current idea is to write package in separate recipe at all, stealing PV from the file.

I'm not sure this recursive bitbake calling is something we want to encourage as its going to cause massive support nightmares and just confuse people. What I'd prefer to see is a sequence like:

bitbake initramfs-image
bitbake initramfs-kernel

The initramfs-kernel recipe complains if it can't find a compatible initramfs image and provides instructions on what you need to do to create one.

Whilst this means the user has to run two commands, it also means they see and understand what is going on.

Cheers,

Richard

#6 lore raw

Hello,

Quoted 15 lines · On Fri, 15 Feb 2008 11:58:15 +0000 Richard Purdie <[email protected]> wrote:

Sorry, I am aware of the thread but I haven't had time to respond much :(.

Quoted 11 lines · Paul Sokolovsky

python package_do_package () {
[]
}
do_package[dirs] = "${D}"

Note sure how such declarative stuff can be converted to imperative style like above. Also, do_package is only part of the picture. Important thing is package_write. And the way it is implemented now, do_package_write is just a dummy anchor task. Subclasses do not implement it, but instead anchor using it in task sequence:

Quoted 8 lines
Quoted 4 lines

addtask package_write_ipk before do_package_write after do_package

This is weird. Richard, was it done this way? It makes impossible to imperatively call package writeout task ;-((.

This is deliberate. Its so if you have "deb" packaging enabled and then switch to "ipk", everything just works since bitbake realises which stamps are missing and builds the missing parts.

;-( That's apparently a case where good rebuild from scratch would solve all issues ;-). Or looking at the root of it, making bitbake operate on hierarchical tasks would solve this and likely other issues we discuss.

Quoted 9 lines
Quoted 9 lines

Otherwise, regarding producing initramfs'ed kernel, I switched to the solution a-la initramfs-image-ipk - instead of trying to plug into existing kernel.bbclass task sequence, I made a separate task which builds kernel with initramfs included. Of course, that's not ideal - package with non-initramfsed kernel already written by that time, so new package would need to overwrite it ;-\. If package writing were possible at all, but it's not due to the above.

Quoted 6 lines
Quoted 2 lines

My current idea is to write package in separate recipe at all, stealing PV from the file.

I'm not sure this recursive bitbake calling is something we want to encourage as its going to cause massive support nightmares and just confuse people.

Encourage? No. Recursion is far too morbid force to let anyone
use it ;-). Let's keep it for special cases only.

Quoted 5 lines

What I'd prefer to see is a sequence like:

bitbake initramfs-image
bitbake initramfs-kernel

Ah, you mean sequences of:

./configure <lotsa stuff>
make
make install <some stuff>
...

? Wait, that holy place is taken already! And OE have been going in quite different direction for long time. It automates mind-boggling things like building gcc or glibc, but when it comes to automating bitbake with bitbake itself, there's suddenly a taboo? ;-)

Quoted 6 lines

The initramfs-kernel recipe complains if it can't find a compatible initramfs image and provides instructions on what you need to do to create one.

Whilst this means the user has to run two commands, it also means they see and understand what is going on.

Running bitbake in recipe is just as visible and understandable as running gcc or anything else - nothing is shown to users except for some high-level motions, but all actions are recorded in logs. So, to understand what's going on, a look at recipe and logs is required in either case, and there're lots of "non-recursive" recipes which are beyond understanding of mere humans. On the contrary, initramfs-image-ipk is pretty easy (except for long lines) and should easily teach something new.

Other points:
* It only starts with 2 commands, the list grows with the time (exponentially?)
* It's not going to be those easy "bitbake foo + bitbake bar" 2-word commands. As was pointed already, building an initramfs requires ANGSTROM_MODE (aka LIBC_TYPE aka (but unrecognized) SYSTYPE) and IMAGE_FSTYPES set. Further - more.
* One of the annoying issues is to how to get hands on results of the first task in the second one. Currently, for the second task, such location is rather unpredictable. I solved this by adding special task which just accepts parameter - location where to put stuff. Again, special tasks, special parameters. User would either need to know and use them, or do it all manually.

Quoted 6 lines

Cheers,

Richard

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#7 lore raw
Quoted 7 lines · Paul Sokolovsky
Quoted 4 lines · Paul Sokolovsky

This is deliberate. Its so if you have "deb" packaging enabled and then switch to "ipk", everything just works since bitbake realises which stamps are missing and builds the missing parts.

;-( That's apparently a case where good rebuild from scratch would solve all issues ;-).

Apart from the time taken. Why waste all the time when we don't need to. This was a nice solution which fitted into existing frameworks, wasn't complicated and worked well.

Quoted 3 lines

Or looking at the root of it, making bitbake
operate on hierarchical tasks would solve this and likely other issues we discuss.

What do you mean by hierarchical tasks? It is a hierarchical task executor already?

Quoted 11 lines
Quoted 5 lines

What I'd prefer to see is a sequence like:

bitbake initramfs-image
bitbake initramfs-kernel

Ah, you mean sequences of:

./configure <lotsa stuff>
make
make install <some stuff>

No, I don't mean sequences like that, they're obviously different.

Quoted 4 lines

? Wait, that holy place is taken already! And OE have been going in quite different direction for long time. It automates mind-boggling things like building gcc or glibc, but when it comes to automating bitbake with bitbake itself, there's suddenly a taboo? ;-)

Yes. It requires a very precise distro setup for this to work. For example I changed the libc mode I was using in poky the other day and smashed up a load of my glibc ipks.

You're proposing this as a solution to switching libc modes and who knows what else and it really isn't an option.

Quoted 8 lines

Running bitbake in recipe is just as visible and understandable as running gcc or anything else - nothing is shown to users except for some high-level motions, but all actions are recorded in logs. So, to understand what's going on, a look at recipe and logs is required in either case, and there're lots of "non-recursive" recipes which are beyond understanding of mere humans. On the contrary, initramfs-image-ipk is pretty easy (except for long lines) and should easily teach something new.

No, it breaks things for the user, e.g. "bitbake -g" no longer shows all the tasks that actually happen. It also won't honour bitbake's threading instuctions. Oh, and how sure are you that two bitbakes can run on the same directory at once? (the answer is that they can't and it will break badly.)

Quoted 3 lines

Other points:
* It only starts with 2 commands, the list grows with the time (exponentially?)

How many of these recursive executions have we ever needed? Can you give me more examples of cases where we need to do exponential recursive execution?

Quoted 4 lines

* It's not going to be those easy "bitbake foo + bitbake bar" 2-word commands. As was pointed already, building an initramfs requires ANGSTROM_MODE (aka LIBC_TYPE aka (but unrecognized) SYSTYPE) and IMAGE_FSTYPES set. Further - more.

ANGSTROM_MODE? So this is even angstrom specific and requires special setup? (it also implies multimachine which is not default)

Quoted 6 lines

* One of the annoying issues is to how to get hands on results of the first task in the second one. Currently, for the second task, such location is rather unpredictable. I solved this by adding special task which just accepts parameter - location where to put stuff. Again, special tasks, special parameters. User would either need to know and use them, or do it all manually.

We used to have this problem with kernels and images for scripting purposes which is why we added predictably named symlinks. These kind of issues are solvable in simple ways with some thought.

I'm actually going to go as far as proposing any recursive bitbake recipes are removed from OE.dev ASAP for the reasons I've mentioned above. We *need* to find a better way. I will try and help you find that and will extend bitbake if needed.

I think the problem is you're effectively trying to end up with something where you "bitbake angstrom" and it produces a distribution, uploads it, writes its own documentation and fixes its own bugs. There is always going to be some effort that comes from a user when directing bitbake what to do, be it setting the MACHINE, saying what image type you'd like or what kind of image you want. The problem you're addressing is one clearly where the user needs to provide some input.

Its ironic that you were arguing *against* my insistence of the automatic setting of the IMAGE_FSTYPES variable on a per machine basis ;-).

Cheers,

Richard

#8 lore raw

Hello,

Quoted 13 lines · On Fri, 15 Feb 2008 17:11:50 +0000 Richard Purdie <[email protected]> wrote:
Quoted 7 lines · Paul Sokolovsky
Quoted 4 lines · Paul Sokolovsky

This is deliberate. Its so if you have "deb" packaging enabled and then switch to "ipk", everything just works since bitbake realises which stamps are missing and builds the missing parts.

;-( That's apparently a case where good rebuild from scratch would solve all issues ;-).

Apart from the time taken. Why waste all the time when we don't need to. This was a nice solution which fitted into existing frameworks, wasn't complicated and worked well.

Quoted 6 lines
Quoted 3 lines

Or looking at the root of it, making bitbake
operate on hierarchical tasks would solve this and likely other issues we discuss.

What do you mean by hierarchical tasks? It is a hierarchical task executor already?

For this specific case, I meant to have following hierarchy:

do_package_write
\-- do_package_write_ipk
|-- do_package_write_deb

So, by calling do_package_write task, one would be assured that packages in whatever selected formats were written. Timestamps could be of form:

foo.do_package_write.do_package_write_ipk

As for now, it seems that bitbake maintains flat task list, with the flat dependencies (run task before x and after y).

Quoted 15 lines
Quoted 7 lines
Quoted 6 lines

What I'd prefer to see is a sequence like:

bitbake initramfs-image
bitbake initramfs-kernel

Quoted 5 lines

Ah, you mean sequences of:

./configure <lotsa stuff>
make
make install <some stuff>

No, I don't mean sequences like that, they're obviously different.

Quoted 8 lines
Quoted 4 lines

? Wait, that holy place is taken already! And OE have been going in quite different direction for long time. It automates mind-boggling things like building gcc or glibc, but when it comes to automating bitbake with bitbake itself, there's suddenly a taboo? ;-)

Yes. It requires a very precise distro setup for this to work. For example I changed the libc mode I was using in poky the other day and smashed up a load of my glibc ipks.

Fully agree. And very precise distro setup is also what is needed to assure user satisfaction with the building (because even with recursion, there're lots of things to misconfigure), and also to assure quality and QAability. So, OE should be moving at that direction, and I would think that Angstrom is a testbed for that for example.

Quoted 2 lines

You're proposing this as a solution to switching libc modes and who knows what else

Else - what practice calls. All this came out not from mere speculation, but from the need to build a kernel with linked-in initramfs - which is upstream-supported configuration for many years, and which OE is unable to build.

Quoted 11 lines

and it really isn't an option.

Quoted 8 lines

Running bitbake in recipe is just as visible and understandable as running gcc or anything else - nothing is shown to users except for some high-level motions, but all actions are recorded in logs. So, to understand what's going on, a look at recipe and logs is required in either case, and there're lots of "non-recursive" recipes which are beyond understanding of mere humans. On the contrary, initramfs-image-ipk is pretty easy (except for long lines) and should easily teach something new.

Quoted 2 lines

No, it breaks things for the user, e.g. "bitbake -g" no longer shows all the tasks that actually happen.

This also assume flat world view, where bitbake is the singular
god. Because with other look, bitbake -g shows *all* tasks it runs, just on the current level of its power.

Quoted 2 lines

It also won't honour bitbake's
threading instuctions.

Yes, I expressed this concern in the very first mail. IMHO,
productive consideration of this issue would involve assessing prior art, noting that parallel make doesn't work for some Makefiles, noting that OE has safeguards to disallow it for some recipes, and wondering if ability to disable parallel bitbake for some recipes is a viable idea.

Quoted 3 lines

Oh, and how sure are you that two bitbakes can
run on the same directory at once? (the answer is that they can't and it will break badly.)

Well, only practice, itself ;-). It all does run here, without
any disasters. Again, if it doesn't, let's fix it?

Quoted 8 lines
Quoted 4 lines

Other points:
* It only starts with 2 commands, the list grows with the time (exponentially?)

How many of these recursive executions have we ever needed? Can you give me more examples of cases where we need to do exponential recursive execution?

Not literally, I'm afraid, just usual quoting laws of nature ;-).

Quoted 7 lines
Quoted 5 lines

* It's not going to be those easy "bitbake foo + bitbake bar" 2-word commands. As was pointed already, building an initramfs requires ANGSTROM_MODE (aka LIBC_TYPE aka (but unrecognized) SYSTYPE) and IMAGE_FSTYPES set. Further - more.

ANGSTROM_MODE?

No, SYSTYPE! And that should be INITRAMFS_SYSTYPE, of course.
Just not everything in one iteration (still blocked on the very SYSTYPE).

Quoted 2 lines

So this is even angstrom specific and requires special setup? (it also implies multimachine which is not default)

Maybe it's time to make it default.

Quoted 10 lines
Quoted 6 lines

* One of the annoying issues is to how to get hands on results of the first task in the second one. Currently, for the second task, such location is rather unpredictable. I solved this by adding special task which just accepts parameter - location where to put stuff. Again, special tasks, special parameters. User would either need to know and use them, or do it all manually.

We used to have this problem with kernels and images for scripting purposes which is why we added predictably named symlinks. These kind of issues are solvable in simple ways with some thought.

Those predictably named symlinks live in unpredictably named and structured directories. My recipes take care of that - in simple ways exactly.

Quoted 5 lines

I'm actually going to go as far as proposing any recursive bitbake recipes are removed from OE.dev ASAP for the reasons I've mentioned above. We *need* to find a better way. I will try and help you find that and will extend bitbake if needed.

Yes, we need to find a better way. But many things are on todo for a long time in OE, without much moving ;-(. My recipes for building kernel with linked initramfs is a kind of sprint trying to solve one of such long-standing issues. The solution is of course is not perfect, but does work, and can be elaborated to either remove unneeded environment dependencies, or solved in completely different way. But in the meantime, it would be already usable where it is needed. So, I have alternative proposal - leaving them in OE, possibly move to angstrom-specific dir if its considered too Angstrom-specific.

My reason for working in this direction is purely pragmatic - since then HH.org LAB was given up as a price to be able to work closer with other kernel porting communities, there were no bootloader which would be able to boot kernel out of rootfs. That in turn means choring complexities for users while upgrading kernel. So, all this work is just to be able to boot using initramfs-shaped bootloaders, and thus purely practical, intended to go general availability tomorrow or so. obviously, removing recipes from OE would rather complicate my work.

Quoted 2 lines

I think the problem is you're effectively trying to end up with something where you "bitbake angstrom" and it produces a distribution,

Yes, isn't that what bitbake supposed to do?

Quoted 1 line

uploads it, writes its own documentation and fixes its own bugs.

No, none of these three.

Quoted 6 lines

There
is always going to be some effort that comes from a user when directing bitbake what to do, be it setting the MACHINE, saying what image type you'd like or what kind of image you want. The problem you're addressing is one clearly where the user needs to provide some input.

Building kernel is where user needs to provide some input? Which one exactly?

Quoted 4 lines

Its ironic that you were arguing *against* my insistence of the automatic setting of the IMAGE_FSTYPES variable on a per machine basis ;-).

It's because we see this problem from orthogonal views. There're thousands of machines (yes, there're, the fact that OE lacks all them is not only due to fact that noone contributes them all, but also due to OE's lack of good paradigm to maintain them). So, carefully crafted hacks for one or another machine appear to be just random divergences looking from eagle's eye on entire machine set. So IMHO, machines should be maintained just like that - as a set.

Regarding this case, I would understand your concerns if I hacked this stuff on linux-hh level. But of course, I try to make it generic and potentially working for any kernel and config. Where it can't be right now, is not my fault, but something hopefully to fix, not to limit new developments by.

Quoted 6 lines

Cheers,

Richard

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#9 lore raw
Quoted 11 lines · Paul Sokolovsky
Quoted 3 lines · Richard Purdie

On Fri, 2008-02-15 at 18:29 +0200, Paul Sokolovsky wrote:
What do you mean by hierarchical tasks? It is a hierarchical task executor already?

For this specific case, I meant to have following hierarchy:

do_package_write
\-- do_package_write_ipk
|-- do_package_write_deb

Quoted 8 lines

So, by calling do_package_write task, one would be assured that packages in whatever selected formats were written. Timestamps could be of form:

foo.do_package_write.do_package_write_ipk

As for now, it seems that bitbake maintains flat task list, with the flat dependencies (run task before x and after y).

Eh? Bitbake does not maintain a "flat" task list.

Looking at what package_*.bbclass say:

addtask package_write_deb before do_package_write after do_package addtask package_write_ipk before do_package_write after do_package

So it says each package output task must run after do_package and before do_package_write. After the package_write completes, all packaging is done.

"So, by calling do_package_write task, one *is* assured that packages in whatever selected formats were written."

Quoted 9 lines
Quoted 3 lines

Yes. It requires a very precise distro setup for this to work. For example I changed the libc mode I was using in poky the other day and smashed up a load of my glibc ipks.

Fully agree. And very precise distro setup is also what is needed to assure user satisfaction with the building (because even with recursion, there're lots of things to misconfigure), and also to assure quality and QAability. So, OE should be moving at that direction, and I would think that Angstrom is a testbed for that for example.

I think you mean adding recursion adds whole new dimensions of problems.

Quoted 7 lines
Quoted 2 lines

You're proposing this as a solution to switching libc modes and who knows what else

Else - what practice calls. All this came out not from mere speculation, but from the need to build a kernel with linked-in initramfs - which is upstream-supported configuration for many years, and which OE is unable to build.

So lets try and teach it. There are boundaries we can't cross though. Recursion is not and never will be supported. If you think it should be, please start sending patches to bitbake to make it safe. With the current bitbake manpower there are much more important things to do I'm afraid.

Quoted 6 lines
Quoted 2 lines

No, it breaks things for the user, e.g. "bitbake -g" no longer shows all the tasks that actually happen.

This also assume flat world view, where bitbake is the singular
god. Because with other look, bitbake -g shows *all* tasks it runs, just on the current level of its power.

Bitbake runs the OE metadata, thats its job.

Quoted 6 lines

Yes, I expressed this concern in the very first mail. IMHO,
productive consideration of this issue would involve assessing prior art, noting that parallel make doesn't work for some Makefiles, noting that OE has safeguards to disallow it for some recipes, and wondering if ability to disable parallel bitbake for some recipes is a viable idea.

Bitbake does not support recursion. Period. Full stop. No ifs, buts or otherwise. "Team bitbake" will not support such use.

Quoted 6 lines
Quoted 3 lines

Oh, and how sure are you that two bitbakes can
run on the same directory at once? (the answer is that they can't and it will break badly.)

Well, only practice, itself ;-). It all does run here, without
any disasters. Again, if it doesn't, let's fix it?

Pure luck. I'd bet I can break it in several different ways which you can't fix...

Quoted 9 lines
Quoted 7 lines
Quoted 3 lines

Other points:
* It only starts with 2 commands, the list grows with the time (exponentially?)

How many of these recursive executions have we ever needed? Can you give me more examples of cases where we need to do exponential recursive execution?

Not literally, I'm afraid, just usual quoting laws of nature ;-).

So for one problematic case we should open a tanker of worms?

Quoted 10 lines
Quoted 6 lines
Quoted 4 lines

* It's not going to be those easy "bitbake foo + bitbake bar" 2-word commands. As was pointed already, building an initramfs requires ANGSTROM_MODE (aka LIBC_TYPE aka (but unrecognized) SYSTYPE) and IMAGE_FSTYPES set. Further - more.

ANGSTROM_MODE?

No, SYSTYPE! And that should be INITRAMFS_SYSTYPE, of course.
Just not everything in one iteration (still blocked on the very SYSTYPE).

Another discussion for another time/place.

Quoted 4 lines
Quoted 2 lines

So this is even angstrom specific and requires special setup? (it also implies multimachine which is not default)

Maybe it's time to make it default.

I'd argue for that for different reasons. Sadly multimachine isn't bug free though as I keep finding holes in its behaviour :(.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

* One of the annoying issues is to how to get hands on results of the first task in the second one. Currently, for the second task, such location is rather unpredictable. I solved this by adding special task which just accepts parameter - location where to put stuff. Again, special tasks, special parameters. User would either need to know and use them, or do it all manually.

Quoted 7 lines
Quoted 3 lines

We used to have this problem with kernels and images for scripting purposes which is why we added predictably named symlinks. These kind of issues are solvable in simple ways with some thought.

Those predictably named symlinks live in unpredictably named and structured directories. My recipes take care of that - in simple ways exactly.

Those very unpredictably named directories you rely on in the script and without your recipe would break?

Quoted 5 lines
Quoted 4 lines

I'm actually going to go as far as proposing any recursive bitbake recipes are removed from OE.dev ASAP for the reasons I've mentioned above. We *need* to find a better way. I will try and help you find that and will extend bitbake if needed.

Quoted 9 lines

Yes, we need to find a better way. But many things are on todo for a long time in OE, without much moving ;-(. My recipes for building kernel with linked initramfs is a kind of sprint trying to solve one of such long-standing issues. The solution is of course is not perfect, but does work, and can be elaborated to either remove unneeded environment dependencies, or solved in completely different way. But in the meantime, it would be already usable where it is needed. So, I have alternative proposal - leaving them in OE, possibly move to angstrom-specific dir if its considered too Angstrom-specific.

Or we remove it and wait until something we're willing to maintain is developed. Working for some use cases is not a good reason to push this into OE. This is why we have the mess that is rm_work for example. I'm now left trying to figure out a way to integrate its behaviour into bitbake. Sure people complain about the ways it breaks, nobody steps up to help fix it though :(. I think we'll find a way to salvage rm_work. I don't think this case is salvageable and I don't even going to go there.

Quoted 8 lines

My reason for working in this direction is purely pragmatic - since then HH.org LAB was given up as a price to be able to work closer with other kernel porting communities, there were no bootloader which would be able to boot kernel out of rootfs. That in turn means choring complexities for users while upgrading kernel. So, all this work is just to be able to boot using initramfs-shaped bootloaders, and thus purely practical, intended to go general availability tomorrow or so. obviously, removing recipes from OE would rather complicate my work.

So you're going to push something that core OE devs object to into widespread use and ignore our concerns? Thanks :(.

Quoted 4 lines
Quoted 2 lines

I think the problem is you're effectively trying to end up with something where you "bitbake angstrom" and it produces a distribution,

Yes, isn't that what bitbake supposed to do?

Not with its current design, no.

Quoted 9 lines
Quoted 6 lines

There
is always going to be some effort that comes from a user when directing bitbake what to do, be it setting the MACHINE, saying what image type you'd like or what kind of image you want. The problem you're addressing is one clearly where the user needs to provide some input.

Building kernel is where user needs to provide some input? Which one exactly?

Which flavour of rootfs to use (libc, image type, image contents)?

Quoted 12 lines
Quoted 3 lines

Its ironic that you were arguing *against* my insistence of the automatic setting of the IMAGE_FSTYPES variable on a per machine basis ;-).

It's because we see this problem from orthogonal views. There're thousands of machines (yes, there're, the fact that OE lacks all them is not only due to fact that noone contributes them all, but also due to OE's lack of good paradigm to maintain them). So, carefully crafted hacks for one or another machine appear to be just random divergences looking from eagle's eye on entire machine set. So IMHO, machines should be maintained just like that - as a set.

Quoted 5 lines

Regarding this case, I would understand your concerns if I hacked this stuff on linux-hh level. But of course, I try to make it generic and potentially working for any kernel and config. Where it can't be right now, is not my fault, but something hopefully to fix, not to limit new developments by.

We have certain confines we have to live within. If we break these the foundations collapse. You're tunnelling through foundations and I'm not happy at all about it since the walls will fall in :(. I also don't think you realise the implications of what you're doing.

Just for the lists reference I've raised this with the core devs who I will discuss this with and then take any action agreed upon.

Cheers,

Richard

#10 lore raw

Hello,

Quoted 23 lines · On Fri, 15 Feb 2008 22:52:07 +0000 Richard Purdie <[email protected]> wrote:
Quoted 11 lines · Paul Sokolovsky
Quoted 3 lines · Richard Purdie

On Fri, 2008-02-15 at 18:29 +0200, Paul Sokolovsky wrote:
What do you mean by hierarchical tasks? It is a hierarchical task executor already?

For this specific case, I meant to have following hierarchy:

do_package_write
\-- do_package_write_ipk
|-- do_package_write_deb

Quoted 8 lines

So, by calling do_package_write task, one would be assured that packages in whatever selected formats were written. Timestamps could be of form:

foo.do_package_write.do_package_write_ipk

As for now, it seems that bitbake maintains flat task list, with the flat dependencies (run task before x and after y).

Eh? Bitbake does not maintain a "flat" task list.

Quoted 8 lines

Looking at what package_*.bbclass say:

addtask package_write_deb before do_package_write after do_package addtask package_write_ipk before do_package_write after do_package

So it says each package output task must run after do_package and before do_package_write. After the package_write completes, all packaging is done.

This imposes only linear ordering.

Quoted 3 lines

"So, by calling do_package_write task, one *is* assured that packages in whatever selected formats were written."

No, do_package_write is empty task, by "calling" it, one gets nothing. To get packaging done, one would need to "call all tasks between do_package and do_package_write", for what there's of course no API, which is not guaranteed to not do other things, and where do_package and do_package_write are arbitrary anchors.

I keep discussion this, because the same approach - explicitly hierarchical tasks with ability to override execution environment for a task and all its subtasks would solve "recursion on the OS level" problem (by taking that recursion into bitbake level of course).

Quoted 11 lines
Quoted 10 lines
Quoted 3 lines

Yes. It requires a very precise distro setup for this to work. For example I changed the libc mode I was using in poky the other day and smashed up a load of my glibc ipks.

Fully agree. And very precise distro setup is also what is needed to assure user satisfaction with the building (because even with recursion, there're lots of things to misconfigure), and also to assure quality and QAability. So, OE should be moving at that direction, and I would think that Angstrom is a testbed for that for example.

Quoted 2 lines

I think you mean adding recursion adds whole new dimensions of problems.

Powerful things add new problems.

Quoted 9 lines
Quoted 8 lines
Quoted 3 lines

You're proposing this as a solution to switching libc modes and who knows what else

Else - what practice calls. All this came out not from mere speculation, but from the need to build a kernel with linked-in initramfs - which is upstream-supported configuration for many years, and which OE is unable to build.

Quoted 5 lines

So lets try and teach it. There are boundaries we can't cross though. Recursion is not and never will be supported. If you think it should be, please start sending patches to bitbake to make it safe. With the current bitbake manpower there are much more important things to do I'm afraid.

Well, I wish I had resources to submit patches everywhere, but I don't. That doesn't mean I don't want to help with showing bitbake deficiencies, and overcoming them, even in hacky way. So far, I didn't get specific hints why running bitbake recursively on OS level in the same dir may break. Except for multithreading issue, a "solution" for which (in line with the whole recipes) would be something like (pseudocode):

python() {
	if bb.getVar("BB_NUMBER_THREADS") > 1:
		bb.fatal("Oops, this recipe doesn't support MT")
}
Quoted 16 lines
Quoted 6 lines
Quoted 2 lines

No, it breaks things for the user, e.g. "bitbake -g" no longer shows all the tasks that actually happen.

This also assume flat world view, where bitbake is the
singular god. Because with other look, bitbake -g shows *all* tasks it runs, just on the current level of its power.

Bitbake runs the OE metadata, thats its job.

Quoted 6 lines

Yes, I expressed this concern in the very first mail. IMHO,
productive consideration of this issue would involve assessing prior art, noting that parallel make doesn't work for some Makefiles, noting that OE has safeguards to disallow it for some recipes, and wondering if ability to disable parallel bitbake for some recipes is a viable idea.

Quoted 2 lines

Bitbake does not support recursion. Period. Full stop. No ifs, buts or otherwise. "Team bitbake" will not support such use.

It's easier for me here, not being "team bitbake" - I have a problem at hand, due to bitbake deficiency cannot solve it properly, so I devise a workaround which actually works (so far, tested under specific conditions, but can be extended/explicitly constrained to those conditions). It's up to "team bitbake" to treat it in some or another way - as a hint where bitbake is lacking to its "generic task executor" motto, as "no, no" and destroy, or as once and at all exception solving very basic task at hand, while something better coming up.

Quoted 10 lines
Quoted 7 lines
Quoted 4 lines

Oh, and how sure are you that two bitbakes can
run on the same directory at once? (the answer is that they can't and it will break badly.)

Well, only practice, itself ;-). It all does run here,
without any disasters. Again, if it doesn't, let's fix it?

Pure luck. I'd bet I can break it in several different ways which you can't fix...

Well, maybe fixing this (and accepting as phenomena grata) would be easier than doing anything else.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

Other points:
* It only starts with 2 commands, the list grows with the time (exponentially?)

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

How many of these recursive executions have we ever needed? Can you give me more examples of cases where we need to do exponential recursive execution?

Not literally, I'm afraid, just usual quoting laws of nature ;-).

So for one problematic case we should open a tanker of worms?

Why there're other option, for example for one and only one problematic case we can allow a workaround.

Quoted 14 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines

* It's not going to be those easy "bitbake foo + bitbake bar" 2-word commands. As was pointed already, building an initramfs requires ANGSTROM_MODE (aka LIBC_TYPE aka (but unrecognized) SYSTYPE) and IMAGE_FSTYPES set. Further - more.

ANGSTROM_MODE?

No, SYSTYPE! And that should be INITRAMFS_SYSTYPE, of
course. Just not everything in one iteration (still blocked on the very SYSTYPE).

Another discussion for another time/place.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

So this is even angstrom specific and requires special setup? (it also implies multimachine which is not default)

Maybe it's time to make it default.

I'd argue for that for different reasons. Sadly multimachine isn't bug free though as I keep finding holes in its behaviour :(.

Unfortunately, in a development tool, there're usually multiple holes everywhere. Constraining that tool config to one configuration (the more powerful one) may be good choice to save effort.

Quoted 13 lines
Quoted 13 lines
Quoted 12 lines
Quoted 8 lines

* One of the annoying issues is to how to get hands on results of the first task in the second one. Currently, for the second task, such location is rather unpredictable. I solved this by adding special task which just accepts parameter - location where to put stuff. Again, special tasks, special parameters. User would either need to know and use them, or do it all manually.

We used to have this problem with kernels and images for scripting purposes which is why we added predictably named symlinks. These kind of issues are solvable in simple ways with some thought.

Quoted 6 lines
Quoted 3 lines

Those predictably named symlinks live in unpredictably named and structured directories. My recipes take care of that - in simple ways exactly.

Those very unpredictably named directories you rely on in the script and without your recipe would break?

Now, this is getting interested. I explicitly developed all that stuff to *not* depend on that! Care to point me where you see issue, just as a reality check for me?

Quoted 17 lines
Quoted 6 lines
Quoted 5 lines

I'm actually going to go as far as proposing any recursive bitbake recipes are removed from OE.dev ASAP for the reasons I've mentioned above. We *need* to find a better way. I will try and help you find that and will extend bitbake if needed.

Quoted 10 lines

Yes, we need to find a better way. But many things are on todo for a long time in OE, without much moving ;-(. My recipes for building kernel with linked initramfs is a kind of sprint trying to solve one of such long-standing issues. The solution is of course is not perfect, but does work, and can be elaborated to either remove unneeded environment dependencies, or solved in completely different way. But in the meantime, it would be already usable where it is needed. So, I have alternative proposal - leaving them in OE, possibly move to angstrom-specific dir if its considered too Angstrom-specific.

Quoted 8 lines

Or we remove it and wait until something we're willing to maintain is developed. Working for some use cases is not a good reason to push this into OE. This is why we have the mess that is rm_work for example. I'm now left trying to figure out a way to integrate its behaviour into bitbake. Sure people complain about the ways it breaks, nobody steps up to help fix it though :(. I think we'll find a way to salvage rm_work. I don't think this case is salvageable and I don't even going to go there.

Yes, that's why I keep disagreeing that my recipes are just PoS - there're lots of things which can be treated the same way. But it's not the case that I add some random crap to OE. For example, that PKGPV stuff - I faced the need to "proxy" PV from one package to another soon after getting acquainted to OE, and suffered that need silently, as that was my adhoc stuff. I've been having need to use images built recursively for LiveRamdisks, but taking into account that it's pretty adhoc thing and can be outside of OE, never I bothered anyone.

Well, this one is different - again, it's about kernel building. Inability to build one of the upstream supported configurations is serious drawback. And not desire to accept a solution, even if its of workaround type, do tell something new about the matter.

Quoted 11 lines
Quoted 10 lines

My reason for working in this direction is purely pragmatic - since then HH.org LAB was given up as a price to be able to work closer with other kernel porting communities, there were no bootloader which would be able to boot kernel out of rootfs. That in turn means choring complexities for users while upgrading kernel. So, all this work is just to be able to boot using initramfs-shaped bootloaders, and thus purely practical, intended to go general availability tomorrow or so. obviously, removing recipes from OE would rather complicate my work.

Quoted 2 lines

So you're going to push something that core OE devs object to into widespread use and ignore our concerns? Thanks :(.

What else can I do? I want to help OE to lose its deficiencies and work towards that per my humble resources. But I "push" it only as specific, limited workaround, not for "widespread use" in any case.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I think the problem is you're effectively trying to end up with something where you "bitbake angstrom" and it produces a distribution,

Yes, isn't that what bitbake supposed to do?

Not with its current design, no.

That's where things are getting interesting. Because before it was. Someone may ask where did I get that idea from, and I can point to Angstrom autobuilder - it produces the whole distro in fully automated manner. It does have some workarounds to deal with multiple wide varying config, but only high-level ones.

But now if bitbake is not a distro tool, what it is? A limited-scope crutch for developer who is still left on its own with distro building due to accidental gaps in the tool's functionality? Maybe bitbake actually is not enough on its own to handle the task? And we should encourage, not discourage use of separate tools on top of it? Makefiles suddenly seem so attractive - I can easily put

bitbake initramfs-image
bitbake initramfs-kernel

there, if there're no place with bitbake where it can be put.

Well, I hope the picture is vivid enough - given 2 choices: add a limited-scope workaround to get the most basic thing work, or accept the fact that bitbake is deficient for the task of building distro, I prefer to go by run and length to avoid the 2nd choice.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

There
is always going to be some effort that comes from a user when directing bitbake what to do, be it setting the MACHINE, saying what image type you'd like or what kind of image you want. The problem you're addressing is one clearly where the user needs to provide some input.

Quoted 4 lines
Quoted 2 lines

Building kernel is where user needs to provide some input? Which one exactly?

Which flavour of rootfs to use (libc, image type, image contents)?

My recipes has parameters for that, but in specific case I build for, its distro matter.

Quoted 20 lines
Quoted 14 lines
Quoted 4 lines

Its ironic that you were arguing *against* my insistence of the automatic setting of the IMAGE_FSTYPES variable on a per machine basis ;-).

It's because we see this problem from orthogonal views. There're thousands of machines (yes, there're, the fact that OE lacks all them is not only due to fact that noone contributes them all, but also due to OE's lack of good paradigm to maintain them). So, carefully crafted hacks for one or another machine appear to be just random divergences looking from eagle's eye on entire machine set. So IMHO, machines should be maintained just like that - as a set.

Quoted 5 lines

Regarding this case, I would understand your concerns if I hacked this stuff on linux-hh level. But of course, I try to make it generic and potentially working for any kernel and config. Where it can't be right now, is not my fault, but something hopefully to fix, not to limit new developments by.

Quoted 7 lines

We have certain confines we have to live within. If we break these the foundations collapse. You're tunnelling through foundations and I'm not happy at all about it since the walls will fall in :(. I also don't think you realise the implications of what you're doing.

Just for the lists reference I've raised this with the core devs who I will discuss this with and then take any action agreed upon.

I have no issues with any such decision and action, but from my position, make a choice to not accept bitbake's deficiencies silently, even if I can't solve them properly.

Quoted 6 lines

Cheers,

Richard

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#11 lore raw
Quoted 9 lines · Paul Sokolovsky
Quoted 8 lines · On Fri, 15 Feb 2008 22:52:07 +0000 Richard Purdie <[email protected]> wrote:
Quoted 2 lines · Paul Sokolovsky

As for now, it seems that bitbake maintains flat task list, with the flat dependencies (run task before x and after y).

Eh? Bitbake does not maintain a "flat" task list.

Looking at what package_*.bbclass say:

Quoted 8 lines
Quoted 6 lines

addtask package_write_deb before do_package_write after do_package addtask package_write_ipk before do_package_write after do_package

So it says each package output task must run after do_package and before do_package_write. After the package_write completes, all packaging is done.

This imposes only linear ordering.

Its not linear. There is nothing that says which of write_deb or write_ipk has to run first. In practise both can run at the same time.

Quoted 4 lines
Quoted 2 lines

"So, by calling do_package_write task, one *is* assured that packages in whatever selected formats were written."

No, do_package_write is empty task, by "calling" it, one gets nothing.

When package_write has run, you are guaranteed that the packaging writeout for all enabled packaging methods is complete. Show me another sane way to do it...

Quoted 4 lines

To get packaging done, one would need to "call all tasks between do_package and do_package_write", for what there's of course no API, which is not guaranteed to not do other things, and where do_package and do_package_write are arbitrary anchors.

The infrastructure simply isn't designed to let you run packaging twice.

Quoted 5 lines

I keep discussion this, because the same approach - explicitly hierarchical tasks with ability to override execution environment for a task and all its subtasks would solve "recursion on the OS level" problem (by taking that recursion into bitbake level of course).

Well, you can do something like:

python my_second_packaging() {
	bb.data.setVar("PACKAGES", "kernel-image", d)
	bb.data.setVar("FILES_kernel-image", "/boot/*", d)
	bb.build.exec_func('package_do_package', d)
	bb.build.exec_func('do_package_ipk', d)
	bb.build.exec_func('do_package_deb', d)
}

So the "ability to override execution environment for a task and all its subtasks" exists. Yes, we're assuming which packaging classes are in force above but there are ways we could clean that up.

Sadly, this doesn't solve your problem though. I originally put "See my other mail." here but see below, I may right it or I may not...

Quoted 7 lines
Quoted 5 lines

So lets try and teach it. There are boundaries we can't cross though. Recursion is not and never will be supported. If you think it should be, please start sending patches to bitbake to make it safe. With the current bitbake manpower there are much more important things to do I'm afraid.

Well, I wish I had resources to submit patches everywhere, but I don't.

And we don't have the resources to support recursive bitbake.

Quoted 4 lines

That doesn't mean I don't want to help with showing bitbake deficiencies, and overcoming them, even in hacky way. So far, I didn't get specific hints why running bitbake recursively on OS level in the same dir may break.

I will give one simple potential problem - writes to the cache file. Do you have any idea when bitbake makes them? I happen to know it probably wouldn't break as it exists at the moment. Does this mean it won't in future, no. So this imposes constraints on the code and there are a load of issues that have not been considered. The bitbake devs have not even been asked are we prepared to do this.

The question is whether we should push forward and stick holes in the dyke until we run out of fingers or we should stop trying to hold the dyke up and knock it over at the same time...

This is why I'm so frustrated with what you're doing - it amounts to ploughing straight over everyone elses needs and dumping a great pile of problems onto others which by your own admission don't plan to fix.

Quoted 11 lines
Quoted 2 lines

Bitbake does not support recursion. Period. Full stop. No ifs, buts or otherwise. "Team bitbake" will not support such use.

It's easier for me here, not being "team bitbake" - I have a problem at hand, due to bitbake deficiency cannot solve it properly, so I devise a workaround which actually works (so far, tested under specific conditions, but can be extended/explicitly constrained to those conditions). It's up to "team bitbake" to treat it in some or another way - as a hint where bitbake is lacking to its "generic task executor" motto, as "no, no" and destroy, or as once and at all exception solving very basic task at hand, while something better coming up.

So this amounts to you wanting to force someone else to fix the problem. I'm actually playing right into your hands too by coming up with alternatives. Once you know this approach works you'll do it again too.

I want you to see this approach is *not* acceptable. The sad thing is I think I have an idea to solve your packaging problem too. I'm now not actually sure I want to explain it. I can tell you it is possible without recursive bitbake...

Quoted 2 lines

Why there're other option, for example for one and only one problematic case we can allow a workaround.

That depends on the workaround. In some cases yes but in this case it sets a precedent that is too dangerous.

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

So this is even angstrom specific and requires special setup? (it also implies multimachine which is not default)

Maybe it's time to make it default.

I'd argue for that for different reasons. Sadly multimachine isn't bug free though as I keep finding holes in its behaviour :(.

Unfortunately, in a development tool, there're usually multiple holes everywhere. Constraining that tool config to one configuration (the more powerful one) may be good choice to save effort.

With multimachine you can still use OE in "single machine" mode so in a way I agree on this. Its a discussion for another time/place though.

Quoted 10 lines
Quoted 8 lines

Or we remove it and wait until something we're willing to maintain is developed. Working for some use cases is not a good reason to push this into OE. This is why we have the mess that is rm_work for example. I'm now left trying to figure out a way to integrate its behaviour into bitbake. Sure people complain about the ways it breaks, nobody steps up to help fix it though :(. I think we'll find a way to salvage rm_work. I don't think this case is salvageable and I don't even going to go there.

Yes, that's why I keep disagreeing that my recipes are just PoS -

I have *not* said they're PoS. I have said we can't been seen to officially condone recursive bitbake.

Yes, I am also wary of changes to the core infrastructure. You are getting better at thinking them through and I'm pleased to see that but you still don't sometimes see the fallout from certain changes. No, I'm not perfect and I don't see it either all the time - this is why we have a review process for changes.

Quoted 4 lines

Well, this one is different - again, it's about kernel building. Inability to build one of the upstream supported configurations is serious drawback. And not desire to accept a solution, even if its of workaround type, do tell something new about the matter.

If I propose a new wonderful recipe which lets OE generate every deb package possible but requires root access to your machine and wipes out everything else on it, would you accept that such a recipe should be pushed into OE? There will always be solutions which are unacceptable.

Quoted 6 lines
Quoted 2 lines

So you're going to push something that core OE devs object to into widespread use and ignore our concerns? Thanks :(.

What else can I do? I want to help OE to lose its deficiencies and work towards that per my humble resources. But I "push" it only as specific, limited workaround, not for "widespread use" in any case.

You put it into the bugzilla and request that OE finds a better way to do it. You have left little time for review as it is and trying to force people to do thing is always a bad idea.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines

I think the problem is you're effectively trying to end up with something where you "bitbake angstrom" and it produces a distribution,

Yes, isn't that what bitbake supposed to do?

Quoted 7 lines
Quoted 1 line

Not with its current design, no.

That's where things are getting interesting. Because before it was. Someone may ask where did I get that idea from, and I can point to Angstrom autobuilder - it produces the whole distro in fully automated manner. It does have some workarounds to deal with multiple wide varying config, but only high-level ones.

and I can point to the poky autobuilder too. I actually understand this problem much more than you realise. Recursive bitbake isn't the way to solve it though.

A better way would be to allow a list of variables to set along with a list of targets so you could tell bitbake to run:

MACHINE=akita bitbake image-foo
MACHINE=spitz bitbake image-bar

in one command.

Once, you couldn't even do this without editing a config file, someone (me) added the functionality and fixed the bugs to allow it from the commandline to ease some of the pain in autobuilder scripts. Do I get any thanks for it, no, I get told its deficient and that I should spend my time fixing insane bugs because someone else doesn't have time for proper solutions.

Quoted 11 lines

But now if bitbake is not a distro tool, what it is? A limited-scope crutch for developer who is still left on its own with distro building due to accidental gaps in the tool's functionality? Maybe bitbake actually is not enough on its own to handle the task? And we should encourage, not discourage use of separate tools on top of it? Makefiles suddenly seem so attractive - I can easily put

bitbake initramfs-image
bitbake initramfs-kernel

there, if there're no place with bitbake where it can be put.

I said the current design does not allow this. I did not say bitbake will not support it, I'd take patches to allow this in some form. That form will not be recursive bitbake though (and doesn't need to be).

The plans for the bitbake client/server split also come into play here since there will be different ways you can "command" bitbake to run things.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Building kernel is where user needs to provide some input? Which one exactly?

Which flavour of rootfs to use (libc, image type, image contents)?

My recipes has parameters for that, but in specific case I build for, its distro matter.

and yet the recipe isn't even marked as distro specific...

Quoted 6 lines
Quoted 2 lines

Just for the lists reference I've raised this with the core devs who I will discuss this with and then take any action agreed upon.

I have no issues with any such decision and action, but from my position, make a choice to not accept bitbake's deficiencies silently, even if I can't solve them properly.

The core devs have agreed pretty unanimously the recipe should be removed since they share the concerns I've raised. If you want recursive bitbake recipes you need to convince both them and the bitbake devs who will have to maintain it that its a good idea. One problem case isn't going to be enough for that.

Do I personally take time out of my valuable free time to help you fix this properly? After the attitude you've shown, I think I could be forgiven for not doing so but we'll see.

Cheers,

Richard

#12 lore raw

Hello,

Quoted 14 lines · On Sun, 17 Feb 2008 11:28:16 +0000 Richard Purdie <[email protected]> wrote:
Quoted 13 lines · Paul Sokolovsky
Quoted 11 lines · On Fri, 15 Feb 2008 22:52:07 +0000 Richard Purdie <[email protected]> wrote:
Quoted 2 lines · Paul Sokolovsky

As for now, it seems that bitbake maintains flat task list, with the flat dependencies (run task before x and after y).

Eh? Bitbake does not maintain a "flat" task list.

Looking at what package_*.bbclass say:

addtask package_write_deb before do_package_write after do_package addtask package_write_ipk before do_package_write after do_package

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

So it says each package output task must run after do_package and before do_package_write. After the package_write completes, all packaging is done.

This imposes only linear ordering.

Its not linear. There is nothing that says which of write_deb or write_ipk has to run first. In practise both can run at the same time.

Well, yep, sharpening epithets, its "non-deterministically linear" ;-). Bitbake's job consists of applying constraints on task order, and so there appear "slots" which are linearly ordered, but within each slot, there're "parallel" tasks. If there's only 1 thread, it's just linear list.

What I'm trying to point, is that apparently bitbake flattens out job plan too early.

Quoted 2 lines

The infrastructure simply isn't designed to let you run packaging twice.

Yes, that's the issue.

Quoted 7 lines
python my_second_packaging() {
	bb.data.setVar("PACKAGES", "kernel-image", d)
	bb.data.setVar("FILES_kernel-image", "/boot/*", d)
	bb.build.exec_func('package_do_package', d)
	bb.build.exec_func('do_package_ipk', d)
	bb.build.exec_func('do_package_deb', d)
}

So, those 2 lines in my list are worse than recursive call, as recursion at least elegant (though can be too deathly, who disagrees).

[]

Quoted 3 lines

When package_write has run, you are guaranteed that the packaging writeout for all enabled packaging methods is complete. Show me another sane way to do it...

do_package is a task. There's new concept "subtask". do_package_ipk and do_package_deb are subtasks of it. Executing such a compound task means executing its subtasks. Full name of a task is <main_task>.<subtask>. In particular, timestamps use that, so there's

foo.package_do_package.do_package_ipk

and

foo.my_second_packaging.do_package_ipk

And I understand that maintaining proper (hierarchial) task plan vs executing it with parallelism are somewhat mutually exclusive in practice, as most tools do one or another ;-). Well, maintaining tree structuring to support such "imperative callouts" like above, but still optimize main plan for parallelism could be one option for the future of bitbake.

[]

Quoted 11 lines
python my_second_packaging() {
	bb.data.setVar("PACKAGES", "kernel-image", d)
	bb.data.setVar("FILES_kernel-image", "/boot/*", d)
	bb.build.exec_func('package_do_package', d)
	bb.build.exec_func('do_package_ipk', d)
	bb.build.exec_func('do_package_deb', d)
}

So the "ability to override execution environment for a task and all its subtasks" exists.

But not to the level of sub-executing some tasks for another machine for example, right?

[]

Quoted 6 lines
Quoted 4 lines

That doesn't mean I don't want to help with showing bitbake deficiencies, and overcoming them, even in hacky way. So far, I didn't get specific hints why running bitbake recursively on OS level in the same dir may break.

I will give one simple potential problem - writes to the cache file.

Well, that's why I proceed to spool my ANGSTROM_MODE CACHE override ;-). In my use there're even different caches ;-).

Quoted 6 lines

Do you have any idea when bitbake makes them? I happen to know it probably wouldn't break as it exists at the moment. Does this mean it won't in future, no. So this imposes constraints on the code and there are a load of issues that have not been considered. The bitbake devs have not even been asked are we prepared to do this.

Quoted 7 lines

The question is whether we should push forward and stick holes in the dyke until we run out of fingers or we should stop trying to hold the dyke up and knock it over at the same time...

This is why I'm so frustrated with what you're doing - it amounts to ploughing straight over everyone elses needs and dumping a great pile of problems onto others which by your own admission don't plan to fix.

Well, I do not impose anything on others. Again, those recipes do not touch any existing infrastructure and don't affect current usage in any way. That's why I bothered to commit it directly. Let's face it - noone would run to use them right away. Also, they are very pragmatic in its nature, destined to solve very long-standing issue, first of all for production distro in use by actual people who are restricted without that being solved, that's another reason why it was committed, as there's long cycle already from ideas on how to solve it, to actual delivery to users.

Quoted 14 lines
Quoted 4 lines
Quoted 3 lines

Bitbake does not support recursion. Period. Full stop. No ifs, buts or otherwise. "Team bitbake" will not support such use.

Quoted 9 lines

It's easier for me here, not being "team bitbake" - I have a problem at hand, due to bitbake deficiency cannot solve it properly, so I devise a workaround which actually works (so far, tested under specific conditions, but can be extended/explicitly constrained to those conditions). It's up to "team bitbake" to treat it in some or another way - as a hint where bitbake is lacking to its "generic task executor" motto, as "no, no" and destroy, or as once and at all exception solving very basic task at hand, while something better coming up.

Quoted 2 lines

So this amounts to you wanting to force someone else to fix the problem.

Nope, I'm just solving task at hand. But I'm at least trying to do that with generality approach, not as a completely non-reusable and dirty hack. Nor I pledge for it to be the good and correct, just practical.

Quoted 5 lines

I'm actually playing right into your hands too by coming up with alternatives. Once you know this approach works you'll do it again too.

I want you to see this approach is *not* acceptable.

No problem in the end! Of course, I'm pretty frustrated for having spent time blatantly hacking thru that to let people *build a distro*, not *execute bunch of weird commands by hand*, achieving that, and not being able to deliver that. I'm even more frustrated to face such glaringly bitbake limitations. I really hoped that everything [needed] can be done with it [already], and I can always come up to other folks and say: "Your build tool sucks! All you building belongs to us!" ;-)) Alas, that feeling is gone now ;-(

[]

Quoted 4 lines
Quoted 1 line

Yes, that's why I keep disagreeing that my recipes are just PoS -

I have *not* said they're PoS. I have said we can't been seen to officially condone recursive bitbake.

Please forgive my colloquial-speak, I use it to live up otherwise long technical discussions ;-).

Quoted 5 lines

Yes, I am also wary of changes to the core infrastructure. You are getting better at thinking them through and I'm pleased to see that but you still don't sometimes see the fallout from certain changes. No, I'm not perfect and I don't see it either all the time - this is why we have a review process for changes.

By all means you're right. And from my place, I enjoy my position which allows me to have own priorities and use such guerrilla tactics. For bitbake stuff. Because for other stuff I of course maintain strict positions too.

[]

Quoted 2 lines

You put it into the bugzilla and request that OE finds a better way to do it.

Well, I had pragmatic aim, and IMHO, such discussion is better than yet another ticker of meta nature hanging in bugtracker.

Quoted 2 lines

You have left little time for review as it is and trying to force people to do thing is always a bad idea.

It still can be though as a proof-of-concept, work-in-progress.

[]

Quoted 7 lines

A better way would be to allow a list of variables to set along with a list of targets so you could tell bitbake to run:

MACHINE=akita bitbake image-foo
MACHINE=spitz bitbake image-bar

in one command.

That still leaves question open how these 2 commands communicate with each other. There should be another entity above them which handles that. Recursion everywhere (and no, I don't mean recursive bitbake executable invocation!)

[]

Quoted 3 lines

I said the current design does not allow this. I did not say bitbake will not support it, I'd take patches to allow this in some form. That form will not be recursive bitbake though (and doesn't need to be).

If I promise patches, I will lie (only 1 head, only 24hrs/day). But I'm glad we can discuss that, and maybe you, from your side, will find that some of the functionality can be added not that hard (if I knew it can be, I'd go for that, but I don't even know, see above).

Quoted 3 lines

The plans for the bitbake client/server split also come into play here since there will be different ways you can "command" bitbake to run things.

Nice! Again, consider recursive invocation a poor man's emulation of this client/server approach ;-).

Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Building kernel is where user needs to provide some input? Which one exactly?

Which flavour of rootfs to use (libc, image type, image contents)?

My recipes has parameters for that, but in specific case I build for, its distro matter.

and yet the recipe isn't even marked as distro specific...

It's a bit less patch than removing it altogether ;-).

[]

Quoted 9 lines

The core devs have agreed pretty unanimously the recipe should be removed since they share the concerns I've raised. If you want recursive bitbake recipes you need to convince both them and the bitbake devs who will have to maintain it that its a good idea. One problem case isn't going to be enough for that.

Do I personally take time out of my valuable free time to help you fix this properly? After the attitude you've shown, I think I could be forgiven for not doing so but we'll see.

Thinking about that attitude ("We've been typing bunch of our commands manually for years, and now you tell that it's wrong? No, continuing typing bunch of commands is *the* proper way to handle that!") and progressing with the practical task of which this work was a subtask, I feel that for me it's indeed would be more practical to give up trying to add generic kernel+initramfs support building to OE and instead to workaround task at hand in different way. Because even ideas like above seem more like workarounds, more safer than my approach, but at the same time not as expressive enough to handle the real-world task at hand.

So, I'm leaving assessment of similarities between kernel and gcc-cross build to someone else. But let's just try and imagine that during "bitbake <something>" you'd get message like:

"Sorry, gcc building is too complex. We cannot do it for you automatically. Now type 'foo bar' to continue the build."

Is it just me or such picture indeed pretty funny? And yet people assuredly think that's how kernel should be built!

P.S.
Can't get off that productive thought - gcc is mentioned on purpose of course, as that gcc-cross vs gcc-cross-initial break is made to solve similar problem. But of course, there cannot be talk about splitting each of 100+ kernel recipes in 2, nor, for myself, there cannot be talk about doing that for one kernel leaving others behind.

But that recent template/generator .bb idea from Richard - of foo vs foo-native talk - can help here too. Once for each kernel .bb there's underlying <kernel> vs <kernel>-modules targets, all this issue is evaporated.

Quoted 5 lines

Cheers,

Richard

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#13 lore raw
In reply to Richard Purdie

Hello,

On Sun, 17 Feb 2008 11:28:16 +0000
Richard Purdie <[email protected]> wrote:

[]

Quoted 2 lines

The core devs have agreed pretty unanimously the recipe should be removed since they share the concerns I've raised.

initramfs-image-ipk_1.0.bb
kernel-initramfs_1.0.bb

are removed. I hope there're no concerns regarding tasks I've added to image.bbclass and kernel.bbclass - those are useful to allow integration with external tools.

[]

Quoted 5 lines

Cheers,

Richard

Signature · 2 lines
Best regards,
 Paul                          mailto:[email protected]
#14 lore raw
In reply to Richard Purdie

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Richard Purdie schreef:

| I'm actually going to go as far as proposing any recursive bitbake
| recipes are removed from OE.dev ASAP for the reasons I've mentioned
| above. We *need* to find a better way. I will try and help you find that
| and will extend bitbake if needed.

While I agree on what Paul is saying, I don't think having recursive bitbake is a good idea, and a recursive bitbake that assumes a sane distro even worse, so realistically I'll have to back up Richard with the removal policy.

regards,

Koen

- --
[email protected] will go go away in december 2007, please use [email protected] instead.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFHteSIMkyGM64RGpERAqfeAJ9J4tRGU50ISjuWLksNctZi5gt4IQCbBQyU sJLLn+fcLx/ujXln45T+23s=
=d5xx
-----END PGP SIGNATURE-----

#15 lore raw

Hello all,

Quoted 9 lines · Koen Kooi

Richard Purdie schreef:
| I'm actually going to go as far as proposing any recursive bitbake | recipes are removed from OE.dev ASAP for the reasons I've mentioned

While I agree on what Paul is saying, I don't think having recursive bitbake is a good idea, and a recursive bitbake that assumes a sane distro even worse, so realistically I'll have to back up Richard with the removal policy.

+1 for Richard's proposals (remove recursive recipies, and make the initramfs a two-step action).

(We are building kernels with initramfs in that manner now.)

Regards,

Signature · 1 line
Leon