Patchwork [6/6] image.bbclass: Add support to build the SDK in parallel with the image

login
register
mail settings
Submitter Mark Hatle
Date June 30, 2012, 5:07 a.m.
Message ID <28adf5fdb58c3409ec2dcc1a8dfffaaf2a8eab2b.1341032578.git.mark.hatle@windriver.com>
Download mbox | patch
Permalink /patch/30943/
State Accepted
Commit a0de2a56f19ae4d8cd88e46e96917a7a019fe1ab
Headers show

Comments

Mark Hatle - June 30, 2012, 5:07 a.m.
When building an image recipe, you can now build a companion SDK by
calling the populate_sdk task:
  bitbake -c populate_sdk core-image-minimal

Note: there are still issues w/ the SDK not working completely with
multilibs.

A lock is required between rootfs and populate_sdk activities to prevent
configuration file clashes and similar package management problems in ipk
and deb based systems.  (RPM already had a lock for a different reason.)

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/image.bbclass             |    5 +++++
 meta/classes/populate_sdk_base.bbclass |    1 +
 meta/classes/populate_sdk_deb.bbclass  |    2 ++
 meta/classes/populate_sdk_ipk.bbclass  |    2 ++
 meta/classes/rootfs_deb.bbclass        |    2 ++
 meta/classes/rootfs_ipk.bbclass        |    2 ++
 6 files changed, 14 insertions(+), 0 deletions(-)
Saul Wold - July 2, 2012, 7:44 p.m.
On 06/29/2012 10:07 PM, Mark Hatle wrote:
> When building an image recipe, you can now build a companion SDK by
> calling the populate_sdk task:
>    bitbake -c populate_sdk core-image-minimal
>
> Note: there are still issues w/ the SDK not working completely with
> multilibs.
>
> A lock is required between rootfs and populate_sdk activities to prevent
> configuration file clashes and similar package management problems in ipk
> and deb based systems.  (RPM already had a lock for a different reason.)
>

Mark this seems to have broken non-gplv3 builds.  I get the following 
error now:

> NOTE: Resolving any missing task queue dependencies
> ERROR: Nothing RPROVIDES 'binutils-cross-canadian-i586' (but /intel/poky/distro/meta/recipes-core/tasks/task-cross-canadian.bb RDEPENDS on or otherwise requires it)
> ERROR: binutils-cross-canadian-i586 was skipped: incompatible with license GPLv3
> NOTE: Runtime target 'binutils-cross-canadian-i586' is unbuildable, removing...
> Missing or unbuildable dependency chain was: ['binutils-cross-canadian-i586']
> NOTE: Runtime target 'task-cross-canadian-i586' is unbuildable, removing...
> Missing or unbuildable dependency chain was: ['task-cross-canadian-i586', 'binutils-cross-canadian-i586']
> ERROR: Required build target 'core-image-minimal' has no buildable providers.
> Missing or unbuildable dependency chain was: ['core-image-minimal', 'task-cross-canadian-i586', 'binutils-cross-canadian-i586']
>
> Summary: There were 2 ERROR messages shown, returning a non-zero exit code.


I am going to hold off on this patch set until this is resolved.

Thanks

	Sau!


> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
> ---
>   meta/classes/image.bbclass             |    5 +++++
>   meta/classes/populate_sdk_base.bbclass |    1 +
>   meta/classes/populate_sdk_deb.bbclass  |    2 ++
>   meta/classes/populate_sdk_ipk.bbclass  |    2 ++
>   meta/classes/rootfs_deb.bbclass        |    2 ++
>   meta/classes/rootfs_ipk.bbclass        |    2 ++
>   6 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 4f50376..7e41982 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
>   IMAGETEST ?= "dummy"
>   inherit imagetest-${IMAGETEST}
>
> +inherit populate_sdk_base
> +
> +TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
> +TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY} ${PACKAGE_GROUP_dev-pkgs} ${PACKAGE_GROUP_dbg-pkgs}"
> +
>   inherit gzipnative
>
>   LICENSE = "MIT"
> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index 6dc66fb..ed2dca0 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -120,6 +120,7 @@ populate_sdk_log_check() {
>   	done
>   }
>
> +do_populate_sdk[dirs] = "${TOPDIR}"
>   do_populate_sdk[nostamp] = "1"
>   do_populate_sdk[depends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS', True).split()])}"
>   do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).split()])}"
> diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
> index c3b3e0c..9e9e1e1 100644
> --- a/meta/classes/populate_sdk_deb.bbclass
> +++ b/meta/classes/populate_sdk_deb.bbclass
> @@ -6,6 +6,8 @@ DEB_SDK_ARCH = "${@[d.getVar('SDK_ARCH', True), "i386"]\
>                   [d.getVar('SDK_ARCH', True) in \
>                   ["x86", "i486", "i586", "i686", "pentium"]]}"
>
> +do_populate_sdk[lockfiles] += "${WORKDIR}/deb.lock"
> +
>   populate_sdk_post_deb () {
>
>   	local target_rootfs=$1
> diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
> index aa3efde..4321afb 100644
> --- a/meta/classes/populate_sdk_ipk.bbclass
> +++ b/meta/classes/populate_sdk_ipk.bbclass
> @@ -1,6 +1,8 @@
>   do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
>   do_populate_sdk[recrdeptask] += "do_package_write_ipk"
>
> +do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
> +
>   populate_sdk_ipk() {
>
>   	rm -f ${IPKGCONF_TARGET}
> diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
> index 6c9767f..4ea71da 100644
> --- a/meta/classes/rootfs_deb.bbclass
> +++ b/meta/classes/rootfs_deb.bbclass
> @@ -8,6 +8,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
>   do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
>   do_rootfs[recrdeptask] += "do_package_write_deb"
>
> +do_rootfs[lockfiles] += "${WORKDIR}/deb.lock"
> +
>   DEB_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
>
>   opkglibdir = "${localstatedir}/lib/opkg"
> diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
> index 1580086..9732385 100644
> --- a/meta/classes/rootfs_ipk.bbclass
> +++ b/meta/classes/rootfs_ipk.bbclass
> @@ -12,6 +12,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
>   do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
>   do_rootfs[recrdeptask] += "do_package_write_ipk"
>
> +do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
> +
>   IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite"
>
>   OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"
Mark Hatle - July 2, 2012, 7:49 p.m.
On 7/2/12 2:44 PM, Saul Wold wrote:
> On 06/29/2012 10:07 PM, Mark Hatle wrote:
>> When building an image recipe, you can now build a companion SDK by
>> calling the populate_sdk task:
>>     bitbake -c populate_sdk core-image-minimal
>>
>> Note: there are still issues w/ the SDK not working completely with
>> multilibs.
>>
>> A lock is required between rootfs and populate_sdk activities to prevent
>> configuration file clashes and similar package management problems in ipk
>> and deb based systems.  (RPM already had a lock for a different reason.)
>>
>
> Mark this seems to have broken non-gplv3 builds.  I get the following
> error now:
>
>> NOTE: Resolving any missing task queue dependencies
>> ERROR: Nothing RPROVIDES 'binutils-cross-canadian-i586' (but /intel/poky/distro/meta/recipes-core/tasks/task-cross-canadian.bb RDEPENDS on or otherwise requires it)
>> ERROR: binutils-cross-canadian-i586 was skipped: incompatible with license GPLv3
>> NOTE: Runtime target 'binutils-cross-canadian-i586' is unbuildable, removing...
>> Missing or unbuildable dependency chain was: ['binutils-cross-canadian-i586']
>> NOTE: Runtime target 'task-cross-canadian-i586' is unbuildable, removing...
>> Missing or unbuildable dependency chain was: ['task-cross-canadian-i586', 'binutils-cross-canadian-i586']
>> ERROR: Required build target 'core-image-minimal' has no buildable providers.
>> Missing or unbuildable dependency chain was: ['core-image-minimal', 'task-cross-canadian-i586', 'binutils-cross-canadian-i586']
>>
>> Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

As far as I know, this didn't work before either.  If you are running:

bitbake core-image-minimal (or similar) it should work -exactly- as it did 
before, it's only if you add the -c .... that it will change.

I forgot to mention, this does require the latest version of bitbake to avoid 
adding the SDK dependencies (unless you call the -c populate_sdk, where they are 
added and used.)

--Mark

>
> I am going to hold off on this patch set until this is resolved.
>
> Thanks
>
> 	Sau!
>
>
>> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
>> ---
>>    meta/classes/image.bbclass             |    5 +++++
>>    meta/classes/populate_sdk_base.bbclass |    1 +
>>    meta/classes/populate_sdk_deb.bbclass  |    2 ++
>>    meta/classes/populate_sdk_ipk.bbclass  |    2 ++
>>    meta/classes/rootfs_deb.bbclass        |    2 ++
>>    meta/classes/rootfs_ipk.bbclass        |    2 ++
>>    6 files changed, 14 insertions(+), 0 deletions(-)
>>
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index 4f50376..7e41982 100644
>> --- a/meta/classes/image.bbclass
>> +++ b/meta/classes/image.bbclass
>> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
>>    IMAGETEST ?= "dummy"
>>    inherit imagetest-${IMAGETEST}
>>
>> +inherit populate_sdk_base
>> +
>> +TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
>> +TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY} ${PACKAGE_GROUP_dev-pkgs} ${PACKAGE_GROUP_dbg-pkgs}"
>> +
>>    inherit gzipnative
>>
>>    LICENSE = "MIT"
>> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
>> index 6dc66fb..ed2dca0 100644
>> --- a/meta/classes/populate_sdk_base.bbclass
>> +++ b/meta/classes/populate_sdk_base.bbclass
>> @@ -120,6 +120,7 @@ populate_sdk_log_check() {
>>    	done
>>    }
>>
>> +do_populate_sdk[dirs] = "${TOPDIR}"
>>    do_populate_sdk[nostamp] = "1"
>>    do_populate_sdk[depends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS', True).split()])}"
>>    do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).split()])}"
>> diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
>> index c3b3e0c..9e9e1e1 100644
>> --- a/meta/classes/populate_sdk_deb.bbclass
>> +++ b/meta/classes/populate_sdk_deb.bbclass
>> @@ -6,6 +6,8 @@ DEB_SDK_ARCH = "${@[d.getVar('SDK_ARCH', True), "i386"]\
>>                    [d.getVar('SDK_ARCH', True) in \
>>                    ["x86", "i486", "i586", "i686", "pentium"]]}"
>>
>> +do_populate_sdk[lockfiles] += "${WORKDIR}/deb.lock"
>> +
>>    populate_sdk_post_deb () {
>>
>>    	local target_rootfs=$1
>> diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
>> index aa3efde..4321afb 100644
>> --- a/meta/classes/populate_sdk_ipk.bbclass
>> +++ b/meta/classes/populate_sdk_ipk.bbclass
>> @@ -1,6 +1,8 @@
>>    do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
>>    do_populate_sdk[recrdeptask] += "do_package_write_ipk"
>>
>> +do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
>> +
>>    populate_sdk_ipk() {
>>
>>    	rm -f ${IPKGCONF_TARGET}
>> diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
>> index 6c9767f..4ea71da 100644
>> --- a/meta/classes/rootfs_deb.bbclass
>> +++ b/meta/classes/rootfs_deb.bbclass
>> @@ -8,6 +8,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
>>    do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
>>    do_rootfs[recrdeptask] += "do_package_write_deb"
>>
>> +do_rootfs[lockfiles] += "${WORKDIR}/deb.lock"
>> +
>>    DEB_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
>>
>>    opkglibdir = "${localstatedir}/lib/opkg"
>> diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
>> index 1580086..9732385 100644
>> --- a/meta/classes/rootfs_ipk.bbclass
>> +++ b/meta/classes/rootfs_ipk.bbclass
>> @@ -12,6 +12,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
>>    do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
>>    do_rootfs[recrdeptask] += "do_package_write_ipk"
>>
>> +do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
>> +
>>    IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite"
>>
>>    OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"
Saul Wold - July 2, 2012, 8:05 p.m.
On 07/02/2012 12:49 PM, Mark Hatle wrote:
> On 7/2/12 2:44 PM, Saul Wold wrote:
>> On 06/29/2012 10:07 PM, Mark Hatle wrote:
>>> When building an image recipe, you can now build a companion SDK by
>>> calling the populate_sdk task:
>>> bitbake -c populate_sdk core-image-minimal
>>>
>>> Note: there are still issues w/ the SDK not working completely with
>>> multilibs.
>>>
>>> A lock is required between rootfs and populate_sdk activities to prevent
>>> configuration file clashes and similar package management problems in
>>> ipk
>>> and deb based systems. (RPM already had a lock for a different reason.)
>>>
>>
>> Mark this seems to have broken non-gplv3 builds. I get the following
>> error now:
>>
>>> NOTE: Resolving any missing task queue dependencies
>>> ERROR: Nothing RPROVIDES 'binutils-cross-canadian-i586' (but
>>> /intel/poky/distro/meta/recipes-core/tasks/task-cross-canadian.bb
>>> RDEPENDS on or otherwise requires it)
>>> ERROR: binutils-cross-canadian-i586 was skipped: incompatible with
>>> license GPLv3
>>> NOTE: Runtime target 'binutils-cross-canadian-i586' is unbuildable,
>>> removing...
>>> Missing or unbuildable dependency chain was:
>>> ['binutils-cross-canadian-i586']
>>> NOTE: Runtime target 'task-cross-canadian-i586' is unbuildable,
>>> removing...
>>> Missing or unbuildable dependency chain was:
>>> ['task-cross-canadian-i586', 'binutils-cross-canadian-i586']
>>> ERROR: Required build target 'core-image-minimal' has no buildable
>>> providers.
>>> Missing or unbuildable dependency chain was: ['core-image-minimal',
>>> 'task-cross-canadian-i586', 'binutils-cross-canadian-i586']
>>>
>>> Summary: There were 2 ERROR messages shown, returning a non-zero exit
>>> code.
>
> As far as I know, this didn't work before either. If you are running:
>
> bitbake core-image-minimal (or similar) it should work -exactly- as it
> did before, it's only if you add the -c .... that it will change.
>
I just did a git bisect and it works fine without your change and fails 
with your change.  Not sure what you mean with the -c

> I forgot to mention, this does require the latest version of bitbake to
> avoid adding the SDK dependencies (unless you call the -c populate_sdk,
> where they are added and used.)
>
Latest bitbake testing using poky-contrib/stage/master_under_test

Sau!

> --Mark
>
>>
>> I am going to hold off on this patch set until this is resolved.
>>
>> Thanks
>>
>> Sau!
>>
>>
>>> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
>>> ---
>>> meta/classes/image.bbclass | 5 +++++
>>> meta/classes/populate_sdk_base.bbclass | 1 +
>>> meta/classes/populate_sdk_deb.bbclass | 2 ++
>>> meta/classes/populate_sdk_ipk.bbclass | 2 ++
>>> meta/classes/rootfs_deb.bbclass | 2 ++
>>> meta/classes/rootfs_ipk.bbclass | 2 ++
>>> 6 files changed, 14 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>> index 4f50376..7e41982 100644
>>> --- a/meta/classes/image.bbclass
>>> +++ b/meta/classes/image.bbclass
>>> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
>>> IMAGETEST ?= "dummy"
>>> inherit imagetest-${IMAGETEST}
>>>
>>> +inherit populate_sdk_base
>>> +
>>> +TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
>>> +TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY}
>>> ${PACKAGE_GROUP_dev-pkgs} ${PACKAGE_GROUP_dbg-pkgs}"
>>> +
>>> inherit gzipnative
>>>
>>> LICENSE = "MIT"
>>> diff --git a/meta/classes/populate_sdk_base.bbclass
>>> b/meta/classes/populate_sdk_base.bbclass
>>> index 6dc66fb..ed2dca0 100644
>>> --- a/meta/classes/populate_sdk_base.bbclass
>>> +++ b/meta/classes/populate_sdk_base.bbclass
>>> @@ -120,6 +120,7 @@ populate_sdk_log_check() {
>>> done
>>> }
>>>
>>> +do_populate_sdk[dirs] = "${TOPDIR}"
>>> do_populate_sdk[nostamp] = "1"
>>> do_populate_sdk[depends] = "${@' '.join([x + ':do_populate_sysroot'
>>> for x in d.getVar('SDK_DEPENDS', True).split()])}"
>>> do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot'
>>> for x in d.getVar('SDK_RDEPENDS', True).split()])}"
>>> diff --git a/meta/classes/populate_sdk_deb.bbclass
>>> b/meta/classes/populate_sdk_deb.bbclass
>>> index c3b3e0c..9e9e1e1 100644
>>> --- a/meta/classes/populate_sdk_deb.bbclass
>>> +++ b/meta/classes/populate_sdk_deb.bbclass
>>> @@ -6,6 +6,8 @@ DEB_SDK_ARCH = "${@[d.getVar('SDK_ARCH', True), "i386"]\
>>> [d.getVar('SDK_ARCH', True) in \
>>> ["x86", "i486", "i586", "i686", "pentium"]]}"
>>>
>>> +do_populate_sdk[lockfiles] += "${WORKDIR}/deb.lock"
>>> +
>>> populate_sdk_post_deb () {
>>>
>>> local target_rootfs=$1
>>> diff --git a/meta/classes/populate_sdk_ipk.bbclass
>>> b/meta/classes/populate_sdk_ipk.bbclass
>>> index aa3efde..4321afb 100644
>>> --- a/meta/classes/populate_sdk_ipk.bbclass
>>> +++ b/meta/classes/populate_sdk_ipk.bbclass
>>> @@ -1,6 +1,8 @@
>>> do_populate_sdk[depends] += "opkg-native:do_populate_sysroot
>>> opkg-utils-native:do_populate_sysroot"
>>> do_populate_sdk[recrdeptask] += "do_package_write_ipk"
>>>
>>> +do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
>>> +
>>> populate_sdk_ipk() {
>>>
>>> rm -f ${IPKGCONF_TARGET}
>>> diff --git a/meta/classes/rootfs_deb.bbclass
>>> b/meta/classes/rootfs_deb.bbclass
>>> index 6c9767f..4ea71da 100644
>>> --- a/meta/classes/rootfs_deb.bbclass
>>> +++ b/meta/classes/rootfs_deb.bbclass
>>> @@ -8,6 +8,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
>>> do_rootfs[depends] += "dpkg-native:do_populate_sysroot
>>> apt-native:do_populate_sysroot"
>>> do_rootfs[recrdeptask] += "do_package_write_deb"
>>>
>>> +do_rootfs[lockfiles] += "${WORKDIR}/deb.lock"
>>> +
>>> DEB_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
>>>
>>> opkglibdir = "${localstatedir}/lib/opkg"
>>> diff --git a/meta/classes/rootfs_ipk.bbclass
>>> b/meta/classes/rootfs_ipk.bbclass
>>> index 1580086..9732385 100644
>>> --- a/meta/classes/rootfs_ipk.bbclass
>>> +++ b/meta/classes/rootfs_ipk.bbclass
>>> @@ -12,6 +12,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP = "run-postinsts"
>>> do_rootfs[depends] += "opkg-native:do_populate_sysroot
>>> opkg-utils-native:do_populate_sysroot"
>>> do_rootfs[recrdeptask] += "do_package_write_ipk"
>>>
>>> +do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
>>> +
>>> IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite"
>>>
>>> OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk;
>>> package_generate_ipkg_conf"
>
>
>
>
Phil Blundell - July 2, 2012, 8:12 p.m.
On Sat, 2012-06-30 at 00:07 -0500, Mark Hatle wrote:
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 4f50376..7e41982 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
>  IMAGETEST ?= "dummy"
>  inherit imagetest-${IMAGETEST}
>  
> +inherit populate_sdk_base

This seems to haul a vast amount of stuff into image.bbclass.  Is it
really necessary to have all that in there by default?

p.
Mark Hatle - July 2, 2012, 8:32 p.m.
On 7/2/12 3:12 PM, Phil Blundell wrote:
> On Sat, 2012-06-30 at 00:07 -0500, Mark Hatle wrote:
>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>> index 4f50376..7e41982 100644
>> --- a/meta/classes/image.bbclass
>> +++ b/meta/classes/image.bbclass
>> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
>>   IMAGETEST ?= "dummy"
>>   inherit imagetest-${IMAGETEST}
>>
>> +inherit populate_sdk_base
>
> This seems to haul a vast amount of stuff into image.bbclass.  Is it
> really necessary to have all that in there by default?

Yes, in order to build an SDK that matches an image, it is.

We need to have all of the code that is needed for both IMAGE and SDK 
generation.  The SDK code is only active if and only if you call the 
populate_sdk task.

--Mark

> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Phil Blundell - July 2, 2012, 9:05 p.m.
On Mon, 2012-07-02 at 15:32 -0500, Mark Hatle wrote:
> On 7/2/12 3:12 PM, Phil Blundell wrote:
> > On Sat, 2012-06-30 at 00:07 -0500, Mark Hatle wrote:
> >> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> >> index 4f50376..7e41982 100644
> >> --- a/meta/classes/image.bbclass
> >> +++ b/meta/classes/image.bbclass
> >> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
> >>   IMAGETEST ?= "dummy"
> >>   inherit imagetest-${IMAGETEST}
> >>
> >> +inherit populate_sdk_base
> >
> > This seems to haul a vast amount of stuff into image.bbclass.  Is it
> > really necessary to have all that in there by default?
> 
> Yes, in order to build an SDK that matches an image, it is.
> 
> We need to have all of the code that is needed for both IMAGE and SDK 
> generation.  The SDK code is only active if and only if you call the 
> populate_sdk task.

Can the SDK bits not live in another class which is applied on top of
the images via BBCLASSEXTEND or some such?  I don't entirely understand
why this all needs to be in image.bbclass if, as you say, it's inactive
by default.  

The code itself looks harmless enough to a casual inspection, but the
increased number of nested "inherits" does make it rather more difficult
to understand what's going on, since you have to inspect all of the
inherited files to understand whether or not they are doing anything.

If we really are going to have this included in image.bbclass, though,
then it might be worth trying to eliminate the duplicate definitions
between image.bbclass and populate_sdk{_base}.bbclass.  I think PID and
EXCLUDE_FROM_WORLD, at least, are defined in both places and I suspect
there are probably some more. 

p.
Mark Hatle - July 2, 2012, 9:37 p.m.
On 7/2/12 4:05 PM, Phil Blundell wrote:
> On Mon, 2012-07-02 at 15:32 -0500, Mark Hatle wrote:
>> On 7/2/12 3:12 PM, Phil Blundell wrote:
>>> On Sat, 2012-06-30 at 00:07 -0500, Mark Hatle wrote:
>>>> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
>>>> index 4f50376..7e41982 100644
>>>> --- a/meta/classes/image.bbclass
>>>> +++ b/meta/classes/image.bbclass
>>>> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
>>>>    IMAGETEST ?= "dummy"
>>>>    inherit imagetest-${IMAGETEST}
>>>>
>>>> +inherit populate_sdk_base
>>>
>>> This seems to haul a vast amount of stuff into image.bbclass.  Is it
>>> really necessary to have all that in there by default?
>>
>> Yes, in order to build an SDK that matches an image, it is.
>>
>> We need to have all of the code that is needed for both IMAGE and SDK
>> generation.  The SDK code is only active if and only if you call the
>> populate_sdk task.
>
> Can the SDK bits not live in another class which is applied on top of
> the images via BBCLASSEXTEND or some such?  I don't entirely understand
> why this all needs to be in image.bbclass if, as you say, it's inactive
> by default.

In order to build an SDK that matches an images behavior, we need information 
that can only be supplied from an image recipe, and corresponding image.bbclass 
processing.  Once we have that information, then we can generate an SDK.

The SDK code needs to be included into this stream in order to get the 
information for all possible image types, otherwise we'd have to modify each 
image type that you might possibly want an SDK for.  I believe that is 
unreasonable, since if it works for one image type, why shouldn't it work for 
all of them.

The code is not enabled by default, i.e. in the main task order, specifically to 
preserve existing behavior for the majority of users who don't want a matching 
SDK each time they build an image.  (Building an SDK usually involves building 
somewhere around 800-1000 extra tasks, depending on configuration.)

The SDK code is only enabled when the bitbake -c populate_sdk <image recipe> is 
called.  This also avoids all of the standard tasks from the image recipe.

> The code itself looks harmless enough to a casual inspection, but the
> increased number of nested "inherits" does make it rather more difficult
> to understand what's going on, since you have to inspect all of the
> inherited files to understand whether or not they are doing anything.

The image class and populate_sdk_base class are designed to continue to be 
managed and handled separately from a development point of view.  The only 
interconnection is (in image.bbclass) the definiton of:

TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY} 
${PACKAGE_GROUP_dev-pkgs} ${PACKAGE_GROUP_dbg-pkgs}"

(note: the PACKAGE_GROUP_*, PACKAGE_INSTALL and PACKAGE_INSTALL_ATTEMPTONLY are 
the items that are only known by the image recipe/image.bbclass..)

If you are not using the SDK, the values get set and ignored.

> If we really are going to have this included in image.bbclass, though,
> then it might be worth trying to eliminate the duplicate definitions
> between image.bbclass and populate_sdk{_base}.bbclass.  I think PID and
> EXCLUDE_FROM_WORLD, at least, are defined in both places and I suspect
> there are probably some more.

If these duplications were removed, then the standalone SDKs such as 
meta-toolchain or meta-toolchain-gmae would fail.  By leaving them there, the 
behaviors are kept in sync, those values happen to be the same in both, and it 
allows the SDK to continue to be used separately as it has always been.

We could conceivable remove them from the image.bbclass, but if someone decides 
later to break apart this code -- then they'll have to re-add them to get the 
desired behavior.  I felt it was safer to leave the image and populate_sdk as 
complete as possible.

--Mark

> p.
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
Saul Wold - July 3, 2012, 11:47 p.m.
On 06/29/2012 10:07 PM, Mark Hatle wrote:
> When building an image recipe, you can now build a companion SDK by
> calling the populate_sdk task:
>    bitbake -c populate_sdk core-image-minimal
>
> Note: there are still issues w/ the SDK not working completely with
> multilibs.

So this does break the default multi-lib build also, I thought it was a 
transient problem at first, but it's very reproducible.

Add these to your local.conf
require conf/multilib.conf
MULTILIBS = "multilib:lib32"
DEFAULTTUNE_virtclass-multilib-lib32 = "x86"

bitbake lib32-core-image-minimal

Then wait and:

> ERROR: Logfile of failure stored in: /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/work/qemux86_64-poky-linux/lib32-core-image-minimal-1.0-r0/temp/log.do_rootfs.39788
> Log data follows:
> | DEBUG: Executing shell function do_rootfs
> | Generating solve db for /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/deploy/rpm/qemux86_64...
> | Generating solve db for /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/deploy/rpm/x86_64...
> | Generating solve db for /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/deploy/rpm/all...
> | Generating solve db for /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/deploy/rpm/qemux86_64...
> | Generating solve db for /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/deploy/rpm/all...
> | Generating solve db for /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/deploy/rpm/all...
> | Processing lib32-task-core-boot...
> | Unable to find package lib32-task-core-boot (task-core-boot)!
> | ERROR: Function failed: do_rootfs (see /srv/ssd/sgw_ab/yocto-autobuilder/yocto-slave/nightly-multilib/build/build/tmp/work/qemux86_64-poky-linux/lib32-core-image-minimal-1.0-r0/temp/log.do_rootfs.39788 for further information)
> NOTE: package lib32-core-image-minimal-1.0-r0: task do_rootfs: Failed

The rpm seem to exist, but not getting mapped properly??

ls tmp/deploy/rpm/*/*task-core*
tmp/deploy/rpm/lib32_qemux86_64/task-core-boot-1.0-r9.lib32_qemux86_64.rpm

> rpm -q -p tmp/deploy/rpm/lib32_qemux86_64/task-core-boot-1.0-r9.lib32_qemux86_64.rpm --info
> warning: tmp/deploy/rpm/lib32_qemux86_64/task-core-boot-1.0-r9.lib32_qemux86_64.rpm: Header V4 DSA/SHA1 Signature, key ID f72af359: NOKEY
> Name        : task-core-boot               Relocations: (not relocatable)
> Version     : 1.0                               Vendor: (none)
> Release     : r9                            Build Date: Tue 03 Jul 2012 04:03:16 PM PDT
> Install Date: (not installed)               Build Host: yocto-hm1.jf.intel.com
> Group       : base                          Source RPM: task-core-boot-1.0-r9.src.rpm
> Size        : 0                                License: MIT
> Signature   : DSA/SHA1, Tue 03 Jul 2012 04:03:16 PM PDT, Key ID 6a15ede1f72af359
> Packager    : Poky <poky@yoctoproject.org>
> URL         : unknown
> Summary     : lib32-task-core-boot version 1.0-r9
> Description :
> Task for OpenedHand Poky - minimal bootable image
> Distribution: (none)

Other RPM queries yielded nothing or (contains no files)
   -c, --dump, --list, --provides

I hope you are able to look into this a little deeper on Thursday

Thanks
	Sau!

>
> A lock is required between rootfs and populate_sdk activities to prevent
> configuration file clashes and similar package management problems in ipk
> and deb based systems.  (RPM already had a lock for a different reason.)
>
> Signed-off-by: Mark Hatle<mark.hatle@windriver.com>
> ---
>   meta/classes/image.bbclass             |    5 +++++
>   meta/classes/populate_sdk_base.bbclass |    1 +
>   meta/classes/populate_sdk_deb.bbclass  |    2 ++
>   meta/classes/populate_sdk_ipk.bbclass  |    2 ++
>   meta/classes/rootfs_deb.bbclass        |    2 ++
>   meta/classes/rootfs_ipk.bbclass        |    2 ++
>   6 files changed, 14 insertions(+), 0 deletions(-)
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index 4f50376..7e41982 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -3,6 +3,11 @@ inherit rootfs_${IMAGE_PKGTYPE}
>   IMAGETEST ?= "dummy"
>   inherit imagetest-${IMAGETEST}
>
> +inherit populate_sdk_base
> +
> +TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
> +TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY} ${PACKAGE_GROUP_dev-pkgs} ${PACKAGE_GROUP_dbg-pkgs}"
> +
>   inherit gzipnative
>
>   LICENSE = "MIT"
> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index 6dc66fb..ed2dca0 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -120,6 +120,7 @@ populate_sdk_log_check() {
>   	done
>   }
>
> +do_populate_sdk[dirs] = "${TOPDIR}"
>   do_populate_sdk[nostamp] = "1"
>   do_populate_sdk[depends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS', True).split()])}"
>   do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).split()])}"
> diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
> index c3b3e0c..9e9e1e1 100644
> --- a/meta/classes/populate_sdk_deb.bbclass
> +++ b/meta/classes/populate_sdk_deb.bbclass
> @@ -6,6 +6,8 @@ DEB_SDK_ARCH = "${@[d.getVar('SDK_ARCH', True), "i386"]\
>                   [d.getVar('SDK_ARCH', True) in \
>                   ["x86", "i486", "i586", "i686", "pentium"]]}"
>
> +do_populate_sdk[lockfiles] += "${WORKDIR}/deb.lock"
> +
>   populate_sdk_post_deb () {
>
>   	local target_rootfs=$1
> diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
> index aa3efde..4321afb 100644
> --- a/meta/classes/populate_sdk_ipk.bbclass
> +++ b/meta/classes/populate_sdk_ipk.bbclass
> @@ -1,6 +1,8 @@
>   do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
>   do_populate_sdk[recrdeptask] += "do_package_write_ipk"
>
> +do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
> +
>   populate_sdk_ipk() {
>
>   	rm -f ${IPKGCONF_TARGET}
> diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
> index 6c9767f..4ea71da 100644
> --- a/meta/classes/rootfs_deb.bbclass
> +++ b/meta/classes/rootfs_deb.bbclass
> @@ -8,6 +8,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
>   do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
>   do_rootfs[recrdeptask] += "do_package_write_deb"
>
> +do_rootfs[lockfiles] += "${WORKDIR}/deb.lock"
> +
>   DEB_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
>
>   opkglibdir = "${localstatedir}/lib/opkg"
> diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
> index 1580086..9732385 100644
> --- a/meta/classes/rootfs_ipk.bbclass
> +++ b/meta/classes/rootfs_ipk.bbclass
> @@ -12,6 +12,8 @@ ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
>   do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
>   do_rootfs[recrdeptask] += "do_package_write_ipk"
>
> +do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
> +
>   IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite"
>
>   OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"

Patch

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 4f50376..7e41982 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -3,6 +3,11 @@  inherit rootfs_${IMAGE_PKGTYPE}
 IMAGETEST ?= "dummy"
 inherit imagetest-${IMAGETEST}
 
+inherit populate_sdk_base
+
+TOOLCHAIN_TARGET_TASK += "${PACKAGE_INSTALL}"
+TOOLCHAIN_TARGET_TASK_ATTEMPTONLY += "${PACKAGE_INSTALL_ATTEMPTONLY} ${PACKAGE_GROUP_dev-pkgs} ${PACKAGE_GROUP_dbg-pkgs}"
+
 inherit gzipnative
 
 LICENSE = "MIT"
diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 6dc66fb..ed2dca0 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -120,6 +120,7 @@  populate_sdk_log_check() {
 	done
 }
 
+do_populate_sdk[dirs] = "${TOPDIR}"
 do_populate_sdk[nostamp] = "1"
 do_populate_sdk[depends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_DEPENDS', True).split()])}"
 do_populate_sdk[rdepends] = "${@' '.join([x + ':do_populate_sysroot' for x in d.getVar('SDK_RDEPENDS', True).split()])}"
diff --git a/meta/classes/populate_sdk_deb.bbclass b/meta/classes/populate_sdk_deb.bbclass
index c3b3e0c..9e9e1e1 100644
--- a/meta/classes/populate_sdk_deb.bbclass
+++ b/meta/classes/populate_sdk_deb.bbclass
@@ -6,6 +6,8 @@  DEB_SDK_ARCH = "${@[d.getVar('SDK_ARCH', True), "i386"]\
                 [d.getVar('SDK_ARCH', True) in \
                 ["x86", "i486", "i586", "i686", "pentium"]]}"
 
+do_populate_sdk[lockfiles] += "${WORKDIR}/deb.lock"
+
 populate_sdk_post_deb () {
 
 	local target_rootfs=$1
diff --git a/meta/classes/populate_sdk_ipk.bbclass b/meta/classes/populate_sdk_ipk.bbclass
index aa3efde..4321afb 100644
--- a/meta/classes/populate_sdk_ipk.bbclass
+++ b/meta/classes/populate_sdk_ipk.bbclass
@@ -1,6 +1,8 @@ 
 do_populate_sdk[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
 do_populate_sdk[recrdeptask] += "do_package_write_ipk"
 
+do_populate_sdk[lockfiles] += "${WORKDIR}/ipk.lock"
+
 populate_sdk_ipk() {
 
 	rm -f ${IPKGCONF_TARGET}
diff --git a/meta/classes/rootfs_deb.bbclass b/meta/classes/rootfs_deb.bbclass
index 6c9767f..4ea71da 100644
--- a/meta/classes/rootfs_deb.bbclass
+++ b/meta/classes/rootfs_deb.bbclass
@@ -8,6 +8,8 @@  ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
 do_rootfs[depends] += "dpkg-native:do_populate_sysroot apt-native:do_populate_sysroot"
 do_rootfs[recrdeptask] += "do_package_write_deb"
 
+do_rootfs[lockfiles] += "${WORKDIR}/deb.lock"
+
 DEB_POSTPROCESS_COMMANDS = "rootfs_install_all_locales; "
 
 opkglibdir = "${localstatedir}/lib/opkg"
diff --git a/meta/classes/rootfs_ipk.bbclass b/meta/classes/rootfs_ipk.bbclass
index 1580086..9732385 100644
--- a/meta/classes/rootfs_ipk.bbclass
+++ b/meta/classes/rootfs_ipk.bbclass
@@ -12,6 +12,8 @@  ROOTFS_PKGMANAGE_BOOTSTRAP  = "run-postinsts"
 do_rootfs[depends] += "opkg-native:do_populate_sysroot opkg-utils-native:do_populate_sysroot"
 do_rootfs[recrdeptask] += "do_package_write_ipk"
 
+do_rootfs[lockfiles] += "${WORKDIR}/ipk.lock"
+
 IPKG_ARGS = "-f ${IPKGCONF_TARGET} -o ${IMAGE_ROOTFS} --force-overwrite"
 
 OPKG_PREPROCESS_COMMANDS = "package_update_index_ipk; package_generate_ipkg_conf"