Patchwork [for-denzil,meta-oe,09/11] kernel: Add kernel headers to kernel-dev package

login
register
mail settings
Submitter McClintock Matthew-B29882
Date Sept. 5, 2012, 9:42 p.m.
Message ID <70CC66F5C30A414DADDA6973E4CA391A64E50F@039-SN1MPN1-001.039d.mgd.msft.net>
Download mbox | patch
Permalink /patch/35991/
State New
Headers show

Comments

McClintock Matthew-B29882 - Sept. 5, 2012, 9:42 p.m.
On Tue, Aug 28, 2012 at 1:41 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
> From: Darren Hart <dvhart@linux.intel.com>
>
> [YOCTO #1614]
>
> Add the kernel headers to the kernel-dev package. This 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
>
> Before use on the target, the user will need to:
>
>     # cd /usr/src/kernel
>     # make scripts
>
> This renders the kernel-misc recipe empty, so remove it.
>
> As we use /usr/src/kernel in several places (and I missed one in the
> previous version), add a KERNEL_SRC_DIR variable and use that throughout
> the class to avoid update errors in the future.
>
> Now that we package the kernel headers, drop the
> kernel_package_preprocess function which removed them from PKGD.
>
> All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
> be installed by default on all such images.
>
> 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 |   25 +++++++++++--------------
>  meta/conf/bitbake.conf      |    2 +-
>  2 files changed, 12 insertions(+), 15 deletions(-)
>
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 3ccd753..d79ba9f 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -77,6 +77,10 @@ EXTRA_OEMAKE = ""
>
>  KERNEL_ALT_IMAGETYPE ??= ""
>
> +# Define where the kernel headers are installed on the target as well as where
> +# they are staged.
> +KERNEL_SRC_PATH = "/usr/src/kernel"
> +
>  KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>
>  kernel_do_compile() {
> @@ -130,7 +134,7 @@ kernel_do_install() {
>         # Support for external module building - create a minimal copy of the
>         # kernel source tree.
>         #
> -       kerneldir=${D}/kernel
> +       kerneldir=${D}${KERNEL_SRC_PATH}
>         install -d $kerneldir
>
>         #
> @@ -191,20 +195,15 @@ kernel_do_install() {
>         # Remove the following binaries which cause strip 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
>  }
>
> -PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
> -
> -kernel_package_preprocess () {
> -       rm -rf ${PKGD}/kernel
> -}
> -
>  sysroot_stage_all_append() {
> -       sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
> +       sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>  }
>
>  kernel_do_configure() {
> @@ -252,13 +251,11 @@ 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-image kernel-dev kernel-vmlinux kernel-misc"
> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
>  FILES = ""
>  FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
> -FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
> +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"

This patch is causing the following on denzil (which Scott applied to
his denzil-next branch)

ERROR: QA Issue: non debug package contains .debug directory:
kernel-dev path
/work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/packages-split/kernel-dev/usr/src/kernel/tools/perf/.debug/perf
ERROR: QA run found fatal errors. Please consider fixing them.
ERROR: Function failed: do_package_qa
ERROR: Logfile of failure stored in:
/local/home/mattsm/git/poky/build-denzil/tmp/work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/temp/log.do_package.26851
NOTE: package linux-qoriq-sdk-3.0.34-r4: task do_package: Failed
ERROR: Task 13 (/local/home/mattsm/git/poky/build-denzil/../meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb,
do_package) failed with exit code '1'

At first glance, it looks like we should:


Thoughts?

-M


>  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"
>  RDEPENDS_kernel = "kernel-base"
>  # Allow machines to override this dependency if kernel image files are
>  # not wanted in images as standard
> @@ -475,7 +472,7 @@ python populate_packages_prepend () {
>         metapkg = "kernel-modules"
>         d.setVar('ALLOW_EMPTY_' + metapkg, "1")
>         d.setVar('FILES_' + metapkg, "")
> -       blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg', 'kernel-misc' ]
> +       blacklist = [ 'kernel-dev', 'kernel-image', 'kernel-base', 'kernel-vmlinux', 'perf', 'perf-dbg' ]
>         for l in module_deps.values():
>                 for i in l:
>                         pkg = module_pattern % legitimize_package_name(re.match(module_regex, os.path.basename(i)).group(1))
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index 618780c..85ba108 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -376,7 +376,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"
>
>  ##################################################################
>  # Specific image creation and rootfs population info.
> --
> 1.7.7.6
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Darren Hart - Sept. 6, 2012, 12:49 a.m.
On 09/05/2012 02:42 PM, McClintock Matthew-B29882 wrote:
> On Tue, Aug 28, 2012 at 1:41 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>> From: Darren Hart <dvhart@linux.intel.com>
>>
>> [YOCTO #1614]
>>
>> Add the kernel headers to the kernel-dev package. This 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
>>
>> Before use on the target, the user will need to:
>>
>>     # cd /usr/src/kernel
>>     # make scripts
>>
>> This renders the kernel-misc recipe empty, so remove it.
>>
>> As we use /usr/src/kernel in several places (and I missed one in the
>> previous version), add a KERNEL_SRC_DIR variable and use that throughout
>> the class to avoid update errors in the future.
>>
>> Now that we package the kernel headers, drop the
>> kernel_package_preprocess function which removed them from PKGD.
>>
>> All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
>> be installed by default on all such images.
>>
>> 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 |   25 +++++++++++--------------
>>  meta/conf/bitbake.conf      |    2 +-
>>  2 files changed, 12 insertions(+), 15 deletions(-)
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index 3ccd753..d79ba9f 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -77,6 +77,10 @@ EXTRA_OEMAKE = ""
>>
>>  KERNEL_ALT_IMAGETYPE ??= ""
>>
>> +# Define where the kernel headers are installed on the target as well as where
>> +# they are staged.
>> +KERNEL_SRC_PATH = "/usr/src/kernel"
>> +
>>  KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>>
>>  kernel_do_compile() {
>> @@ -130,7 +134,7 @@ kernel_do_install() {
>>         # Support for external module building - create a minimal copy of the
>>         # kernel source tree.
>>         #
>> -       kerneldir=${D}/kernel
>> +       kerneldir=${D}${KERNEL_SRC_PATH}
>>         install -d $kerneldir
>>
>>         #
>> @@ -191,20 +195,15 @@ kernel_do_install() {
>>         # Remove the following binaries which cause strip 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
>>  }
>>
>> -PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
>> -
>> -kernel_package_preprocess () {
>> -       rm -rf ${PKGD}/kernel
>> -}
>> -
>>  sysroot_stage_all_append() {
>> -       sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
>> +       sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>>  }
>>
>>  kernel_do_configure() {
>> @@ -252,13 +251,11 @@ 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-image kernel-dev kernel-vmlinux kernel-misc"
>> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
>>  FILES = ""
>>  FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>> -FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>> +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
> 
> This patch is causing the following on denzil (which Scott applied to
> his denzil-next branch)
> 
> ERROR: QA Issue: non debug package contains .debug directory:
> kernel-dev path
> /work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/packages-split/kernel-dev/usr/src/kernel/tools/perf/.debug/perf
> ERROR: QA run found fatal errors. Please consider fixing them.
> ERROR: Function failed: do_package_qa
> ERROR: Logfile of failure stored in:
> /local/home/mattsm/git/poky/build-denzil/tmp/work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/temp/log.do_package.26851
> NOTE: package linux-qoriq-sdk-3.0.34-r4: task do_package: Failed
> ERROR: Task 13 (/local/home/mattsm/git/poky/build-denzil/../meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb,
> do_package) failed with exit code '1'
> 
> At first glance, it looks like we should:
> 
> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
> index 7ae2a53..511b22b 100644
> --- a/meta/classes/kernel.bbclass
> +++ b/meta/classes/kernel.bbclass
> @@ -546,4 +546,5 @@ EXPORT_FUNCTIONS do_deploy
>  PACKAGES =+ "perf-dbg perf"
>  FILES_perf = "${bindir}/* \
>                ${libexecdir}"
> -FILES_perf-dbg = "${FILES_${PN}-dbg}"
> +FILES_perf-dbg = "${FILES_${PN}-dbg} \
> +                 ${KERNEL_SRC_PATH}/tools/perf/.debug"
> 
> Thoughts?

I suppose that or pull in the patches to separate perf into a separate
recipe, although that's 13+ patches. I prefer your solution for the
stable tree.

Tom may have another suggestion.
McClintock Matthew-B29882 - Sept. 6, 2012, 1:33 a.m.
On Wed, Sep 5, 2012 at 7:49 PM, Darren Hart <dvhart@linux.intel.com> wrote:
>
>
> On 09/05/2012 02:42 PM, McClintock Matthew-B29882 wrote:
>> On Tue, Aug 28, 2012 at 1:41 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>> From: Darren Hart <dvhart@linux.intel.com>
>>>
>>> [YOCTO #1614]
>>>
>>> Add the kernel headers to the kernel-dev package. This 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
>>>
>>> Before use on the target, the user will need to:
>>>
>>>     # cd /usr/src/kernel
>>>     # make scripts
>>>
>>> This renders the kernel-misc recipe empty, so remove it.
>>>
>>> As we use /usr/src/kernel in several places (and I missed one in the
>>> previous version), add a KERNEL_SRC_DIR variable and use that throughout
>>> the class to avoid update errors in the future.
>>>
>>> Now that we package the kernel headers, drop the
>>> kernel_package_preprocess function which removed them from PKGD.
>>>
>>> All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
>>> be installed by default on all such images.
>>>
>>> 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 |   25 +++++++++++--------------
>>>  meta/conf/bitbake.conf      |    2 +-
>>>  2 files changed, 12 insertions(+), 15 deletions(-)
>>>
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index 3ccd753..d79ba9f 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -77,6 +77,10 @@ EXTRA_OEMAKE = ""
>>>
>>>  KERNEL_ALT_IMAGETYPE ??= ""
>>>
>>> +# Define where the kernel headers are installed on the target as well as where
>>> +# they are staged.
>>> +KERNEL_SRC_PATH = "/usr/src/kernel"
>>> +
>>>  KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>>>
>>>  kernel_do_compile() {
>>> @@ -130,7 +134,7 @@ kernel_do_install() {
>>>         # Support for external module building - create a minimal copy of the
>>>         # kernel source tree.
>>>         #
>>> -       kerneldir=${D}/kernel
>>> +       kerneldir=${D}${KERNEL_SRC_PATH}
>>>         install -d $kerneldir
>>>
>>>         #
>>> @@ -191,20 +195,15 @@ kernel_do_install() {
>>>         # Remove the following binaries which cause strip 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
>>>  }
>>>
>>> -PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
>>> -
>>> -kernel_package_preprocess () {
>>> -       rm -rf ${PKGD}/kernel
>>> -}
>>> -
>>>  sysroot_stage_all_append() {
>>> -       sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
>>> +       sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>>>  }
>>>
>>>  kernel_do_configure() {
>>> @@ -252,13 +251,11 @@ 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-image kernel-dev kernel-vmlinux kernel-misc"
>>> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
>>>  FILES = ""
>>>  FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>> -FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>>> +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
>>
>> This patch is causing the following on denzil (which Scott applied to
>> his denzil-next branch)
>>
>> ERROR: QA Issue: non debug package contains .debug directory:
>> kernel-dev path
>> /work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/packages-split/kernel-dev/usr/src/kernel/tools/perf/.debug/perf
>> ERROR: QA run found fatal errors. Please consider fixing them.
>> ERROR: Function failed: do_package_qa
>> ERROR: Logfile of failure stored in:
>> /local/home/mattsm/git/poky/build-denzil/tmp/work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/temp/log.do_package.26851
>> NOTE: package linux-qoriq-sdk-3.0.34-r4: task do_package: Failed
>> ERROR: Task 13 (/local/home/mattsm/git/poky/build-denzil/../meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb,
>> do_package) failed with exit code '1'
>>
>> At first glance, it looks like we should:
>>
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index 7ae2a53..511b22b 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -546,4 +546,5 @@ EXPORT_FUNCTIONS do_deploy
>>  PACKAGES =+ "perf-dbg perf"
>>  FILES_perf = "${bindir}/* \
>>                ${libexecdir}"
>> -FILES_perf-dbg = "${FILES_${PN}-dbg}"
>> +FILES_perf-dbg = "${FILES_${PN}-dbg} \
>> +                 ${KERNEL_SRC_PATH}/tools/perf/.debug"
>>
>> Thoughts?
>
> I suppose that or pull in the patches to separate perf into a separate
> recipe, although that's 13+ patches. I prefer your solution for the
> stable tree.
>
> Tom may have another suggestion.

Keeping in mind I'm building a non-Yocto kernel with this...

-M
Koen Kooi - Sept. 6, 2012, 5:52 a.m.
Op 6 sep. 2012, om 02:49 heeft Darren Hart <dvhart@linux.intel.com> het volgende geschreven:

> 
> 
> On 09/05/2012 02:42 PM, McClintock Matthew-B29882 wrote:
>> On Tue, Aug 28, 2012 at 1:41 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>> From: Darren Hart <dvhart@linux.intel.com>
>>> 
>>> [YOCTO #1614]
>>> 
>>> Add the kernel headers to the kernel-dev package. This 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
>>> 
>>> Before use on the target, the user will need to:
>>> 
>>>    # cd /usr/src/kernel
>>>    # make scripts
>>> 
>>> This renders the kernel-misc recipe empty, so remove it.
>>> 
>>> As we use /usr/src/kernel in several places (and I missed one in the
>>> previous version), add a KERNEL_SRC_DIR variable and use that throughout
>>> the class to avoid update errors in the future.
>>> 
>>> Now that we package the kernel headers, drop the
>>> kernel_package_preprocess function which removed them from PKGD.
>>> 
>>> All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
>>> be installed by default on all such images.
>>> 
>>> 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 |   25 +++++++++++--------------
>>> meta/conf/bitbake.conf      |    2 +-
>>> 2 files changed, 12 insertions(+), 15 deletions(-)
>>> 
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index 3ccd753..d79ba9f 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -77,6 +77,10 @@ EXTRA_OEMAKE = ""
>>> 
>>> KERNEL_ALT_IMAGETYPE ??= ""
>>> 
>>> +# Define where the kernel headers are installed on the target as well as where
>>> +# they are staged.
>>> +KERNEL_SRC_PATH = "/usr/src/kernel"
>>> +
>>> KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>>> 
>>> kernel_do_compile() {
>>> @@ -130,7 +134,7 @@ kernel_do_install() {
>>>        # Support for external module building - create a minimal copy of the
>>>        # kernel source tree.
>>>        #
>>> -       kerneldir=${D}/kernel
>>> +       kerneldir=${D}${KERNEL_SRC_PATH}
>>>        install -d $kerneldir
>>> 
>>>        #
>>> @@ -191,20 +195,15 @@ kernel_do_install() {
>>>        # Remove the following binaries which cause strip 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
>>> }
>>> 
>>> -PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
>>> -
>>> -kernel_package_preprocess () {
>>> -       rm -rf ${PKGD}/kernel
>>> -}
>>> -
>>> sysroot_stage_all_append() {
>>> -       sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
>>> +       sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>>> }
>>> 
>>> kernel_do_configure() {
>>> @@ -252,13 +251,11 @@ 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-image kernel-dev kernel-vmlinux kernel-misc"
>>> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
>>> FILES = ""
>>> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>> -FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>>> +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
>> 
>> This patch is causing the following on denzil (which Scott applied to
>> his denzil-next branch)
>> 
>> ERROR: QA Issue: non debug package contains .debug directory:
>> kernel-dev path
>> /work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/packages-split/kernel-dev/usr/src/kernel/tools/perf/.debug/perf
>> ERROR: QA run found fatal errors. Please consider fixing them.
>> ERROR: Function failed: do_package_qa
>> ERROR: Logfile of failure stored in:
>> /local/home/mattsm/git/poky/build-denzil/tmp/work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/temp/log.do_package.26851
>> NOTE: package linux-qoriq-sdk-3.0.34-r4: task do_package: Failed
>> ERROR: Task 13 (/local/home/mattsm/git/poky/build-denzil/../meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb,
>> do_package) failed with exit code '1'
>> 
>> At first glance, it looks like we should:
>> 
>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>> index 7ae2a53..511b22b 100644
>> --- a/meta/classes/kernel.bbclass
>> +++ b/meta/classes/kernel.bbclass
>> @@ -546,4 +546,5 @@ EXPORT_FUNCTIONS do_deploy
>> PACKAGES =+ "perf-dbg perf"
>> FILES_perf = "${bindir}/* \
>>               ${libexecdir}"
>> -FILES_perf-dbg = "${FILES_${PN}-dbg}"
>> +FILES_perf-dbg = "${FILES_${PN}-dbg} \
>> +                 ${KERNEL_SRC_PATH}/tools/perf/.debug"
>> 
>> Thoughts?
> 
> I suppose that or pull in the patches to separate perf into a separate
> recipe, although that's 13+ patches.

I kept the perf change out on purpose in this patchset :)

> I prefer your solution for the
> stable tree.

Me too. I haven't run into that bug yet, but the fix is valid.
Koen Kooi - Sept. 17, 2012, 11 a.m.
Op 6 sep. 2012, om 07:52 heeft Koen Kooi <koen@dominion.thruhere.net> het volgende geschreven:

> 
> Op 6 sep. 2012, om 02:49 heeft Darren Hart <dvhart@linux.intel.com> het volgende geschreven:
> 
>> 
>> 
>> On 09/05/2012 02:42 PM, McClintock Matthew-B29882 wrote:
>>> On Tue, Aug 28, 2012 at 1:41 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>> From: Darren Hart <dvhart@linux.intel.com>
>>>> 
>>>> [YOCTO #1614]
>>>> 
>>>> Add the kernel headers to the kernel-dev package. This 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
>>>> 
>>>> Before use on the target, the user will need to:
>>>> 
>>>>   # cd /usr/src/kernel
>>>>   # make scripts
>>>> 
>>>> This renders the kernel-misc recipe empty, so remove it.
>>>> 
>>>> As we use /usr/src/kernel in several places (and I missed one in the
>>>> previous version), add a KERNEL_SRC_DIR variable and use that throughout
>>>> the class to avoid update errors in the future.
>>>> 
>>>> Now that we package the kernel headers, drop the
>>>> kernel_package_preprocess function which removed them from PKGD.
>>>> 
>>>> All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
>>>> be installed by default on all such images.
>>>> 
>>>> 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 |   25 +++++++++++--------------
>>>> meta/conf/bitbake.conf      |    2 +-
>>>> 2 files changed, 12 insertions(+), 15 deletions(-)
>>>> 
>>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>>> index 3ccd753..d79ba9f 100644
>>>> --- a/meta/classes/kernel.bbclass
>>>> +++ b/meta/classes/kernel.bbclass
>>>> @@ -77,6 +77,10 @@ EXTRA_OEMAKE = ""
>>>> 
>>>> KERNEL_ALT_IMAGETYPE ??= ""
>>>> 
>>>> +# Define where the kernel headers are installed on the target as well as where
>>>> +# they are staged.
>>>> +KERNEL_SRC_PATH = "/usr/src/kernel"
>>>> +
>>>> KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>>>> 
>>>> kernel_do_compile() {
>>>> @@ -130,7 +134,7 @@ kernel_do_install() {
>>>>       # Support for external module building - create a minimal copy of the
>>>>       # kernel source tree.
>>>>       #
>>>> -       kerneldir=${D}/kernel
>>>> +       kerneldir=${D}${KERNEL_SRC_PATH}
>>>>       install -d $kerneldir
>>>> 
>>>>       #
>>>> @@ -191,20 +195,15 @@ kernel_do_install() {
>>>>       # Remove the following binaries which cause strip 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
>>>> }
>>>> 
>>>> -PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
>>>> -
>>>> -kernel_package_preprocess () {
>>>> -       rm -rf ${PKGD}/kernel
>>>> -}
>>>> -
>>>> sysroot_stage_all_append() {
>>>> -       sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
>>>> +       sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>>>> }
>>>> 
>>>> kernel_do_configure() {
>>>> @@ -252,13 +251,11 @@ 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-image kernel-dev kernel-vmlinux kernel-misc"
>>>> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
>>>> FILES = ""
>>>> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>>> -FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>>>> +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
>>> 
>>> This patch is causing the following on denzil (which Scott applied to
>>> his denzil-next branch)
>>> 
>>> ERROR: QA Issue: non debug package contains .debug directory:
>>> kernel-dev path
>>> /work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/packages-split/kernel-dev/usr/src/kernel/tools/perf/.debug/perf
>>> ERROR: QA run found fatal errors. Please consider fixing them.
>>> ERROR: Function failed: do_package_qa
>>> ERROR: Logfile of failure stored in:
>>> /local/home/mattsm/git/poky/build-denzil/tmp/work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/temp/log.do_package.26851
>>> NOTE: package linux-qoriq-sdk-3.0.34-r4: task do_package: Failed
>>> ERROR: Task 13 (/local/home/mattsm/git/poky/build-denzil/../meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb,
>>> do_package) failed with exit code '1'
>>> 
>>> At first glance, it looks like we should:
>>> 
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index 7ae2a53..511b22b 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -546,4 +546,5 @@ EXPORT_FUNCTIONS do_deploy
>>> PACKAGES =+ "perf-dbg perf"
>>> FILES_perf = "${bindir}/* \
>>>              ${libexecdir}"
>>> -FILES_perf-dbg = "${FILES_${PN}-dbg}"
>>> +FILES_perf-dbg = "${FILES_${PN}-dbg} \
>>> +                 ${KERNEL_SRC_PATH}/tools/perf/.debug"
>>> 
>>> Thoughts?
>> 
>> I suppose that or pull in the patches to separate perf into a separate
>> recipe, although that's 13+ patches.
> 
> I kept the perf change out on purpose in this patchset :)
> 
>> I prefer your solution for the
>> stable tree.
> 
> Me too. I haven't run into that bug yet, but the fix is valid.

Ping
Scott Garman - Sept. 19, 2012, 5:27 a.m.
On 09/05/2012 10:52 PM, Koen Kooi wrote:
>
> Op 6 sep. 2012, om 02:49 heeft Darren Hart <dvhart@linux.intel.com> het volgende geschreven:
>
>>
>>
>> On 09/05/2012 02:42 PM, McClintock Matthew-B29882 wrote:
>>> On Tue, Aug 28, 2012 at 1:41 AM, Koen Kooi <koen@dominion.thruhere.net> wrote:
>>>> From: Darren Hart <dvhart@linux.intel.com>
>>>>
>>>> [YOCTO #1614]
>>>>
>>>> Add the kernel headers to the kernel-dev package. This 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
>>>>
>>>> Before use on the target, the user will need to:
>>>>
>>>>     # cd /usr/src/kernel
>>>>     # make scripts
>>>>
>>>> This renders the kernel-misc recipe empty, so remove it.
>>>>
>>>> As we use /usr/src/kernel in several places (and I missed one in the
>>>> previous version), add a KERNEL_SRC_DIR variable and use that throughout
>>>> the class to avoid update errors in the future.
>>>>
>>>> Now that we package the kernel headers, drop the
>>>> kernel_package_preprocess function which removed them from PKGD.
>>>>
>>>> All *-sdk image recipes include dev-pkgs, so the kernel-dev package will
>>>> be installed by default on all such images.
>>>>
>>>> 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 |   25 +++++++++++--------------
>>>> meta/conf/bitbake.conf      |    2 +-
>>>> 2 files changed, 12 insertions(+), 15 deletions(-)
>>>>
>>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>>> index 3ccd753..d79ba9f 100644
>>>> --- a/meta/classes/kernel.bbclass
>>>> +++ b/meta/classes/kernel.bbclass
>>>> @@ -77,6 +77,10 @@ EXTRA_OEMAKE = ""
>>>>
>>>> KERNEL_ALT_IMAGETYPE ??= ""
>>>>
>>>> +# Define where the kernel headers are installed on the target as well as where
>>>> +# they are staged.
>>>> +KERNEL_SRC_PATH = "/usr/src/kernel"
>>>> +
>>>> KERNEL_IMAGETYPE_FOR_MAKE = "${@(lambda s: s[:-3] if s[-3:] == ".gz" else s)(d.getVar('KERNEL_IMAGETYPE', True))}"
>>>>
>>>> kernel_do_compile() {
>>>> @@ -130,7 +134,7 @@ kernel_do_install() {
>>>>         # Support for external module building - create a minimal copy of the
>>>>         # kernel source tree.
>>>>         #
>>>> -       kerneldir=${D}/kernel
>>>> +       kerneldir=${D}${KERNEL_SRC_PATH}
>>>>         install -d $kerneldir
>>>>
>>>>         #
>>>> @@ -191,20 +195,15 @@ kernel_do_install() {
>>>>         # Remove the following binaries which cause strip 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
>>>> }
>>>>
>>>> -PACKAGE_PREPROCESS_FUNCS += "kernel_package_preprocess"
>>>> -
>>>> -kernel_package_preprocess () {
>>>> -       rm -rf ${PKGD}/kernel
>>>> -}
>>>> -
>>>> sysroot_stage_all_append() {
>>>> -       sysroot_stage_dir ${D}/kernel ${SYSROOT_DESTDIR}/kernel
>>>> +       sysroot_stage_dir ${D}${KERNEL_SRC_PATH} ${SYSROOT_DESTDIR}${KERNEL_SRC_PATH}
>>>> }
>>>>
>>>> kernel_do_configure() {
>>>> @@ -252,13 +251,11 @@ 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-image kernel-dev kernel-vmlinux kernel-misc"
>>>> +PACKAGES = "kernel kernel-base kernel-vmlinux kernel-image kernel-dev"
>>>> FILES = ""
>>>> FILES_kernel-image = "/boot/${KERNEL_IMAGETYPE}*"
>>>> -FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config*"
>>>> +FILES_kernel-dev = "/boot/System.map* /boot/Module.symvers* /boot/config* ${KERNEL_SRC_PATH}"
>>>
>>> This patch is causing the following on denzil (which Scott applied to
>>> his denzil-next branch)
>>>
>>> ERROR: QA Issue: non debug package contains .debug directory:
>>> kernel-dev path
>>> /work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/packages-split/kernel-dev/usr/src/kernel/tools/perf/.debug/perf
>>> ERROR: QA run found fatal errors. Please consider fixing them.
>>> ERROR: Function failed: do_package_qa
>>> ERROR: Logfile of failure stored in:
>>> /local/home/mattsm/git/poky/build-denzil/tmp/work/p5020ds_64b-poky-linux/linux-qoriq-sdk-3.0.34-r4/temp/log.do_package.26851
>>> NOTE: package linux-qoriq-sdk-3.0.34-r4: task do_package: Failed
>>> ERROR: Task 13 (/local/home/mattsm/git/poky/build-denzil/../meta-fsl-ppc/recipes-kernel/linux/linux-qoriq-sdk.bb,
>>> do_package) failed with exit code '1'
>>>
>>> At first glance, it looks like we should:
>>>
>>> diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
>>> index 7ae2a53..511b22b 100644
>>> --- a/meta/classes/kernel.bbclass
>>> +++ b/meta/classes/kernel.bbclass
>>> @@ -546,4 +546,5 @@ EXPORT_FUNCTIONS do_deploy
>>> PACKAGES =+ "perf-dbg perf"
>>> FILES_perf = "${bindir}/* \
>>>                ${libexecdir}"
>>> -FILES_perf-dbg = "${FILES_${PN}-dbg}"
>>> +FILES_perf-dbg = "${FILES_${PN}-dbg} \
>>> +                 ${KERNEL_SRC_PATH}/tools/perf/.debug"
>>>
>>> Thoughts?
>>
>> I suppose that or pull in the patches to separate perf into a separate
>> recipe, although that's 13+ patches.
>
> I kept the perf change out on purpose in this patchset :)
>
>> I prefer your solution for the
>> stable tree.
>
> Me too. I haven't run into that bug yet, but the fix is valid.

I've include Matthew's fix in my sgarman/denzil-next branches, 
"kernel.bbclass: put perf .debug dir in -dbg package", 
11cc90715be0ece185d736133d4fcd1a3288366f.

Scott

Patch

diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 7ae2a53..511b22b 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -546,4 +546,5 @@  EXPORT_FUNCTIONS do_deploy
 PACKAGES =+ "perf-dbg perf"
 FILES_perf = "${bindir}/* \
               ${libexecdir}"
-FILES_perf-dbg = "${FILES_${PN}-dbg}"
+FILES_perf-dbg = "${FILES_${PN}-dbg} \
+                 ${KERNEL_SRC_PATH}/tools/perf/.debug"