Skip to contentSkip to conversation

kernel-devsrc: fix missing generated files from the packet

PATCH In review Li Zhou 2 participants 6 messages Feb 18, 2020 – Feb 25, 2020

lore
Share & tools
lore

Li Zhou

author
#0 lore raw

PATCH 1/1 kernel-devsrc: fix missing generated files from the packet

The file arch/arm/include/generated/asm/unistd-nr.h is needed by some external kernel module. Error occurs when building the module with the SDK.

Add arch/${ARCH}/include/generated dir and files under it to kernel-devsrc package to solve this issue.

---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +6 -0
index b6f2dbc..8621fe1 100644
@@ -108,6 +108,12 @@ do_install() {
 	fi
 
 	cp -a include $kerneldir/build/include
+
+	if [ -d arch/${ARCH}/include/generated ]; then
+	    mkdir -p $kerneldir/build/arch/${ARCH}/include
+	    cp -r arch/${ARCH}/include/generated $kerneldir/build/arch/${ARCH}/include
+	fi
+
     )
 
     # now grab the chunks from the source tree that we need
Signature · 1 line
1.9.1
#1 lore raw
Quoted 18 lines · Li Zhou

The file arch/arm/include/generated/asm/unistd-nr.h is needed by some external kernel module. Error occurs when building the module with the SDK.

Add arch/${ARCH}/include/generated dir and files under it to kernel-devsrc package to solve this issue.

---
 meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
 1 file changed, 6 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index b6f2dbc..8621fe1 100644

meta/recipes-kernel/linux/kernel-devsrc.bb do_install() { · line 115

Quoted 8 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +5 -0
@@ -108,6 +108,12 @@ do_install() {
        fi
 
        cp -a include $kerneldir/build/include
+
+       if [ -d arch/${ARCH}/include/generated ]; then
+           mkdir -p $kerneldir/build/arch/${ARCH}/include
+           cp -r arch/${ARCH}/include/generated $kerneldir/build/arch/${ARCH}/include
+       fi

This is just papering over the real problem.

Anything that is generated, should be regenerated when the headers are used/prepared.

What is missing and/or why isn't that happening with this ?

Bruce

Quoted 12 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
+
     )
 
     # now grab the chunks from the source tree that we need
--

1.9.1

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

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
author
#2 lore raw
Quoted 28 lines · Bruce Ashfield
Quoted 17 lines · Li Zhou

The file arch/arm/include/generated/asm/unistd-nr.h is needed by some external kernel module. Error occurs when building the module with the SDK.

Add arch/${ARCH}/include/generated dir and files under it to kernel-devsrc package to solve this issue.

---
  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
  1 file changed, 6 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index b6f2dbc..8621fe1 100644

meta/recipes-kernel/linux/kernel-devsrc.bb do_install() { · line 115

Quoted 8 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +5 -0
@@ -108,6 +108,12 @@ do_install() {
         fi
 
         cp -a include $kerneldir/build/include
+
+       if [ -d arch/${ARCH}/include/generated ]; then
+           mkdir -p $kerneldir/build/arch/${ARCH}/include
+           cp -r arch/${ARCH}/include/generated $kerneldir/build/arch/${ARCH}/include
+       fi

This is just papering over the real problem.

Quoted 6 lines

Anything that is generated, should be regenerated when the headers are used/prepared.

What is missing and/or why isn't that happening with this ?

Bruce

In some old version yocto, the file arch/arm/include/generated/asm/unistd-nr.h can be directly used from our sdk. So now it isn't permitted any more? And we should figure out how to generate it again when developing the external kernel modules? Thank you.

Quoted 15 lines
Quoted 13 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
+
      )
 
      # now grab the chunks from the source tree that we need
--

1.9.1

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

Signature · 3 lines
Best Regards!
Zhou Li
Phone number: 86-10-84778511
#3 lore raw
Quoted 34 lines · zhou li
Quoted 31 lines · Bruce Ashfield
Quoted 17 lines · Li Zhou

The file arch/arm/include/generated/asm/unistd-nr.h is needed by some external kernel module. Error occurs when building the module with the SDK.

Add arch/${ARCH}/include/generated dir and files under it to kernel-devsrc package to solve this issue.

---
  meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
  1 file changed, 6 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index b6f2dbc..8621fe1 100644

meta/recipes-kernel/linux/kernel-devsrc.bb do_install() { · line 115

Quoted 8 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +5 -0
@@ -108,6 +108,12 @@ do_install() {
         fi
 
         cp -a include $kerneldir/build/include
+
+       if [ -d arch/${ARCH}/include/generated ]; then
+           mkdir -p $kerneldir/build/arch/${ARCH}/include
+           cp -r arch/${ARCH}/include/generated $kerneldir/build/arch/${ARCH}/include
+       fi

This is just papering over the real problem.

Anything that is generated, should be regenerated when the headers are used/prepared.

Quoted 8 lines
Quoted 3 lines

What is missing and/or why isn't that happening with this ?

Bruce

In some old version yocto, the file arch/arm/include/generated/asm/unistd-nr.h can be directly used from our sdk. So now it isn't permitted any more? And we should figure out how to

Anything in the generated subdirectories of the kernel build should be regenerated when we do the make prepare/scripts/modules_prepare steps. If it isn't being regenerated, then we are missing something in devsrc that can regenerate them (either a step in the preparation, a Makefile, a script ..).

If we start pulling bits and pieces out of generated, we'll end up constantly having to take more and more, when the right thing (by the way our minimal devsrc is designed) is to have it regenerated.

It's valid to use it, but we shouldn't need to copy it if it can be generated. If it can't be generated, we should document why with a comment in the code and in the commit message of the change.

Bruce

Quoted 23 lines

generate it again when developing the external kernel modules? Thank you.

Quoted 8 lines
Quoted 8 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
+
      )
 
      # now grab the chunks from the source tree that we need
--

1.9.1

Quoted 7 lines
Quoted 5 lines

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

--
Best Regards!
Zhou Li
Phone number: 86-10-84778511

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
author
#4 lore raw
Quoted 47 lines · Bruce Ashfield
Quoted 33 lines · zhou li
Quoted 31 lines · Bruce Ashfield
Quoted 17 lines · Li Zhou

The file arch/arm/include/generated/asm/unistd-nr.h is needed by some external kernel module. Error occurs when building the module with the SDK.

Add arch/${ARCH}/include/generated dir and files under it to kernel-devsrc package to solve this issue.

---
   meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
   1 file changed, 6 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index b6f2dbc..8621fe1 100644

meta/recipes-kernel/linux/kernel-devsrc.bb do_install() { · line 115

Quoted 8 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +5 -0
@@ -108,6 +108,12 @@ do_install() {
          fi
 
          cp -a include $kerneldir/build/include
+
+       if [ -d arch/${ARCH}/include/generated ]; then
+           mkdir -p $kerneldir/build/arch/${ARCH}/include
+           cp -r arch/${ARCH}/include/generated $kerneldir/build/arch/${ARCH}/include
+       fi

This is just papering over the real problem.

Anything that is generated, should be regenerated when the headers are used/prepared.

Quoted 7 lines
Quoted 3 lines

What is missing and/or why isn't that happening with this ?

Bruce

In some old version yocto, the file arch/arm/include/generated/asm/unistd-nr.h can be directly used from our sdk. So now it isn't permitted any more? And we should figure out how to

Anything in the generated subdirectories of the kernel build should be regenerated when we do the make prepare/scripts/modules_prepare steps. If it isn't being regenerated, then we are missing something in devsrc that can regenerate them (either a step in the preparation, a Makefile, a script ..).

Quoted 7 lines

If we start pulling bits and pieces out of generated, we'll end up constantly having to take more and more, when the right thing (by the way our minimal devsrc is designed) is to have it regenerated.

It's valid to use it, but we shouldn't need to copy it if it can be generated. If it can't be generated, we should document why with a comment in the code and in the commit message of the change.

Hi, Bruce:

       Thank you for your reply. I try and find that <make archprepare> can generate the header file mentioned.

Then do you mean that the user should run <make archprepare> to generate the header files needed first, and then make their own code using those header files?

Thanks a lot.

Quoted 26 lines

Bruce

Quoted 21 lines

generate it again when developing the external kernel modules? Thank you.

Quoted 7 lines
Quoted 7 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
+
       )
 
       # now grab the chunks from the source tree that we need
--

1.9.1

Quoted 6 lines
Quoted 5 lines

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

--
Best Regards!
Zhou Li
Phone number: 86-10-84778511

Signature · 3 lines
Best Regards!
Zhou Li
Phone number: 86-10-84778511
#5 lore raw
Quoted 59 lines · zhou li
Quoted 47 lines · Bruce Ashfield
Quoted 33 lines · zhou li
Quoted 31 lines · Bruce Ashfield
Quoted 17 lines · Li Zhou

The file arch/arm/include/generated/asm/unistd-nr.h is needed by some external kernel module. Error occurs when building the module with the SDK.

Add arch/${ARCH}/include/generated dir and files under it to kernel-devsrc package to solve this issue.

---
   meta/recipes-kernel/linux/kernel-devsrc.bb | 6 ++++++
   1 file changed, 6 insertions(+)
meta/recipes-kernel/linux/kernel-devsrc.bb +0 -0
index b6f2dbc..8621fe1 100644

meta/recipes-kernel/linux/kernel-devsrc.bb do_install() { · line 115

Quoted 8 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +5 -0
@@ -108,6 +108,12 @@ do_install() {
          fi
 
          cp -a include $kerneldir/build/include
+
+       if [ -d arch/${ARCH}/include/generated ]; then
+           mkdir -p $kerneldir/build/arch/${ARCH}/include
+           cp -r arch/${ARCH}/include/generated $kerneldir/build/arch/${ARCH}/include
+       fi

This is just papering over the real problem.

Anything that is generated, should be regenerated when the headers are used/prepared.

Quoted 7 lines
Quoted 3 lines

What is missing and/or why isn't that happening with this ?

Bruce

In some old version yocto, the file arch/arm/include/generated/asm/unistd-nr.h can be directly used from our sdk. So now it isn't permitted any more? And we should figure out how to

Anything in the generated subdirectories of the kernel build should be regenerated when we do the make prepare/scripts/modules_prepare steps. If it isn't being regenerated, then we are missing something in devsrc that can regenerate them (either a step in the preparation, a Makefile, a script ..).

Quoted 7 lines

If we start pulling bits and pieces out of generated, we'll end up constantly having to take more and more, when the right thing (by the way our minimal devsrc is designed) is to have it regenerated.

It's valid to use it, but we shouldn't need to copy it if it can be generated. If it can't be generated, we should document why with a comment in the code and in the commit message of the change.

Quoted 8 lines

Hi, Bruce:

Thank you for your reply. I try and find that <make archprepare>
can generate the header file mentioned.

Then do you mean that the user should run <make archprepare> to generate the header files needed first, and then make their own code using those header files?

Yes. That's the model that we follow with devsrc, if it can be generated, it should be. It keeps the source as small as possible, prevents people from patching transient files and guarantees we'll never get the packaged and development environment files out of sync.

If "make modules_prepare" or "make scripts prepare" isn't automatically triggering archprepare, then we should make sure it is documented.

Cheers,

Bruce

Quoted 35 lines

Thanks a lot.

Quoted 26 lines

Bruce

Quoted 21 lines

generate it again when developing the external kernel modules? Thank you.

Quoted 7 lines
Quoted 7 lines
meta/recipes-kernel/linux/kernel-devsrc.bb +1 -1
+
       )
 
       # now grab the chunks from the source tree that we need
--

1.9.1

Quoted 6 lines
Quoted 5 lines

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

--
Best Regards!
Zhou Li
Phone number: 86-10-84778511

--
Best Regards!
Zhou Li
Phone number: 86-10-84778511

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II