[OE-core] [PATCH v2] rootfs-postcommands: put image testdata under sstate control

ChenQi Qi.Chen at windriver.com
Thu May 17 06:29:37 UTC 2018


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 at 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 at 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"
>>>   





More information about the Openembedded-core mailing list