Patchwork [3/4] kernel: Add kernel-headers package for target module build

login
register
mail settings
Submitter Darren Hart
Date June 29, 2012, 4:18 a.m.
Message ID <5b45f71fee3c593e5420a5a9b36ba947c429a397.1340942930.git.dvhart@linux.intel.com>
Download mbox | patch
Permalink /patch/30863/
State New
Headers show

Comments

Darren Hart - June 29, 2012, 4:18 a.m.
[YOCTO #1614]

Add a kernel-headers package to kernel.bbclass. This packages
effectively packages what was already built and kept in sysroots for
building modules with bitbake. Making this available on the target
requires removing some additional host binaries.

Move the location to /usr/src/kernel-headers.

Before use on the target, the user will need to:

    # cd /usr/src/kernel-headers
    # make scripts

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
CC: Bruce Ashfield <bruce.ashfield@windriver.com>
CC: Tom Zanussi <tom.zanussi@intel.com>
CC: Khem Raj <raj.khem@gmail.com>
---
 meta/classes/kernel.bbclass |   11 +++++++----
 meta/conf/bitbake.conf      |    2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)
Khem Raj - June 29, 2012, 4:52 a.m.
On Thu, Jun 28, 2012 at 9:18 PM, Darren Hart <dvhart@linux.intel.com> wrote:
> [YOCTO #1614]
>
> Add a kernel-headers package to kernel.bbclass. This packages
> effectively packages what was already built and kept in sysroots for
> building modules with bitbake. Making this available on the target
> requires removing some additional host binaries.
>
> Move the location to /usr/src/kernel-headers.
>
> Before use on the target, the user will need to:
>
>    # cd /usr/src/kernel-headers
>    # make scripts
>

IMO using kernel-headers may not be representing the package contents
correctly since I believe it contains more than headers. Its probably
kernel-dev or external-lkm-dev or somesuch.

> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> CC: Bruce Ashfield <bruce.ashfield@windriver.com>
> CC: Tom Zanussi <tom.zanussi@intel.com>
> CC: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/classes/kernel.bbclass |   11 +++++++----
>  meta/conf/bitbake.conf      |    2 +-
>  2 files changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 31e633b..b82af74 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -130,7 +130,7 @@ kernel_do_install() {
>        # Support for external module building - create a minimal copy of the
>        # kernel source tree.
>        #
> -       kerneldir=${D}/kernel
> +       kerneldir=${D}/usr/src/kernel-headers
>        install -d $kerneldir
>
>        #
> @@ -183,10 +183,11 @@ kernel_do_install() {
>                cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
>        fi
>
> -       # Remove the following binaries which cause strip errors
> +       # Remove the following binaries which cause strip or arch QA errors
>        # during do_package for cross-compiled platforms
>        bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
> -                  arch/powerpc/boot/mktree"
> +                  arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
> +                  scripts/kconfig/conf.o"
>        for entry in $bin_files; do
>                rm -f $kerneldir/$entry
>        done
> @@ -247,13 +248,15 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
>
>  # kernel-base becomes kernel-${KERNEL_VERSION}
>  # kernel-image becomes kernel-image-${KERNEL_VERISON}
> -PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
> +            kernel-misc kernel-headers"
>  FILES = ""
>  FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>  FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>  FILES_kernel-vmlinux = "/boot/vmlinux*"
>  # misc is a package to contain files we need in staging
>  FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
> +FILES_kernel-headers = "/usr/src/kernel-headers"
>  RDEPENDS_kernel = "kernel-base"
>  # Allow machines to override this dependency if kernel image files are
>  # not wanted in images as standard
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 9b26580..9f3abee 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -380,7 +380,7 @@ SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
>  ##################################################################
>
>  OLDEST_KERNEL = "2.6.16"
> -STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel"
> +STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/usr/src/kernel-headers"
>
>  ##################################################################
>  # Specific image creation and rootfs population info.
> --
> 1.7.10.2
>
Darren Hart - June 29, 2012, 5:50 a.m.
On 06/28/2012 09:52 PM, Khem Raj wrote:
> On Thu, Jun 28, 2012 at 9:18 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>> [YOCTO #1614]
>>
>> Add a kernel-headers package to kernel.bbclass. This packages
>> effectively packages what was already built and kept in sysroots for
>> building modules with bitbake. Making this available on the target
>> requires removing some additional host binaries.
>>
>> Move the location to /usr/src/kernel-headers.
>>
>> Before use on the target, the user will need to:
>>
>>    # cd /usr/src/kernel-headers
>>    # make scripts
>>
> 
> IMO using kernel-headers may not be representing the package contents
> correctly since I believe it contains more than headers. Its probably
> kernel-dev or external-lkm-dev or somesuch.

I modeled the name after ubuntu which uses the name "linux-headers".
Fedora calls it "kernel-devel". I chose the prefix "kernel" as that is
what all the rest of the packages start with and I chose "headers" as I
am most familiar with the Debian world (he says from his FC17 laptop...).

However, I don't have a strong opinion here, I'll happily call it
kernel-devel if that is strongly preferred by some.

--
Darren

> 
>> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
>> CC: Bruce Ashfield <bruce.ashfield@windriver.com>
>> CC: Tom Zanussi <tom.zanussi@intel.com>
>> CC: Khem Raj <raj.khem@gmail.com>
>> ---
>>  meta/classes/kernel.bbclass |   11 +++++++----
>>  meta/conf/bitbake.conf      |    2 +-
>>  2 files changed, 8 insertions(+), 5 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index 31e633b..b82af74 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -130,7 +130,7 @@ kernel_do_install() {
>>        # Support for external module building - create a minimal copy of the
>>        # kernel source tree.
>>        #
>> -       kerneldir=${D}/kernel
>> +       kerneldir=${D}/usr/src/kernel-headers
>>        install -d $kerneldir
>>
>>        #
>> @@ -183,10 +183,11 @@ kernel_do_install() {
>>                cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
>>        fi
>>
>> -       # Remove the following binaries which cause strip errors
>> +       # Remove the following binaries which cause strip or arch QA errors
>>        # during do_package for cross-compiled platforms
>>        bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
>> -                  arch/powerpc/boot/mktree"
>> +                  arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
>> +                  scripts/kconfig/conf.o"
>>        for entry in $bin_files; do
>>                rm -f $kerneldir/$entry
>>        done
>> @@ -247,13 +248,15 @@ EXPORT_FUNCTIONS do_compile do_install do_configure
>>
>>  # kernel-base becomes kernel-${KERNEL_VERSION}
>>  # kernel-image becomes kernel-image-${KERNEL_VERISON}
>> -PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
>> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
>> +            kernel-misc kernel-headers"
>>  FILES = ""
>>  FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>  FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>>  FILES_kernel-vmlinux = "/boot/vmlinux*"
>>  # misc is a package to contain files we need in staging
>>  FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
>> +FILES_kernel-headers = "/usr/src/kernel-headers"
>>  RDEPENDS_kernel = "kernel-base"
>>  # Allow machines to override this dependency if kernel image files are
>>  # not wanted in images as standard
>> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
>> index 9b26580..9f3abee 100644
>> --- a/meta/conf/bitbake.conf
>> +++ b/meta/conf/bitbake.conf
>> @@ -380,7 +380,7 @@ SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
>>  ##################################################################
>>
>>  OLDEST_KERNEL = "2.6.16"
>> -STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel"
>> +STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/usr/src/kernel-headers"
>>
>>  ##################################################################
>>  # Specific image creation and rootfs population info.
>> --
>> 1.7.10.2
>>
Khem Raj - June 29, 2012, 6:04 a.m.
On Thu, Jun 28, 2012 at 10:50 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>
> However, I don't have a strong opinion here, I'll happily call it
> kernel-devel if that is strongly preferred by some.

in oe terminology it will be -dev
Darren Hart - June 29, 2012, 6:14 a.m.
On 06/28/2012 11:04 PM, Khem Raj wrote:
> On Thu, Jun 28, 2012 at 10:50 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>>
>> However, I don't have a strong opinion here, I'll happily call it
>> kernel-devel if that is strongly preferred by some.
> 
> in oe terminology it will be -dev

THe other reason I didn't go that route is that we already have a
kernel-dev (although I don't much like the way it is used):

From kernel.bbclass:

PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
            kernel-misc kernel-headers"
FILES = ""
FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
FILES_kernel-vmlinux = "/boot/vmlinux*"
# misc is a package to contain files we need in staging
FILES_kernel-misc = "/kernel/include/config /kernel/scripts
/kernel/drivers/crypto /kernel/drivers/media"
FILES_kernel-headers = "/usr/src/kernel-headers"

And looking at that it appears I broke kernel-misc by moving things to
/usr/src (didn't notice that in my testing).

How would you propose we redefine the above in order to use "kernel-dev"
for the new package?
Khem Raj - June 29, 2012, 7:22 a.m.
On Thu, Jun 28, 2012 at 11:14 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>
>
> On 06/28/2012 11:04 PM, Khem Raj wrote:
>> On Thu, Jun 28, 2012 at 10:50 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>>>
>>> However, I don't have a strong opinion here, I'll happily call it
>>> kernel-devel if that is strongly preferred by some.
>>
>> in oe terminology it will be -dev
>
> THe other reason I didn't go that route is that we already have a
> kernel-dev (although I don't much like the way it is used):
>
> From kernel.bbclass:
>
> PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
>            kernel-misc kernel-headers"
> FILES = ""
> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
> FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
> FILES_kernel-vmlinux = "/boot/vmlinux*"
> # misc is a package to contain files we need in staging
> FILES_kernel-misc = "/kernel/include/config /kernel/scripts
> /kernel/drivers/crypto /kernel/drivers/media"
> FILES_kernel-headers = "/usr/src/kernel-headers"
>
> And looking at that it appears I broke kernel-misc by moving things to
> /usr/src (didn't notice that in my testing).
>
> How would you propose we redefine the above in order to use "kernel-dev"
> for the new package?

hmmm interesting so I guess, linux-dev being already taken, you might
call it linux-kernel-headers as you were doing. So we have
linux-libc-headers and linux-kernel-headers to differentiate between
raw and sanitized headers

>
> --
> Darren Hart
> Intel Open Source Technology Center
> Yocto Project - Linux Kernel
>
>
Bruce Ashfield - June 29, 2012, 1:15 p.m.
On 12-06-29 03:22 AM, Khem Raj wrote:
> On Thu, Jun 28, 2012 at 11:14 PM, Darren Hart<dvhart@linux.intel.com>  wrote:
>>
>>
>> On 06/28/2012 11:04 PM, Khem Raj wrote:
>>> On Thu, Jun 28, 2012 at 10:50 PM, Darren Hart<dvhart@linux.intel.com>  wrote:
>>>>
>>>> However, I don't have a strong opinion here, I'll happily call it
>>>> kernel-devel if that is strongly preferred by some.
>>>
>>> in oe terminology it will be -dev
>>
>> THe other reason I didn't go that route is that we already have a
>> kernel-dev (although I don't much like the way it is used):
>>
>>  From kernel.bbclass:
>>
>> PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
>>             kernel-misc kernel-headers"
>> FILES = ""
>> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>> FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>> FILES_kernel-vmlinux = "/boot/vmlinux*"
>> # misc is a package to contain files we need in staging
>> FILES_kernel-misc = "/kernel/include/config /kernel/scripts
>> /kernel/drivers/crypto /kernel/drivers/media"
>> FILES_kernel-headers = "/usr/src/kernel-headers"
>>
>> And looking at that it appears I broke kernel-misc by moving things to
>> /usr/src (didn't notice that in my testing).
>>
>> How would you propose we redefine the above in order to use "kernel-dev"
>> for the new package?
>
> hmmm interesting so I guess, linux-dev being already taken, you might
> call it linux-kernel-headers as you were doing. So we have
> linux-libc-headers and linux-kernel-headers to differentiate between
> raw and sanitized headers

What would break if the new files were simply added to the existing 
kernel-dev
package ? I'm already putting System.map and others on targets in
different environments for dev/debug, so would adding enough to build
kernel modules on the target be a big problem ?

But I probably just don't understand *what* the existing -dev package
is used for, and my comment makes no sense :)

Outside of that, I also like linux-kernel-headers as the package name.

Cheers,

Bruce

>
>>
>> --
>> Darren Hart
>> Intel Open Source Technology Center
>> Yocto Project - Linux Kernel
>>
>>
Darren Hart - June 29, 2012, 1:36 p.m.
On 06/29/2012 06:15 AM, Bruce Ashfield wrote:
> On 12-06-29 03:22 AM, Khem Raj wrote:
>> On Thu, Jun 28, 2012 at 11:14 PM, Darren Hart<dvhart@linux.intel.com>  wrote:
>>>
>>>
>>> On 06/28/2012 11:04 PM, Khem Raj wrote:
>>>> On Thu, Jun 28, 2012 at 10:50 PM, Darren Hart<dvhart@linux.intel.com>  wrote:
>>>>>
>>>>> However, I don't have a strong opinion here, I'll happily call it
>>>>> kernel-devel if that is strongly preferred by some.
>>>>
>>>> in oe terminology it will be -dev
>>>
>>> THe other reason I didn't go that route is that we already have a
>>> kernel-dev (although I don't much like the way it is used):
>>>
>>>  From kernel.bbclass:
>>>
>>> PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
>>>             kernel-misc kernel-headers"
>>> FILES = ""
>>> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>> FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>>> FILES_kernel-vmlinux = "/boot/vmlinux*"
>>> # misc is a package to contain files we need in staging
>>> FILES_kernel-misc = "/kernel/include/config /kernel/scripts
>>> /kernel/drivers/crypto /kernel/drivers/media"
>>> FILES_kernel-headers = "/usr/src/kernel-headers"
>>>
>>> And looking at that it appears I broke kernel-misc by moving things to
>>> /usr/src (didn't notice that in my testing).
>>>
>>> How would you propose we redefine the above in order to use "kernel-dev"
>>> for the new package?
>>
>> hmmm interesting so I guess, linux-dev being already taken, you might
>> call it linux-kernel-headers as you were doing. So we have
>> linux-libc-headers and linux-kernel-headers to differentiate between
>> raw and sanitized headers
> 
> What would break if the new files were simply added to the existing 
> kernel-dev
> package ? I'm already putting System.map and others on targets in
> different environments for dev/debug, so would adding enough to build
> kernel modules on the target be a big problem ?


I was considering this last night as well.

> But I probably just don't understand *what* the existing -dev package
> is used for, and my comment makes no sense :)

And I landed here as well.

Should we attempt this approach and only break them apart if somebody
screams?

> 
> Outside of that, I also like linux-kernel-headers as the package name.

Would you prefer this even if we merge it with the existing kernel-dev?
I think my order of preference would be:

1) Merge with kernel-dev and leave the name as kernel-dev for
   consistency

2) New package called linux-kernel-headers

--
Darren

> 
> Cheers,
> 
> Bruce
> 
>>
>>>
>>> --
>>> Darren Hart
>>> Intel Open Source Technology Center
>>> Yocto Project - Linux Kernel
>>>
>>>
>
Bruce Ashfield - June 29, 2012, 1:59 p.m.
On 12-06-29 09:36 AM, Darren Hart wrote:
>
>
> On 06/29/2012 06:15 AM, Bruce Ashfield wrote:
>> On 12-06-29 03:22 AM, Khem Raj wrote:
>>> On Thu, Jun 28, 2012 at 11:14 PM, Darren Hart<dvhart@linux.intel.com>   wrote:
>>>>
>>>>
>>>> On 06/28/2012 11:04 PM, Khem Raj wrote:
>>>>> On Thu, Jun 28, 2012 at 10:50 PM, Darren Hart<dvhart@linux.intel.com>   wrote:
>>>>>>
>>>>>> However, I don't have a strong opinion here, I'll happily call it
>>>>>> kernel-devel if that is strongly preferred by some.
>>>>>
>>>>> in oe terminology it will be -dev
>>>>
>>>> THe other reason I didn't go that route is that we already have a
>>>> kernel-dev (although I don't much like the way it is used):
>>>>
>>>>   From kernel.bbclass:
>>>>
>>>> PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
>>>>              kernel-misc kernel-headers"
>>>> FILES = ""
>>>> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>>> FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>>>> FILES_kernel-vmlinux = "/boot/vmlinux*"
>>>> # misc is a package to contain files we need in staging
>>>> FILES_kernel-misc = "/kernel/include/config /kernel/scripts
>>>> /kernel/drivers/crypto /kernel/drivers/media"
>>>> FILES_kernel-headers = "/usr/src/kernel-headers"
>>>>
>>>> And looking at that it appears I broke kernel-misc by moving things to
>>>> /usr/src (didn't notice that in my testing).
>>>>
>>>> How would you propose we redefine the above in order to use "kernel-dev"
>>>> for the new package?
>>>
>>> hmmm interesting so I guess, linux-dev being already taken, you might
>>> call it linux-kernel-headers as you were doing. So we have
>>> linux-libc-headers and linux-kernel-headers to differentiate between
>>> raw and sanitized headers
>>
>> What would break if the new files were simply added to the existing
>> kernel-dev
>> package ? I'm already putting System.map and others on targets in
>> different environments for dev/debug, so would adding enough to build
>> kernel modules on the target be a big problem ?
>
>
> I was considering this last night as well.
>
>> But I probably just don't understand *what* the existing -dev package
>> is used for, and my comment makes no sense :)
>
> And I landed here as well.

:)

>
> Should we attempt this approach and only break them apart if somebody
> screams?

In the absence of definitely proof that we are missing something, I'm
ok with suggesting that we have a single -dev package.

>
>>
>> Outside of that, I also like linux-kernel-headers as the package name.
>
> Would you prefer this even if we merge it with the existing kernel-dev?
> I think my order of preference would be:
>
> 1) Merge with kernel-dev and leave the name as kernel-dev for
>     consistency
>
> 2) New package called linux-kernel-headers

Is there a 3rd option of a virtual package called linux-kernel-headers
that maps to -dev ? I have no idea if that is even possible or desirable,
but I thought I'd mention it.

I like #1, since we really are talking about development vs just some
headers lying around :)

Cheers,

Bruce

>
> --
> Darren
>
>>
>> Cheers,
>>
>> Bruce
>>
>>>
>>>>
>>>> --
>>>> Darren Hart
>>>> Intel Open Source Technology Center
>>>> Yocto Project - Linux Kernel
>>>>
>>>>
>>
>
Khem Raj - June 29, 2012, 5:52 p.m.
On Friday, June 29, 2012, Bruce Ashfield <bruce.ashfield@windriver.com>
wrote:
> On 12-06-29 09:36 AM, Darren Hart wrote:
>>
>>
>> On 06/29/2012 06:15 AM, Bruce Ashfield wrote:
>>>
>>> On 12-06-29 03:22 AM, Khem Raj wrote:
>>>>
>>>> On Thu, Jun 28, 2012 at 11:14 PM, Darren Hart<dvhart@linux.intel.com>
  wrote:
>>>>>
>>>>>
>>>>> On 06/28/2012 11:04 PM, Khem Raj wrote:
>>>>>>
>>>>>> On Thu, Jun 28, 2012 at 10:50 PM, Darren Hart<dvhart@linux.intel.com>
  wrote:
>>>>>>>
>>>>>>> However, I don't have a strong opinion here, I'll happily call it
>>>>>>> kernel-devel if that is strongly preferred by some.
>>>>>>
>>>>>> in oe terminology it will be -dev
>>>>>
>>>>> THe other reason I didn't go that route is that we already have a
>>>>> kernel-dev (although I don't much like the way it is used):
>>>>>
>>>>>  From kernel.bbclass:
>>>>>
>>>>> PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev
\
>>>>>             kernel-misc kernel-headers"
>>>>> FILES = ""
>>>>> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>>>> FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers*
/boot/config*"
>>>>> FILES_kernel-vmlinux = "/boot/vmlinux*"
>>>>> # misc is a package to contain files we need in staging
>>>>> FILES_kernel-misc = "/kernel/include/config /kernel/scripts
>>>>> /kernel/drivers/crypto /kernel/drivers/media"
>>>>> FILES_kernel-headers = "/usr/src/kernel-headers"
>>>>>
>>>>> And looking at that it appears I broke kernel-misc by moving things to
>>>>> /usr/src (didn't notice that in my testing).
>>>>>
>>>>> How would you propose we redefine the above in order to use
"kernel-dev"
>>>>> for the new package?
>>>>
>>>> hmmm interesting so I guess, linux-dev being already taken, you might
>>>> call it linux-kernel-headers as you were doing. So we have
>>>> linux-libc-headers and linux-kernel-headers to differentiate between
>>>> raw and sanitized headers
>>>
>>> What would break if the new files were simply added to the existing
>>> kernel-dev
>>> package ? I'm already putting System.map and others on targets in
>>> different environments for dev/debug, so would adding enough to build
>>> kernel modules on the target be a big problem ?
>>
>>
>> I was considering this last night as well.
>>
>>> But I probably just don't understand *what* the existing -dev package
>>> is used for, and my comment makes no sense :)
>>
>> And I landed here as well.
>
> :)
>
>>
>> Should we attempt this approach and only break them apart if somebody
>> screams?
>
> In the absence of definitely proof that we are missing something, I'm
> ok with suggesting that we have a single -dev package.
>
>>
>>>
>>> Outside of that, I also like linux-kernel-headers as the package name.
>>
>> Would you prefer this even if we merge it with the existing kernel-dev?
>> I think my order of preference would be:
>>
>> 1) Merge with kernel-dev and leave the name as kernel-dev for
>>    consistency
>>
>> 2) New package called linux-kernel-headers
>
> Is there a 3rd option of a virtual package called linux-kernel-headers
> that maps to -dev ? I have no idea if that is even possible or desirable,
> but I thought I'd mention it.
>
> I like #1, since we really are talking about development vs just some
> headers lying around :)
>

I think packaging more into -dev is OK upgrade wise so let's use kernel-dev
and.put it in usr/src/kernel
> Cheers,
>
> Bruce
>
>>
>> --
>> Darren
>>
>>>
>>> Cheers,
>>>
>>> Bruce
>>>
>>>>
>>>>>
>>>>> --
>>>>> Darren Hart
>>>>> Intel Open Source Technology Center
>>>>> Yocto Project - Linux Kernel
>>>>>
>>>>>
>>>
>>
>
>
Darren Hart - June 29, 2012, 5:58 p.m.
On 06/29/2012 10:52 AM, Khem Raj wrote:

> I think packaging more into -dev is OK upgrade wise so let's use
> kernel-dev and.put it in usr/src/kernel

OK. I'm working on building and testing now. I'm thinking kernel-misc
probably needs to go away as it now conflicts with kernel-dev. I'm not
sure what the comment about needing it for staging is about.

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 31e633b..b82af74 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -130,7 +130,7 @@  kernel_do_install() {
 	# Support for external module building - create a minimal copy of the
 	# kernel source tree.
 	#
-	kerneldir=${D}/kernel
+	kerneldir=${D}/usr/src/kernel-headers
 	install -d $kerneldir
 
 	#
@@ -183,10 +183,11 @@  kernel_do_install() {
 		cp arch/powerpc/lib/crtsavres.o $kerneldir/arch/powerpc/lib/crtsavres.o
 	fi
 
-	# Remove the following binaries which cause strip errors
+	# Remove the following binaries which cause strip or arch QA errors
 	# during do_package for cross-compiled platforms
 	bin_files="arch/powerpc/boot/addnote arch/powerpc/boot/hack-coff \
-	           arch/powerpc/boot/mktree"
+	           arch/powerpc/boot/mktree scripts/kconfig/zconf.tab.o \
+		   scripts/kconfig/conf.o"
 	for entry in $bin_files; do
 		rm -f $kerneldir/$entry
 	done
@@ -247,13 +248,15 @@  EXPORT_FUNCTIONS do_compile do_install do_configure
 
 # kernel-base becomes kernel-${KERNEL_VERSION}
 # kernel-image becomes kernel-image-${KERNEL_VERISON}
-PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev kernel-misc"
+PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev \
+            kernel-misc kernel-headers"
 FILES = ""
 FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
 FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
 FILES_kernel-vmlinux = "/boot/vmlinux*"
 # misc is a package to contain files we need in staging
 FILES_kernel-misc = "/kernel/include/config /kernel/scripts /kernel/drivers/crypto /kernel/drivers/media"
+FILES_kernel-headers = "/usr/src/kernel-headers"
 RDEPENDS_kernel = "kernel-base"
 # Allow machines to override this dependency if kernel image files are 
 # not wanted in images as standard
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 9b26580..9f3abee 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -380,7 +380,7 @@  SDKPATHNATIVE = "${SDKPATH}/sysroots/${SDK_SYS}"
 ##################################################################
 
 OLDEST_KERNEL = "2.6.16"
-STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/kernel"
+STAGING_KERNEL_DIR = "${STAGING_DIR_HOST}/usr/src/kernel-headers"
 
 ##################################################################
 # Specific image creation and rootfs population info.