Skip to contentSkip to conversation

History and intentions of linux.inc ?

DISCUSSION Darren Hart 4 participants 5 messages Feb 8, 2011 – Feb 9, 2011

lore
Share & tools
lore
#0 lore raw

I've stumbled over a couple of interesting bits in the existing recipes-kernel/linux/linux.inc, for example (but not limited to):

Quoted 4 lines
do_install_prepend() {
        if test -e arch/${ARCH}/boot/Image ; then
             ln -f arch/${ARCH}/boot/Image arch/${ARCH}/boot/uImage
        fi

On a recent kernel, the above will overwrite a valid uImage with Image, resulting in a non-bootable set of files in deploy/images.

Quoted 4 lines
        if test -e arch/${ARCH}/boot/images/uImage ; then
             ln -f arch/${ARCH}/boot/images/uImage arch/${ARCH}/boot/uImage
        fi

The arch/arm/boot/images directory does not exist on a current kernel (2.6.35-linaro anyway).

Does anyone know the historical significance and/or intent of this code? Are there architectures for which this does something sane? After reading through linux.inc, I'm inclined to avoid using it for the meta-linaro kernel, and then going after it with chainsaw.

Anyone have anything to add before I start cutting?

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#1 lore raw
Quoted 20 lines · Darren Hart

I've stumbled over a couple of interesting bits in the existing recipes-kernel/linux/linux.inc, for example (but not limited to):

Quoted 4 lines
do_install_prepend() {
         if test -e arch/${ARCH}/boot/Image ; then
              ln -f arch/${ARCH}/boot/Image arch/${ARCH}/boot/uImage
         fi

On a recent kernel, the above will overwrite a valid uImage with Image, resulting in a non-bootable set of files in deploy/images.

Quoted 4 lines
         if test -e arch/${ARCH}/boot/images/uImage ; then
              ln -f arch/${ARCH}/boot/images/uImage arch/${ARCH}/boot/uImage
         fi

The arch/arm/boot/images directory does not exist on a current kernel (2.6.35-linaro anyway).

Quoted 7 lines

Does anyone know the historical significance and/or intent of this code? Are there architectures for which this does something sane? After reading through linux.inc, I'm inclined to avoid using it for the meta-linaro kernel, and then going after it with chainsaw.

Anyone have anything to add before I start cutting?

I also found the same odd behaviour. My [simple] solution was to use my own linux.inc, much like there is a linux-yocto.inc, which totally removes do_install_prepend()

I'm sure this is safe to do in the mainline meta/recipes-kernel; as I said the yocto kernel already has done away with the whole file.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#3 lore raw
In reply to Darren Hart
Quoted 20 lines · Darren Hart

I've stumbled over a couple of interesting bits in the existing recipes-kernel/linux/linux.inc, for example (but not limited to):

Quoted 4 lines
do_install_prepend() {
         if test -e arch/${ARCH}/boot/Image ; then
              ln -f arch/${ARCH}/boot/Image arch/${ARCH}/boot/uImage
         fi

On a recent kernel, the above will overwrite a valid uImage with Image, resulting in a non-bootable set of files in deploy/images.

Quoted 4 lines
         if test -e arch/${ARCH}/boot/images/uImage ; then
              ln -f arch/${ARCH}/boot/images/uImage arch/${ARCH}/boot/uImage
         fi

The arch/arm/boot/images directory does not exist on a current kernel (2.6.35-linaro anyway).

Quoted 6 lines

Does anyone know the historical significance and/or intent of this code? Are there architectures for which this does something sane? After reading through linux.inc, I'm inclined to avoid using it for the meta-linaro kernel, and then going after it with chainsaw.

Anyone have anything to add before I start cutting?

This really sounds like older stuff that's not relevant anymore. That second example for example makes sense to me but only in the scope of some old arch/ppc stuff.

Signature · 2 lines
Tom Rini
Mentor Graphics Corporation
#2 lore raw
In reply to Gary Thomas
Quoted 29 lines · Gary Thomas
Quoted 20 lines · Darren Hart

I've stumbled over a couple of interesting bits in the existing recipes-kernel/linux/linux.inc, for example (but not limited to):

Quoted 4 lines

do_install_prepend() {
if test -e arch/${ARCH}/boot/Image ; then
ln -f arch/${ARCH}/boot/Image arch/${ARCH}/boot/uImage fi

On a recent kernel, the above will overwrite a valid uImage with Image, resulting in a non-bootable set of files in deploy/images.

Quoted 4 lines

if test -e arch/${ARCH}/boot/images/uImage ; then
ln -f arch/${ARCH}/boot/images/uImage arch/${ARCH}/boot/uImage fi

The arch/arm/boot/images directory does not exist on a current kernel (2.6.35-linaro anyway).

Quoted 7 lines

Does anyone know the historical significance and/or intent of this code? Are there architectures for which this does something sane? After reading through linux.inc, I'm inclined to avoid using it for the meta-linaro kernel, and then going after it with chainsaw.

Anyone have anything to add before I start cutting?

Quoted 8 lines

I also found the same odd behaviour. My [simple] solution was to use my own linux.inc, much like there is a linux-yocto.inc, which totally removes do_install_prepend()

I'm sure this is safe to do in the mainline meta/recipes-kernel; as I said the yocto kernel already has done away with the whole file.

Right, which was prompting me to start looking into whether or not linux.inc should continue to exist in it's current form.

Signature · 3 lines
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
#4 lore raw
In reply to Darren Hart
Quoted 20 lines · Darren Hart

I've stumbled over a couple of interesting bits in the existing recipes-kernel/linux/linux.inc, for example (but not limited to):

Quoted 4 lines

do_install_prepend() {
        if test -e arch/${ARCH}/boot/Image ; then
             ln -f arch/${ARCH}/boot/Image arch/${ARCH}/boot/uImage fi

On a recent kernel, the above will overwrite a valid uImage with Image, resulting in a non-bootable set of files in deploy/images.

Quoted 4 lines

        if test -e arch/${ARCH}/boot/images/uImage ; then
             ln -f arch/${ARCH}/boot/images/uImage arch/${ARCH}/boot/uImage fi

The arch/arm/boot/images directory does not exist on a current kernel (2.6.35-linaro anyway).

Quoted 6 lines

Does anyone know the historical significance and/or intent of this code? Are there architectures for which this does something sane? After reading through linux.inc, I'm inclined to avoid using it for the meta-linaro kernel, and then going after it with chainsaw.

Anyone have anything to add before I start cutting?

You already know my opinion (since as Gary pointed out, I side stepped much of what's in there), but I'll throw a word in here as well.

Although I don't know all the history, you can see how the code was needed at different points, but as we move forward it isn't used in the same way, and can definitely use some spring cleaning.

I'm factoring out the dtb code (it's good) into something that can be included from multiple places, but there are parts of linux.inc that look like they can be tossed since they modify things like the kernel config in ways that aren't always appropriate.

The base kernel class also has good that can use some cleaning (the uImage, etc) and we'll tackle that in good time as well.

Cheers,

Bruce

Quoted 10 lines

--
Darren Hart
Intel Open Source Technology Center
Yocto Project - Linux Kernel
_______________________________________________
poky mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/poky

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end"