All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] toaster: add license manifest path to database
@ 2014-03-07 14:23 Cristiana Voicu
  2014-03-11 12:23 ` Damian, Alexandru
  0 siblings, 1 reply; 6+ messages in thread
From: Cristiana Voicu @ 2014-03-07 14:23 UTC (permalink / raw)
  To: toaster

In order to obtain DEPLOY_DIR and IMAGE_NAME, a function was added
to toaster.bbclass to intercept the end of rootfs.
The information is added to a metadata event. Based on image_name,
the target is obtained, and then the path is added in the database.

[YOCTO #5649]
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
---
 bitbake/lib/bb/ui/buildinfohelper.py |   14 ++++++++++++++
 bitbake/lib/bb/ui/toasterui.py       |    2 ++
 meta/classes/toaster.bbclass         |   12 ++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 5060a21..cf31872 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -92,6 +92,10 @@ class ORMWrapper(object):
         build.outcome = outcome
         build.save()
 
+    def update_target_object(self, target, license_manifest_path):
+
+        target.license_manifest_path = license_manifest_path
+        target.save()
 
     def get_update_task_object(self, task_information, must_exist = False):
         assert 'build' in task_information
@@ -623,6 +627,16 @@ class BuildInfoHelper(object):
         if 'build' in self.internal_state:
             self.orm_wrapper.update_build_object(self.internal_state['build'], errors, warnings, taskfailures)
 
+
+    def store_license_manifest_path(self, event):
+        deploy_dir = event.data['deploy_dir_image']
+        image_name =  event.data['image_name']
+        path = deploy_dir + "/licenses/" + image_name + "/"
+        for target in self.internal_state['targets']:
+            if target.target in image_name:
+                self.orm_wrapper.update_target_object(target, path)
+
+
     def store_started_task(self, event):
         assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted, bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
         assert 'taskfile' in vars(event)
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index e469d93..99a8c71 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -241,6 +241,8 @@ def main(server, eventHandler, params ):
                     buildinfohelper.store_tasks_stats(event)
                 if event.type == "ImagePkgList":
                     buildinfohelper.store_target_package_data(event)
+                if event.type == "LicenseManifestPath":
+                    buildinfohelper.store_license_manifest_path(event)
                 continue
 
             # ignore
diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index ddfceb5..563b1f7 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -296,6 +296,17 @@ python toaster_buildhistory_dump() {
 
 }
 
+# dump information related to license manifest path
+
+python toaster_licensemanifest_dump() {
+    deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
+    image_name = d.getVar('IMAGE_NAME', True);
+
+    data = { 'deploy_dir_image' : deploy_dir_image, 'image_name' : image_name }
+
+    bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath", data), d)
+}
+
 # set event handlers
 addhandler toaster_layerinfo_dumpdata
 toaster_layerinfo_dumpdata[eventmask] = "bb.event.TreeDataPreparationCompleted"
@@ -308,3 +319,4 @@ toaster_buildhistory_dump[eventmask] = "bb.event.BuildCompleted"
 do_package[postfuncs] += "toaster_package_dumpdata "
 
 do_rootfs[postfuncs] += "toaster_image_dumpdata "
+do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: add license manifest path to database
  2014-03-07 14:23 [PATCH] toaster: add license manifest path to database Cristiana Voicu
@ 2014-03-11 12:23 ` Damian, Alexandru
  2014-03-11 14:31   ` cristiana.voicu
  0 siblings, 1 reply; 6+ messages in thread
From: Damian, Alexandru @ 2014-03-11 12:23 UTC (permalink / raw)
  To: Cristiana Voicu; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 4326 bytes --]

Can you please rebase this patch into two different patches:

- one for meta/ changes
- one for bitbake/ changes

This is needed as they get merged into separate upstreams (poky and bitbake)

Thank you,
Alex


On Fri, Mar 7, 2014 at 2:23 PM, Cristiana Voicu
<cristiana.voicu@intel.com>wrote:

> In order to obtain DEPLOY_DIR and IMAGE_NAME, a function was added
> to toaster.bbclass to intercept the end of rootfs.
> The information is added to a metadata event. Based on image_name,
> the target is obtained, and then the path is added in the database.
>
> [YOCTO #5649]
> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
> ---
>  bitbake/lib/bb/ui/buildinfohelper.py |   14 ++++++++++++++
>  bitbake/lib/bb/ui/toasterui.py       |    2 ++
>  meta/classes/toaster.bbclass         |   12 ++++++++++++
>  3 files changed, 28 insertions(+)
>
> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
> b/bitbake/lib/bb/ui/buildinfohelper.py
> index 5060a21..cf31872 100644
> --- a/bitbake/lib/bb/ui/buildinfohelper.py
> +++ b/bitbake/lib/bb/ui/buildinfohelper.py
> @@ -92,6 +92,10 @@ class ORMWrapper(object):
>          build.outcome = outcome
>          build.save()
>
> +    def update_target_object(self, target, license_manifest_path):
> +
> +        target.license_manifest_path = license_manifest_path
> +        target.save()
>
>      def get_update_task_object(self, task_information, must_exist =
> False):
>          assert 'build' in task_information
> @@ -623,6 +627,16 @@ class BuildInfoHelper(object):
>          if 'build' in self.internal_state:
>
>  self.orm_wrapper.update_build_object(self.internal_state['build'], errors,
> warnings, taskfailures)
>
> +
> +    def store_license_manifest_path(self, event):
> +        deploy_dir = event.data['deploy_dir_image']
> +        image_name =  event.data['image_name']
> +        path = deploy_dir + "/licenses/" + image_name + "/"
> +        for target in self.internal_state['targets']:
> +            if target.target in image_name:
> +                self.orm_wrapper.update_target_object(target, path)
> +
> +
>      def store_started_task(self, event):
>          assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted,
> bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
>          assert 'taskfile' in vars(event)
> diff --git a/bitbake/lib/bb/ui/toasterui.py
> b/bitbake/lib/bb/ui/toasterui.py
> index e469d93..99a8c71 100644
> --- a/bitbake/lib/bb/ui/toasterui.py
> +++ b/bitbake/lib/bb/ui/toasterui.py
> @@ -241,6 +241,8 @@ def main(server, eventHandler, params ):
>                      buildinfohelper.store_tasks_stats(event)
>                  if event.type == "ImagePkgList":
>                      buildinfohelper.store_target_package_data(event)
> +                if event.type == "LicenseManifestPath":
> +                    buildinfohelper.store_license_manifest_path(event)
>                  continue
>
>              # ignore
> diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
> index ddfceb5..563b1f7 100644
> --- a/meta/classes/toaster.bbclass
> +++ b/meta/classes/toaster.bbclass
> @@ -296,6 +296,17 @@ python toaster_buildhistory_dump() {
>
>  }
>
> +# dump information related to license manifest path
> +
> +python toaster_licensemanifest_dump() {
> +    deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
> +    image_name = d.getVar('IMAGE_NAME', True);
> +
> +    data = { 'deploy_dir_image' : deploy_dir_image, 'image_name' :
> image_name }
> +
> +    bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath", data), d)
> +}
> +
>  # set event handlers
>  addhandler toaster_layerinfo_dumpdata
>  toaster_layerinfo_dumpdata[eventmask] =
> "bb.event.TreeDataPreparationCompleted"
> @@ -308,3 +319,4 @@ toaster_buildhistory_dump[eventmask] =
> "bb.event.BuildCompleted"
>  do_package[postfuncs] += "toaster_package_dumpdata "
>
>  do_rootfs[postfuncs] += "toaster_image_dumpdata "
> +do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
> --
> 1.7.9.5
>
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
>



-- 
Alex Damian
Yocto Project
SSG / OTC

[-- Attachment #2: Type: text/html, Size: 5779 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: add license manifest path to database
  2014-03-11 12:23 ` Damian, Alexandru
@ 2014-03-11 14:31   ` cristiana.voicu
  2014-03-12 14:06     ` Damian, Alexandru
  0 siblings, 1 reply; 6+ messages in thread
From: cristiana.voicu @ 2014-03-11 14:31 UTC (permalink / raw)
  To: Damian, Alexandru; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 5085 bytes --]

Hi Alex,

I've created a poky-contrib with these patches because they are in 
conflict with the patch sent earlier to populate image file table. So, 
all the patches can be found there.

The branch is cvoicu/toaster-work.

Thanks,
Cristiana

On 03/11/2014 02:23 PM, Damian, Alexandru wrote:
> Can you please rebase this patch into two different patches:
>
> - one for meta/ changes
> - one for bitbake/ changes
>
> This is needed as they get merged into separate upstreams (poky and 
> bitbake)
>
> Thank you,
> Alex
>
>
> On Fri, Mar 7, 2014 at 2:23 PM, Cristiana Voicu 
> <cristiana.voicu@intel.com <mailto:cristiana.voicu@intel.com>> wrote:
>
>     In order to obtain DEPLOY_DIR and IMAGE_NAME, a function was added
>     to toaster.bbclass to intercept the end of rootfs.
>     The information is added to a metadata event. Based on image_name,
>     the target is obtained, and then the path is added in the database.
>
>     [YOCTO #5649]
>     Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com
>     <mailto:cristiana.voicu@intel.com>>
>     ---
>      bitbake/lib/bb/ui/buildinfohelper.py |   14 ++++++++++++++
>      bitbake/lib/bb/ui/toasterui.py       |    2 ++
>      meta/classes/toaster.bbclass         |   12 ++++++++++++
>      3 files changed, 28 insertions(+)
>
>     diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
>     b/bitbake/lib/bb/ui/buildinfohelper.py
>     index 5060a21..cf31872 100644
>     --- a/bitbake/lib/bb/ui/buildinfohelper.py
>     +++ b/bitbake/lib/bb/ui/buildinfohelper.py
>     @@ -92,6 +92,10 @@ class ORMWrapper(object):
>              build.outcome = outcome
>              build.save()
>
>     +    def update_target_object(self, target, license_manifest_path):
>     +
>     +        target.license_manifest_path = license_manifest_path
>     +        target.save()
>
>          def get_update_task_object(self, task_information, must_exist
>     = False):
>              assert 'build' in task_information
>     @@ -623,6 +627,16 @@ class BuildInfoHelper(object):
>              if 'build' in self.internal_state:
>      self.orm_wrapper.update_build_object(self.internal_state['build'], errors,
>     warnings, taskfailures)
>
>     +
>     +    def store_license_manifest_path(self, event):
>     +        deploy_dir = event.data['deploy_dir_image']
>     +        image_name =  event.data['image_name']
>     +        path = deploy_dir + "/licenses/" + image_name + "/"
>     +        for target in self.internal_state['targets']:
>     +            if target.target in image_name:
>     +  self.orm_wrapper.update_target_object(target, path)
>     +
>     +
>          def store_started_task(self, event):
>              assert isinstance(event,
>     (bb.runqueue.sceneQueueTaskStarted,
>     bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
>              assert 'taskfile' in vars(event)
>     diff --git a/bitbake/lib/bb/ui/toasterui.py
>     b/bitbake/lib/bb/ui/toasterui.py
>     index e469d93..99a8c71 100644
>     --- a/bitbake/lib/bb/ui/toasterui.py
>     +++ b/bitbake/lib/bb/ui/toasterui.py
>     @@ -241,6 +241,8 @@ def main(server, eventHandler, params ):
>      buildinfohelper.store_tasks_stats(event)
>                      if event.type == "ImagePkgList":
>      buildinfohelper.store_target_package_data(event)
>     +                if event.type == "LicenseManifestPath":
>     +  buildinfohelper.store_license_manifest_path(event)
>                      continue
>
>                  # ignore
>     diff --git a/meta/classes/toaster.bbclass
>     b/meta/classes/toaster.bbclass
>     index ddfceb5..563b1f7 100644
>     --- a/meta/classes/toaster.bbclass
>     +++ b/meta/classes/toaster.bbclass
>     @@ -296,6 +296,17 @@ python toaster_buildhistory_dump() {
>
>      }
>
>     +# dump information related to license manifest path
>     +
>     +python toaster_licensemanifest_dump() {
>     +    deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
>     +    image_name = d.getVar('IMAGE_NAME', True);
>     +
>     +    data = { 'deploy_dir_image' : deploy_dir_image, 'image_name'
>     : image_name }
>     +
>     +  bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath",
>     data), d)
>     +}
>     +
>      # set event handlers
>      addhandler toaster_layerinfo_dumpdata
>      toaster_layerinfo_dumpdata[eventmask] =
>     "bb.event.TreeDataPreparationCompleted"
>     @@ -308,3 +319,4 @@ toaster_buildhistory_dump[eventmask] =
>     "bb.event.BuildCompleted"
>      do_package[postfuncs] += "toaster_package_dumpdata "
>
>      do_rootfs[postfuncs] += "toaster_image_dumpdata "
>     +do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
>     --
>     1.7.9.5
>
>     _______________________________________________
>     toaster mailing list
>     toaster@yoctoproject.org <mailto:toaster@yoctoproject.org>
>     https://lists.yoctoproject.org/listinfo/toaster
>
>
>
>
> -- 
> Alex Damian
> Yocto Project
> SSG / OTC


[-- Attachment #2: Type: text/html, Size: 8423 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: add license manifest path to database
  2014-03-11 14:31   ` cristiana.voicu
@ 2014-03-12 14:06     ` Damian, Alexandru
  2014-03-18 16:02       ` cristiana.voicu
  0 siblings, 1 reply; 6+ messages in thread
From: Damian, Alexandru @ 2014-03-12 14:06 UTC (permalink / raw)
  To: cristiana.voicu; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 4972 bytes --]

Taken in for submission.


On Tue, Mar 11, 2014 at 2:31 PM, cristiana.voicu
<cristiana.voicu@intel.com>wrote:

>  Hi Alex,
>
> I've created a poky-contrib with these patches because they are in
> conflict with the patch sent earlier to populate image file table. So, all
> the patches can be found there.
>
> The branch is cvoicu/toaster-work.
>
> Thanks,
> Cristiana
>
>
> On 03/11/2014 02:23 PM, Damian, Alexandru wrote:
>
>  Can you please rebase this patch into two different patches:
>
>  - one for meta/ changes
>  - one for bitbake/ changes
>
> This is needed as they get merged into separate upstreams (poky and
> bitbake)
>
>  Thank you,
> Alex
>
>
> On Fri, Mar 7, 2014 at 2:23 PM, Cristiana Voicu <cristiana.voicu@intel.com
> > wrote:
>
>> In order to obtain DEPLOY_DIR and IMAGE_NAME, a function was added
>> to toaster.bbclass to intercept the end of rootfs.
>> The information is added to a metadata event. Based on image_name,
>> the target is obtained, and then the path is added in the database.
>>
>> [YOCTO #5649]
>> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
>> ---
>>  bitbake/lib/bb/ui/buildinfohelper.py |   14 ++++++++++++++
>>  bitbake/lib/bb/ui/toasterui.py       |    2 ++
>>  meta/classes/toaster.bbclass         |   12 ++++++++++++
>>  3 files changed, 28 insertions(+)
>>
>> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
>> b/bitbake/lib/bb/ui/buildinfohelper.py
>> index 5060a21..cf31872 100644
>> --- a/bitbake/lib/bb/ui/buildinfohelper.py
>> +++ b/bitbake/lib/bb/ui/buildinfohelper.py
>> @@ -92,6 +92,10 @@ class ORMWrapper(object):
>>          build.outcome = outcome
>>          build.save()
>>
>> +    def update_target_object(self, target, license_manifest_path):
>> +
>> +        target.license_manifest_path = license_manifest_path
>> +        target.save()
>>
>>      def get_update_task_object(self, task_information, must_exist =
>> False):
>>          assert 'build' in task_information
>> @@ -623,6 +627,16 @@ class BuildInfoHelper(object):
>>          if 'build' in self.internal_state:
>>
>>  self.orm_wrapper.update_build_object(self.internal_state['build'], errors,
>> warnings, taskfailures)
>>
>> +
>> +    def store_license_manifest_path(self, event):
>> +        deploy_dir = event.data['deploy_dir_image']
>> +        image_name =  event.data['image_name']
>> +        path = deploy_dir + "/licenses/" + image_name + "/"
>> +        for target in self.internal_state['targets']:
>> +            if target.target in image_name:
>> +                self.orm_wrapper.update_target_object(target, path)
>> +
>> +
>>      def store_started_task(self, event):
>>          assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted,
>> bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
>>          assert 'taskfile' in vars(event)
>> diff --git a/bitbake/lib/bb/ui/toasterui.py
>> b/bitbake/lib/bb/ui/toasterui.py
>> index e469d93..99a8c71 100644
>> --- a/bitbake/lib/bb/ui/toasterui.py
>> +++ b/bitbake/lib/bb/ui/toasterui.py
>> @@ -241,6 +241,8 @@ def main(server, eventHandler, params ):
>>                      buildinfohelper.store_tasks_stats(event)
>>                  if event.type == "ImagePkgList":
>>                      buildinfohelper.store_target_package_data(event)
>> +                if event.type == "LicenseManifestPath":
>> +                    buildinfohelper.store_license_manifest_path(event)
>>                  continue
>>
>>              # ignore
>> diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
>> index ddfceb5..563b1f7 100644
>> --- a/meta/classes/toaster.bbclass
>> +++ b/meta/classes/toaster.bbclass
>> @@ -296,6 +296,17 @@ python toaster_buildhistory_dump() {
>>
>>  }
>>
>> +# dump information related to license manifest path
>> +
>> +python toaster_licensemanifest_dump() {
>> +    deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
>> +    image_name = d.getVar('IMAGE_NAME', True);
>> +
>> +    data = { 'deploy_dir_image' : deploy_dir_image, 'image_name' :
>> image_name }
>> +
>> +    bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath", data), d)
>> +}
>> +
>>  # set event handlers
>>  addhandler toaster_layerinfo_dumpdata
>>  toaster_layerinfo_dumpdata[eventmask] =
>> "bb.event.TreeDataPreparationCompleted"
>> @@ -308,3 +319,4 @@ toaster_buildhistory_dump[eventmask] =
>> "bb.event.BuildCompleted"
>>  do_package[postfuncs] += "toaster_package_dumpdata "
>>
>>  do_rootfs[postfuncs] += "toaster_image_dumpdata "
>> +do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> toaster mailing list
>> toaster@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/toaster
>>
>
>
>
> --
> Alex Damian
> Yocto Project
>  SSG / OTC
>
>
>


-- 
Alex Damian
Yocto Project
SSG / OTC

[-- Attachment #2: Type: text/html, Size: 8839 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: add license manifest path to database
  2014-03-12 14:06     ` Damian, Alexandru
@ 2014-03-18 16:02       ` cristiana.voicu
  2014-03-18 16:15         ` Damian, Alexandru
  0 siblings, 1 reply; 6+ messages in thread
From: cristiana.voicu @ 2014-03-18 16:02 UTC (permalink / raw)
  To: Damian, Alexandru; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 6366 bytes --]

On 03/12/2014 04:06 PM, Damian, Alexandru wrote:
> Taken in for submission.
Hi Alex,

There are 2 patches needed to populate license.manifest file, but only 
one is on master. Can you please include in the next submission the 
other one ( 
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=cvoicu/toaster-work&id=b0397121ab1f529ba9e52e96f57e328663852483) 
?

Thanks,
Cristiana
>
>
> On Tue, Mar 11, 2014 at 2:31 PM, cristiana.voicu 
> <cristiana.voicu@intel.com <mailto:cristiana.voicu@intel.com>> wrote:
>
>     Hi Alex,
>
>     I've created a poky-contrib with these patches because they are in
>     conflict with the patch sent earlier to populate image file table.
>     So, all the patches can be found there.
>
>     The branch is cvoicu/toaster-work.
>
>     Thanks,
>     Cristiana
>
>
>     On 03/11/2014 02:23 PM, Damian, Alexandru wrote:
>>     Can you please rebase this patch into two different patches:
>>
>>     - one for meta/ changes
>>     - one for bitbake/ changes
>>
>>     This is needed as they get merged into separate upstreams (poky
>>     and bitbake)
>>
>>     Thank you,
>>     Alex
>>
>>
>>     On Fri, Mar 7, 2014 at 2:23 PM, Cristiana Voicu
>>     <cristiana.voicu@intel.com <mailto:cristiana.voicu@intel.com>> wrote:
>>
>>         In order to obtain DEPLOY_DIR and IMAGE_NAME, a function was
>>         added
>>         to toaster.bbclass to intercept the end of rootfs.
>>         The information is added to a metadata event. Based on
>>         image_name,
>>         the target is obtained, and then the path is added in the
>>         database.
>>
>>         [YOCTO #5649]
>>         Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com
>>         <mailto:cristiana.voicu@intel.com>>
>>         ---
>>          bitbake/lib/bb/ui/buildinfohelper.py |   14 ++++++++++++++
>>          bitbake/lib/bb/ui/toasterui.py       |    2 ++
>>          meta/classes/toaster.bbclass         |   12 ++++++++++++
>>          3 files changed, 28 insertions(+)
>>
>>         diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
>>         b/bitbake/lib/bb/ui/buildinfohelper.py
>>         index 5060a21..cf31872 100644
>>         --- a/bitbake/lib/bb/ui/buildinfohelper.py
>>         +++ b/bitbake/lib/bb/ui/buildinfohelper.py
>>         @@ -92,6 +92,10 @@ class ORMWrapper(object):
>>                  build.outcome = outcome
>>                  build.save()
>>
>>         +    def update_target_object(self, target,
>>         license_manifest_path):
>>         +
>>         +        target.license_manifest_path = license_manifest_path
>>         +        target.save()
>>
>>              def get_update_task_object(self, task_information,
>>         must_exist = False):
>>                  assert 'build' in task_information
>>         @@ -623,6 +627,16 @@ class BuildInfoHelper(object):
>>                  if 'build' in self.internal_state:
>>          self.orm_wrapper.update_build_object(self.internal_state['build'],
>>         errors, warnings, taskfailures)
>>
>>         +
>>         +    def store_license_manifest_path(self, event):
>>         +        deploy_dir = event.data['deploy_dir_image']
>>         +        image_name =  event.data['image_name']
>>         +        path = deploy_dir + "/licenses/" + image_name + "/"
>>         +        for target in self.internal_state['targets']:
>>         +            if target.target in image_name:
>>         +  self.orm_wrapper.update_target_object(target, path)
>>         +
>>         +
>>              def store_started_task(self, event):
>>                  assert isinstance(event,
>>         (bb.runqueue.sceneQueueTaskStarted,
>>         bb.runqueue.runQueueTaskStarted,
>>         bb.runqueue.runQueueTaskSkipped))
>>                  assert 'taskfile' in vars(event)
>>         diff --git a/bitbake/lib/bb/ui/toasterui.py
>>         b/bitbake/lib/bb/ui/toasterui.py
>>         index e469d93..99a8c71 100644
>>         --- a/bitbake/lib/bb/ui/toasterui.py
>>         +++ b/bitbake/lib/bb/ui/toasterui.py
>>         @@ -241,6 +241,8 @@ def main(server, eventHandler, params ):
>>          buildinfohelper.store_tasks_stats(event)
>>                          if event.type == "ImagePkgList":
>>          buildinfohelper.store_target_package_data(event)
>>         +                if event.type == "LicenseManifestPath":
>>         +  buildinfohelper.store_license_manifest_path(event)
>>                          continue
>>
>>                      # ignore
>>         diff --git a/meta/classes/toaster.bbclass
>>         b/meta/classes/toaster.bbclass
>>         index ddfceb5..563b1f7 100644
>>         --- a/meta/classes/toaster.bbclass
>>         +++ b/meta/classes/toaster.bbclass
>>         @@ -296,6 +296,17 @@ python toaster_buildhistory_dump() {
>>
>>          }
>>
>>         +# dump information related to license manifest path
>>         +
>>         +python toaster_licensemanifest_dump() {
>>         +    deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
>>         +    image_name = d.getVar('IMAGE_NAME', True);
>>         +
>>         +    data = { 'deploy_dir_image' : deploy_dir_image,
>>         'image_name' : image_name }
>>         +
>>         +
>>          bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath",
>>         data), d)
>>         +}
>>         +
>>          # set event handlers
>>          addhandler toaster_layerinfo_dumpdata
>>          toaster_layerinfo_dumpdata[eventmask] =
>>         "bb.event.TreeDataPreparationCompleted"
>>         @@ -308,3 +319,4 @@ toaster_buildhistory_dump[eventmask] =
>>         "bb.event.BuildCompleted"
>>          do_package[postfuncs] += "toaster_package_dumpdata "
>>
>>          do_rootfs[postfuncs] += "toaster_image_dumpdata "
>>         +do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
>>         --
>>         1.7.9.5
>>
>>         _______________________________________________
>>         toaster mailing list
>>         toaster@yoctoproject.org <mailto:toaster@yoctoproject.org>
>>         https://lists.yoctoproject.org/listinfo/toaster
>>
>>
>>
>>
>>     -- 
>>     Alex Damian
>>     Yocto Project
>>     SSG / OTC
>
>
>
>
> -- 
> Alex Damian
> Yocto Project
> SSG / OTC


[-- Attachment #2: Type: text/html, Size: 13776 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] toaster: add license manifest path to database
  2014-03-18 16:02       ` cristiana.voicu
@ 2014-03-18 16:15         ` Damian, Alexandru
  0 siblings, 0 replies; 6+ messages in thread
From: Damian, Alexandru @ 2014-03-18 16:15 UTC (permalink / raw)
  To: cristiana.voicu; +Cc: toaster

[-- Attachment #1: Type: text/plain, Size: 5825 bytes --]

Thank you for looking this up.

This patch was submitted yesterday to the oe-core mail list, I'm waiting
for the integration.

Alex


On Tue, Mar 18, 2014 at 4:02 PM, cristiana.voicu
<cristiana.voicu@intel.com>wrote:

>  On 03/12/2014 04:06 PM, Damian, Alexandru wrote:
>
>  Taken in for submission.
>
> Hi Alex,
>
> There are 2 patches needed to populate license.manifest file, but only one
> is on master. Can you please include in the next submission the other one (
> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=cvoicu/toaster-work&id=b0397121ab1f529ba9e52e96f57e328663852483)
> ?
>
> Thanks,
> Cristiana
>
>
>
> On Tue, Mar 11, 2014 at 2:31 PM, cristiana.voicu <
> cristiana.voicu@intel.com> wrote:
>
>>  Hi Alex,
>>
>> I've created a poky-contrib with these patches because they are in
>> conflict with the patch sent earlier to populate image file table. So, all
>> the patches can be found there.
>>
>> The branch is cvoicu/toaster-work.
>>
>> Thanks,
>> Cristiana
>>
>>
>> On 03/11/2014 02:23 PM, Damian, Alexandru wrote:
>>
>>  Can you please rebase this patch into two different patches:
>>
>>  - one for meta/ changes
>>  - one for bitbake/ changes
>>
>> This is needed as they get merged into separate upstreams (poky and
>> bitbake)
>>
>>  Thank you,
>> Alex
>>
>>
>> On Fri, Mar 7, 2014 at 2:23 PM, Cristiana Voicu <
>> cristiana.voicu@intel.com> wrote:
>>
>>> In order to obtain DEPLOY_DIR and IMAGE_NAME, a function was added
>>> to toaster.bbclass to intercept the end of rootfs.
>>> The information is added to a metadata event. Based on image_name,
>>> the target is obtained, and then the path is added in the database.
>>>
>>> [YOCTO #5649]
>>> Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
>>> ---
>>>  bitbake/lib/bb/ui/buildinfohelper.py |   14 ++++++++++++++
>>>  bitbake/lib/bb/ui/toasterui.py       |    2 ++
>>>  meta/classes/toaster.bbclass         |   12 ++++++++++++
>>>  3 files changed, 28 insertions(+)
>>>
>>> diff --git a/bitbake/lib/bb/ui/buildinfohelper.py
>>> b/bitbake/lib/bb/ui/buildinfohelper.py
>>> index 5060a21..cf31872 100644
>>> --- a/bitbake/lib/bb/ui/buildinfohelper.py
>>> +++ b/bitbake/lib/bb/ui/buildinfohelper.py
>>> @@ -92,6 +92,10 @@ class ORMWrapper(object):
>>>          build.outcome = outcome
>>>          build.save()
>>>
>>> +    def update_target_object(self, target, license_manifest_path):
>>> +
>>> +        target.license_manifest_path = license_manifest_path
>>> +        target.save()
>>>
>>>      def get_update_task_object(self, task_information, must_exist =
>>> False):
>>>          assert 'build' in task_information
>>> @@ -623,6 +627,16 @@ class BuildInfoHelper(object):
>>>          if 'build' in self.internal_state:
>>>
>>>  self.orm_wrapper.update_build_object(self.internal_state['build'], errors,
>>> warnings, taskfailures)
>>>
>>> +
>>> +    def store_license_manifest_path(self, event):
>>> +        deploy_dir = event.data['deploy_dir_image']
>>> +        image_name =  event.data['image_name']
>>> +        path = deploy_dir + "/licenses/" + image_name + "/"
>>> +        for target in self.internal_state['targets']:
>>> +            if target.target in image_name:
>>> +                self.orm_wrapper.update_target_object(target, path)
>>> +
>>> +
>>>      def store_started_task(self, event):
>>>          assert isinstance(event, (bb.runqueue.sceneQueueTaskStarted,
>>> bb.runqueue.runQueueTaskStarted, bb.runqueue.runQueueTaskSkipped))
>>>          assert 'taskfile' in vars(event)
>>> diff --git a/bitbake/lib/bb/ui/toasterui.py
>>> b/bitbake/lib/bb/ui/toasterui.py
>>> index e469d93..99a8c71 100644
>>> --- a/bitbake/lib/bb/ui/toasterui.py
>>> +++ b/bitbake/lib/bb/ui/toasterui.py
>>> @@ -241,6 +241,8 @@ def main(server, eventHandler, params ):
>>>                      buildinfohelper.store_tasks_stats(event)
>>>                  if event.type == "ImagePkgList":
>>>                      buildinfohelper.store_target_package_data(event)
>>> +                if event.type == "LicenseManifestPath":
>>> +                    buildinfohelper.store_license_manifest_path(event)
>>>                  continue
>>>
>>>              # ignore
>>> diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
>>> index ddfceb5..563b1f7 100644
>>> --- a/meta/classes/toaster.bbclass
>>> +++ b/meta/classes/toaster.bbclass
>>> @@ -296,6 +296,17 @@ python toaster_buildhistory_dump() {
>>>
>>>  }
>>>
>>> +# dump information related to license manifest path
>>> +
>>> +python toaster_licensemanifest_dump() {
>>> +    deploy_dir_image = d.getVar('DEPLOY_DIR_IMAGE', True);
>>> +    image_name = d.getVar('IMAGE_NAME', True);
>>> +
>>> +    data = { 'deploy_dir_image' : deploy_dir_image, 'image_name' :
>>> image_name }
>>> +
>>> +    bb.event.fire(bb.event.MetadataEvent("LicenseManifestPath", data),
>>> d)
>>> +}
>>> +
>>>  # set event handlers
>>>  addhandler toaster_layerinfo_dumpdata
>>>  toaster_layerinfo_dumpdata[eventmask] =
>>> "bb.event.TreeDataPreparationCompleted"
>>> @@ -308,3 +319,4 @@ toaster_buildhistory_dump[eventmask] =
>>> "bb.event.BuildCompleted"
>>>  do_package[postfuncs] += "toaster_package_dumpdata "
>>>
>>>  do_rootfs[postfuncs] += "toaster_image_dumpdata "
>>> +do_rootfs[postfuncs] += "toaster_licensemanifest_dump "
>>> --
>>> 1.7.9.5
>>>
>>> _______________________________________________
>>> toaster mailing list
>>> toaster@yoctoproject.org
>>> https://lists.yoctoproject.org/listinfo/toaster
>>>
>>
>>
>>
>> --
>> Alex Damian
>> Yocto Project
>>  SSG / OTC
>>
>>
>>
>
>
> --
> Alex Damian
> Yocto Project
>  SSG / OTC
>
>
>


-- 
Alex Damian
Yocto Project
SSG / OTC

[-- Attachment #2: Type: text/html, Size: 14023 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-18 16:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-07 14:23 [PATCH] toaster: add license manifest path to database Cristiana Voicu
2014-03-11 12:23 ` Damian, Alexandru
2014-03-11 14:31   ` cristiana.voicu
2014-03-12 14:06     ` Damian, Alexandru
2014-03-18 16:02       ` cristiana.voicu
2014-03-18 16:15         ` Damian, Alexandru

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.