Skip to contentSkip to conversation

Kernel image stagging [was Re: [PATCH] kernel.bbclass: Stage the raw zImage and modules tarball for inclusion in pstage

DISCUSSION Otavio Salvador 2 participants 6 messages Feb 23, 2010

lore
Share & tools
lore
#0 lore raw

Hello Chris and others,

Your patch looks fine however this has made me thing another issue.

For me, it looks like the image ought to have be grabed from the package, at image building time, not at kernel package building time.

This solves a problem when we remove the image deploy dir and then need to rebuild the kernel package to get the image there again.

Do you think it makes sense?

Signature · 3 lines
Otavio Salvador                  O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br
#1 lore raw
Quoted 11 lines · Otavio Salvador

Hello Chris and others,

Your patch looks fine however this has made me thing another issue.

For me, it looks like the image ought to have be grabed from the package, at image building time, not at kernel package building time.

This solves a problem when we remove the image deploy dir and then need to rebuild the kernel package to get the image there again.

Do you think it makes sense?

I should note that Chris didn't notice that I had already just pushed this upstream. And this neatly dovetails into a conversation I was having with Chris anyhow (about another change we have that doesn't make sense anymore). There's two cases for how the kernel image is used:
- On the target, ${feed install} kernel-image, write to flash, whatever.
- On the host, user loads image to target, writes to flash in bootloader.

In the second case, why do I want to waste space with an image on the rootfs that I don't need? Today, that image goes from deploy dir to <however we give stuff to the end user> or right to the device. I could see, however, adding images to a defined place in meta-toolchain so that this isn't an issue anymore and we could stop putting raw kernel stuff into the deploy directory.

Signature · 2 lines
Tom Rini <[email protected]>
Mentor Graphics Corporation
#2 lore raw

Hello,

Quoted 7 lines · Tom Rini

In the second case, why do I want to waste space with an image on the
rootfs that I don't need? Today, that image goes from deploy dir to <however we give stuff to the end user> or right to the device. I could see, however, adding images to a defined place in meta-toolchain so that this isn't an issue anymore and we could stop putting raw kernel stuff into the deploy directory.

I think that a binary fine, copied from the built package, in deploy dir is wrong by conception. It ought to be puted there as an image, if it is needed by an image. We could have a class to make it easy, but IMO it ought to be done at same time the rootfs is built so it uses the same kernel for modules (that are included into the rootfs) and the binary.

Signature · 3 lines
Otavio Salvador                  O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br
#3 lore raw
Quoted 12 lines · Otavio Salvador

Hello,

Quoted 7 lines · Tom Rini

In the second case, why do I want to waste space with an image on the
rootfs that I don't need? Today, that image goes from deploy dir to <however we give stuff to the end user> or right to the device. I could see, however, adding images to a defined place in meta-toolchain so that this isn't an issue anymore and we could stop putting raw kernel stuff into the deploy directory.

Quoted 3 lines

I think that a binary fine, copied from the built package, in deploy dir is wrong by conception. It ought to be puted there as an image, if it is needed by an image.

What do you mean by an image? a uImage is an image. Sure, there's a corner case where you put a raw vmlinux into flash but... But what I'm saying is that you need a kernel ready for use somewhere. I could live with it coming out of meta-toolchain, but that's ugly.

As a use case, I configure for beagleboard. I bitbake console-image. I stick console-image.tar.bz2 onto partition 2 of my SD card. I grab my kernel from where? and stick it onto partition 1 so that I can put it into the beagleboard and mmc init;run loaduimage;run mmcboot.

Signature · 2 lines
Tom Rini <[email protected]>
Mentor Graphics Corporation
#4 lore raw

Hello,

Quoted 5 lines · Tom Rini

As a use case, I configure for beagleboard. I bitbake console-image. I stick console-image.tar.bz2 onto partition 2 of my SD card. I grab my kernel from where? and stick it onto partition 1 so that I can put it into the beagleboard and mmc init;run loaduimage;run mmcboot.

I see your point and I'm not saying we shouldn't have the kernel available somewhere. We need it somewhere.

However I disable when it is copied to deploy; in my opinion it ought to be done at rootfs creation so it will _always_ have a {z,bz,u}Image available in deploy dir.

Just try:

bitbake console-image (works)
rm $DEPLOY_DIR
bitbake console-image (fails)

and this is wrong IMO.

Signature · 3 lines
Otavio Salvador                  O.S. Systems
E-mail: [email protected]  http://www.ossystems.com.br
Mobile: +55 53 9981-7854         http://projetos.ossystems.com.br
#5 lore raw
Quoted 17 lines · Otavio Salvador

Hello,

Quoted 5 lines · Tom Rini

As a use case, I configure for beagleboard. I bitbake console-image. I stick console-image.tar.bz2 onto partition 2 of my SD card. I grab my kernel from where? and stick it onto partition 1 so that I can put it into the beagleboard and mmc init;run loaduimage;run mmcboot.

I see your point and I'm not saying we shouldn't have the kernel available somewhere. We need it somewhere.

However I disable when it is copied to deploy; in my opinion it ought to be done at rootfs creation so it will _always_ have a {z,bz,u}Image available in deploy dir.

Quoted 7 lines

Just try:

bitbake console-image (works)
rm $DEPLOY_DIR
bitbake console-image (fails)

and this is wrong IMO.

No, it works today since I was bad (and forgot the policy about getting acks) and just fixed it. That said, I'll admit I'm not 100% sure that everything is correct in other cases. We've caught the uImage case, but I'm thinking device trees are probably broken. So, a PoC patch to get image.bbclass to do something sane to DEPLOY_DIR would be fine with me, if I don't get to it first ;)

Signature · 2 lines
Tom Rini <[email protected]>
Mentor Graphics Corporation