All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rootfs-postcommaneds: put image testdata under sstate control
@ 2018-03-09 13:00 André Draszik
  2018-03-21 16:31 ` [PATCH v2] rootfs-postcommands: " André Draszik
  2018-08-20  8:15 ` [PATCH v3] " André Draszik
  0 siblings, 2 replies; 8+ messages in thread
From: André Draszik @ 2018-03-09 13:00 UTC (permalink / raw)
  To: openembedded-core

From: André Draszik <andre.draszik@jci.com>

The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
thus bypassing sstate, which results in an ever growing list
of files.

Write them to IMGDEPLOYDIR instead, so as to benefit from the
automatic management via sstate.

Signed-off-by: André Draszik <andre.draszik@jci.com>
---
 meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index a4e627fef8..01eee350b8 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -303,17 +303,18 @@ rootfs_sysroot_relativelinks () {
 python write_image_test_data() {
     from oe.data import export2json
 
-    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_NAME'))
-    testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
+    deploy_dir = d.getVar('IMGDEPLOYDIR')
+    link_name = d.getVar('IMAGE_LINK_NAME')
+    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" % d.getVar('IMAGE_NAME'))
 
-    bb.utils.mkdirhier(os.path.dirname(testdata))
     searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
-    export2json(d, testdata,searchString=searchString,replaceString="")
+    export2json(d, testdata_name, searchString=searchString, replaceString="")
 
-    if testdata_link != testdata:
+    if os.path.exists(testdata_name):
+        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name)
         if os.path.lexists(testdata_link):
-           os.remove(testdata_link)
-        os.symlink(os.path.basename(testdata), testdata_link)
+            os.remove(testdata_link)
+        os.symlink(os.path.basename(testdata_name), testdata_link)
 }
 write_image_test_data[vardepsexclude] += "TOPDIR"
 
-- 
2.16.2



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

* [PATCH v2] rootfs-postcommands: put image testdata under sstate control
  2018-03-09 13:00 [PATCH] rootfs-postcommaneds: put image testdata under sstate control André Draszik
@ 2018-03-21 16:31 ` André Draszik
  2018-05-10  8:05   ` André Draszik
  2018-08-20  8:15 ` [PATCH v3] " André Draszik
  1 sibling, 1 reply; 8+ messages in thread
From: André Draszik @ 2018-03-21 16:31 UTC (permalink / raw)
  To: openembedded-core

From: André Draszik <andre.draszik@jci.com>

The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
thus bypassing sstate, which results in an ever growing list
of files.

Write them to IMGDEPLOYDIR instead, so as to benefit from the
automatic management via sstate.

Signed-off-by: André Draszik <andre.draszik@jci.com>

---
v2: fix typo in subject line
---
 meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index a4e627fef8..01eee350b8 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -303,17 +303,18 @@ rootfs_sysroot_relativelinks () {
 python write_image_test_data() {
     from oe.data import export2json
 
-    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_NAME'))
-    testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
+    deploy_dir = d.getVar('IMGDEPLOYDIR')
+    link_name = d.getVar('IMAGE_LINK_NAME')
+    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" % d.getVar('IMAGE_NAME'))
 
-    bb.utils.mkdirhier(os.path.dirname(testdata))
     searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
-    export2json(d, testdata,searchString=searchString,replaceString="")
+    export2json(d, testdata_name, searchString=searchString, replaceString="")
 
-    if testdata_link != testdata:
+    if os.path.exists(testdata_name):
+        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name)
         if os.path.lexists(testdata_link):
-           os.remove(testdata_link)
-        os.symlink(os.path.basename(testdata), testdata_link)
+            os.remove(testdata_link)
+        os.symlink(os.path.basename(testdata_name), testdata_link)
 }
 write_image_test_data[vardepsexclude] += "TOPDIR"
 
-- 
2.16.2



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

* Re: [PATCH v2] rootfs-postcommands: put image testdata under sstate control
  2018-03-21 16:31 ` [PATCH v2] rootfs-postcommands: " André Draszik
@ 2018-05-10  8:05   ` André Draszik
  2018-05-16  9:57     ` André Draszik
  0 siblings, 1 reply; 8+ messages in thread
From: André Draszik @ 2018-05-10  8:05 UTC (permalink / raw)
  To: openembedded-core

ping

On Wed, 2018-03-21 at 16:31 +0000, André Draszik wrote:
> From: André Draszik <andre.draszik@jci.com>
> 
> The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
> thus bypassing sstate, which results in an ever growing list
> of files.
> 
> Write them to IMGDEPLOYDIR instead, so as to benefit from the
> automatic management via sstate.
> 
> Signed-off-by: André Draszik <andre.draszik@jci.com>
> 
> ---
> v2: fix typo in subject line
> ---
>  meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/meta/classes/rootfs-postcommands.bbclass
> b/meta/classes/rootfs-postcommands.bbclass
> index a4e627fef8..01eee350b8 100644
> --- a/meta/classes/rootfs-postcommands.bbclass
> +++ b/meta/classes/rootfs-postcommands.bbclass
> @@ -303,17 +303,18 @@ rootfs_sysroot_relativelinks () {
>  python write_image_test_data() {
>      from oe.data import export2json
>  
> -    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'),
> d.getVar('IMAGE_NAME'))
> -    testdata_link = "%s/%s.testdata.json" %
> (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
> +    deploy_dir = d.getVar('IMGDEPLOYDIR')
> +    link_name = d.getVar('IMAGE_LINK_NAME')
> +    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" %
> d.getVar('IMAGE_NAME'))
>  
> -    bb.utils.mkdirhier(os.path.dirname(testdata))
>      searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
> -    export2json(d, testdata,searchString=searchString,replaceString="")
> +    export2json(d, testdata_name, searchString=searchString,
> replaceString="")
>  
> -    if testdata_link != testdata:
> +    if os.path.exists(testdata_name):
> +        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" %
> link_name)
>          if os.path.lexists(testdata_link):
> -           os.remove(testdata_link)
> -        os.symlink(os.path.basename(testdata), testdata_link)
> +            os.remove(testdata_link)
> +        os.symlink(os.path.basename(testdata_name), testdata_link)
>  }
>  write_image_test_data[vardepsexclude] += "TOPDIR"
>  


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

* Re: [PATCH v2] rootfs-postcommands: put image testdata under sstate control
  2018-05-10  8:05   ` André Draszik
@ 2018-05-16  9:57     ` André Draszik
  2018-05-17  6:29       ` ChenQi
  2018-08-08 11:56       ` André Draszik
  0 siblings, 2 replies; 8+ messages in thread
From: André Draszik @ 2018-05-16  9:57 UTC (permalink / raw)
  To: openembedded-core

Is there anything wrong with this?

On Thu, 2018-05-10 at 09:05 +0100, André Draszik wrote:
> ping
> 
> On Wed, 2018-03-21 at 16:31 +0000, André Draszik wrote:
> > From: André Draszik <andre.draszik@jci.com>
> > 
> > The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
> > thus bypassing sstate, which results in an ever growing list
> > of files.
> > 
> > Write them to IMGDEPLOYDIR instead, so as to benefit from the
> > automatic management via sstate.
> > 
> > Signed-off-by: André Draszik <andre.draszik@jci.com>
> > 
> > ---
> > v2: fix typo in subject line
> > ---
> >  meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
> >  1 file changed, 8 insertions(+), 7 deletions(-)
> > 
> > diff --git a/meta/classes/rootfs-postcommands.bbclass
> > b/meta/classes/rootfs-postcommands.bbclass
> > index a4e627fef8..01eee350b8 100644
> > --- a/meta/classes/rootfs-postcommands.bbclass
> > +++ b/meta/classes/rootfs-postcommands.bbclass
> > @@ -303,17 +303,18 @@ rootfs_sysroot_relativelinks () {
> >  python write_image_test_data() {
> >      from oe.data import export2json
> >  
> > -    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'),
> > d.getVar('IMAGE_NAME'))
> > -    testdata_link = "%s/%s.testdata.json" %
> > (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
> > +    deploy_dir = d.getVar('IMGDEPLOYDIR')
> > +    link_name = d.getVar('IMAGE_LINK_NAME')
> > +    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" %
> > d.getVar('IMAGE_NAME'))
> >  
> > -    bb.utils.mkdirhier(os.path.dirname(testdata))
> >      searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
> > -    export2json(d, testdata,searchString=searchString,replaceString="")
> > +    export2json(d, testdata_name, searchString=searchString,
> > replaceString="")
> >  
> > -    if testdata_link != testdata:
> > +    if os.path.exists(testdata_name):
> > +        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" %
> > link_name)
> >          if os.path.lexists(testdata_link):
> > -           os.remove(testdata_link)
> > -        os.symlink(os.path.basename(testdata), testdata_link)
> > +            os.remove(testdata_link)
> > +        os.symlink(os.path.basename(testdata_name), testdata_link)
> >  }
> >  write_image_test_data[vardepsexclude] += "TOPDIR"
> >  


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

* Re: [PATCH v2] rootfs-postcommands: put image testdata under sstate control
  2018-05-16  9:57     ` André Draszik
@ 2018-05-17  6:29       ` ChenQi
  2018-05-21 14:54         ` André Draszik
  2018-08-08 11:56       ` André Draszik
  1 sibling, 1 reply; 8+ messages in thread
From: ChenQi @ 2018-05-17  6:29 UTC (permalink / raw)
  To: openembedded-core

Hi,

I've also noticed this problem. The growing testdata.json files also 
bothered me a little bit.

I think the only small flaw with your patch is you deleted the following 
check.

if testdata_link != testdata:

Checking the values of IMAGE_NAME and IMAGE_LINK_NAME in bitbake.conf, 
such check seems not necessary.
But these values could be overridden. How about still keeping such check?

Best Regards,
Chen Qi


On 05/16/2018 05:57 PM, André Draszik wrote:
> Is there anything wrong with this?
>
> On Thu, 2018-05-10 at 09:05 +0100, André Draszik wrote:
>> ping
>>
>> On Wed, 2018-03-21 at 16:31 +0000, André Draszik wrote:
>>> From: André Draszik <andre.draszik@jci.com>
>>>
>>> The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
>>> thus bypassing sstate, which results in an ever growing list
>>> of files.
>>>
>>> Write them to IMGDEPLOYDIR instead, so as to benefit from the
>>> automatic management via sstate.
>>>
>>> Signed-off-by: André Draszik <andre.draszik@jci.com>
>>>
>>> ---
>>> v2: fix typo in subject line
>>> ---
>>>   meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
>>>   1 file changed, 8 insertions(+), 7 deletions(-)
>>>
>>> diff --git a/meta/classes/rootfs-postcommands.bbclass
>>> b/meta/classes/rootfs-postcommands.bbclass
>>> index a4e627fef8..01eee350b8 100644
>>> --- a/meta/classes/rootfs-postcommands.bbclass
>>> +++ b/meta/classes/rootfs-postcommands.bbclass
>>> @@ -303,17 +303,18 @@ rootfs_sysroot_relativelinks () {
>>>   python write_image_test_data() {
>>>       from oe.data import export2json
>>>   
>>> -    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'),
>>> d.getVar('IMAGE_NAME'))
>>> -    testdata_link = "%s/%s.testdata.json" %
>>> (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
>>> +    deploy_dir = d.getVar('IMGDEPLOYDIR')
>>> +    link_name = d.getVar('IMAGE_LINK_NAME')
>>> +    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" %
>>> d.getVar('IMAGE_NAME'))
>>>   
>>> -    bb.utils.mkdirhier(os.path.dirname(testdata))
>>>       searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
>>> -    export2json(d, testdata,searchString=searchString,replaceString="")
>>> +    export2json(d, testdata_name, searchString=searchString,
>>> replaceString="")
>>>   
>>> -    if testdata_link != testdata:
>>> +    if os.path.exists(testdata_name):
>>> +        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" %
>>> link_name)
>>>           if os.path.lexists(testdata_link):
>>> -           os.remove(testdata_link)
>>> -        os.symlink(os.path.basename(testdata), testdata_link)
>>> +            os.remove(testdata_link)
>>> +        os.symlink(os.path.basename(testdata_name), testdata_link)
>>>   }
>>>   write_image_test_data[vardepsexclude] += "TOPDIR"
>>>   




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

* Re: [PATCH v2] rootfs-postcommands: put image testdata under sstate control
  2018-05-17  6:29       ` ChenQi
@ 2018-05-21 14:54         ` André Draszik
  0 siblings, 0 replies; 8+ messages in thread
From: André Draszik @ 2018-05-21 14:54 UTC (permalink / raw)
  To: openembedded-core

Hi,

On Thu, 2018-05-17 at 14:29 +0800, ChenQi wrote:
> Hi,
> 
> I've also noticed this problem. The growing testdata.json files also 
> bothered me a little bit.
> 
> I think the only small flaw with your patch is you deleted the following 
> check.
> 
> if testdata_link != testdata:
> 
> Checking the values of IMAGE_NAME and IMAGE_LINK_NAME in bitbake.conf, 
> such check seems not necessary.
> But these values could be overridden. How about still keeping such check?

I made this fragment identical to all other uses of IMAGE_LINK_NAME and
IMAGE_LINK within this class. None of the other uses have such a test, so it
doesn't seem to make sense to have this check in write_image_test_data()
either.


Cheers,
Andre'



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

* Re: [PATCH v2] rootfs-postcommands: put image testdata under sstate control
  2018-05-16  9:57     ` André Draszik
  2018-05-17  6:29       ` ChenQi
@ 2018-08-08 11:56       ` André Draszik
  1 sibling, 0 replies; 8+ messages in thread
From: André Draszik @ 2018-08-08 11:56 UTC (permalink / raw)
  To: openembedded-core

ping

On Wed, 2018-05-16 at 10:57 +0100, André Draszik wrote:
> Is there anything wrong with this?
> 
> On Thu, 2018-05-10 at 09:05 +0100, André Draszik wrote:
> > ping
> > 
> > On Wed, 2018-03-21 at 16:31 +0000, André Draszik wrote:
> > > From: André Draszik <andre.draszik@jci.com>
> > > 
> > > The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
> > > thus bypassing sstate, which results in an ever growing list
> > > of files.
> > > 
> > > Write them to IMGDEPLOYDIR instead, so as to benefit from the
> > > automatic management via sstate.
> > > 
> > > Signed-off-by: André Draszik <andre.draszik@jci.com>
> > > 
> > > ---
> > > v2: fix typo in subject line
> > > ---
> > >  meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
> > >  1 file changed, 8 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/meta/classes/rootfs-postcommands.bbclass
> > > b/meta/classes/rootfs-postcommands.bbclass
> > > index a4e627fef8..01eee350b8 100644
> > > --- a/meta/classes/rootfs-postcommands.bbclass
> > > +++ b/meta/classes/rootfs-postcommands.bbclass
> > > @@ -303,17 +303,18 @@ rootfs_sysroot_relativelinks () {
> > >  python write_image_test_data() {
> > >      from oe.data import export2json
> > >  
> > > -    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'),
> > > d.getVar('IMAGE_NAME'))
> > > -    testdata_link = "%s/%s.testdata.json" %
> > > (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
> > > +    deploy_dir = d.getVar('IMGDEPLOYDIR')
> > > +    link_name = d.getVar('IMAGE_LINK_NAME')
> > > +    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" %
> > > d.getVar('IMAGE_NAME'))
> > >  
> > > -    bb.utils.mkdirhier(os.path.dirname(testdata))
> > >      searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
> > > -    export2json(d,
> > > testdata,searchString=searchString,replaceString="")
> > > +    export2json(d, testdata_name, searchString=searchString,
> > > replaceString="")
> > >  
> > > -    if testdata_link != testdata:
> > > +    if os.path.exists(testdata_name):
> > > +        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" %
> > > link_name)
> > >          if os.path.lexists(testdata_link):
> > > -           os.remove(testdata_link)
> > > -        os.symlink(os.path.basename(testdata), testdata_link)
> > > +            os.remove(testdata_link)
> > > +        os.symlink(os.path.basename(testdata_name), testdata_link)
> > >  }
> > >  write_image_test_data[vardepsexclude] += "TOPDIR"
> > >  


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

* [PATCH v3] rootfs-postcommands: put image testdata under sstate control
  2018-03-09 13:00 [PATCH] rootfs-postcommaneds: put image testdata under sstate control André Draszik
  2018-03-21 16:31 ` [PATCH v2] rootfs-postcommands: " André Draszik
@ 2018-08-20  8:15 ` André Draszik
  1 sibling, 0 replies; 8+ messages in thread
From: André Draszik @ 2018-08-20  8:15 UTC (permalink / raw)
  To: openembedded-core

From: André Draszik <andre.draszik@jci.com>

The testdata.json is being written to DEPLOY_DIR_IMAGE directly,
thus bypassing sstate, which results in an ever growing list
of files.

Write them to IMGDEPLOYDIR instead, so as to benefit from the
automatic management via sstate.

Signed-off-by: André Draszik <andre.draszik@jci.com>

---
v3: rebased
v2: fix typo in subject line
---
 meta/classes/rootfs-postcommands.bbclass | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index ca690a6e59..e816824f28 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -316,17 +316,18 @@ rootfs_sysroot_relativelinks () {
 python write_image_test_data() {
     from oe.data import export2json
 
-    testdata = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_NAME'))
-    testdata_link = "%s/%s.testdata.json" % (d.getVar('DEPLOY_DIR_IMAGE'), d.getVar('IMAGE_LINK_NAME'))
+    deploy_dir = d.getVar('IMGDEPLOYDIR')
+    link_name = d.getVar('IMAGE_LINK_NAME')
+    testdata_name = os.path.join(deploy_dir, "%s.testdata.json" % d.getVar('IMAGE_NAME'))
 
-    bb.utils.mkdirhier(os.path.dirname(testdata))
     searchString = "%s/"%(d.getVar("TOPDIR")).replace("//","/")
-    export2json(d, testdata,searchString=searchString,replaceString="")
+    export2json(d, testdata_name, searchString=searchString, replaceString="")
 
-    if testdata_link != testdata:
+    if os.path.exists(testdata_name):
+        testdata_link = os.path.join(deploy_dir, "%s.testdata.json" % link_name)
         if os.path.lexists(testdata_link):
-           os.remove(testdata_link)
-        os.symlink(os.path.basename(testdata), testdata_link)
+            os.remove(testdata_link)
+        os.symlink(os.path.basename(testdata_name), testdata_link)
 }
 write_image_test_data[vardepsexclude] += "TOPDIR"
 
-- 
2.18.0



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

end of thread, other threads:[~2018-08-20  8:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09 13:00 [PATCH] rootfs-postcommaneds: put image testdata under sstate control André Draszik
2018-03-21 16:31 ` [PATCH v2] rootfs-postcommands: " André Draszik
2018-05-10  8:05   ` André Draszik
2018-05-16  9:57     ` André Draszik
2018-05-17  6:29       ` ChenQi
2018-05-21 14:54         ` André Draszik
2018-08-08 11:56       ` André Draszik
2018-08-20  8:15 ` [PATCH v3] " André Draszik

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.