# Data folder present in mender artifact rootfs update

**URL:** <https://hub.mender.io/t/data-folder-present-in-mender-artifact-rootfs-update/1329>\
**Category:** General Discussions\
**Created:** [December 5, 2019, 9:07pm UTC](https://hub.mender.io/t/data-folder-present-in-mender-artifact-rootfs-update/1329 "2019-12-05T21:07:03Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![drewmoseley](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/drewmoseley/32/47_2.png) [@drewmoseley](https://hub.mender.io/u/drewmoseley)\
**Post date:** [December 9, 2019, 5:23pm UTC](https://hub.mender.io/t/data-folder-present-in-mender-artifact-rootfs-update/1329/21 "2019-12-09T17:23:17Z")

</div>

PR is here: [https://github.com/mendersoftware/meta-mender/pull/875](https://github.com/mendersoftware/meta-mender/pull/875)

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [December 9, 2019, 6:00pm UTC](https://hub.mender.io/t/data-folder-present-in-mender-artifact-rootfs-update/1329/22 "2019-12-09T18:00:36Z")

</div>

Awesome, I’ll give it a test first thing in the morning. Many thanks

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [February 6, 2020, 10:48am UTC](https://hub.mender.io/t/data-folder-present-in-mender-artifact-rootfs-update/1329/23 "2020-02-06T10:48:51Z")

</div>

After many days working on a solution, All solutions failed due to early expansion of do\_image\_xxx tasks.

It looks like the issue is caused by the image.bbclass dynamic generation of the do\_image\_xxx tasks whereby the cmds are joined into a big string to form the task script long before our functions or our anonymous python functions are called. Attempts so far to change the IMAGE\_CMD\_tar in the anonymous python block causes build errors with hash mismatch between the two parsing phases noticing that the IMAGE\_CMD\_tar variable has been changed twice.

I have an ugly solution hack for my scenario only for tar as I can fine no good solution to this after 2 days solidly on it, the problem stems from some IMAGE\_CMDS\_xxx being defined as variables rather than functions in image-types.bbclass

**Ugly code injection/hack Warning** 🤮

In the end to achieve the tar, tar.xz, tar.gz files all being based on the mender temporary rootfs directory, I had to define my own IMAGE\_CMD\_TAR variable in my distro.conf which was a copy of the definition of IMAGE\_CMD\_tar in image-types.bbclass with the rootfs path modified to the mender rootfs.image\_tar. At the end of my custom IMAGE\_CMD\_TAR I added a shell comment symbol to prefix all the original definition in IMAGE\_CMD\_tar when expanded out by the do\_image\_tar script in the image.bbclass.

yuck!

[Previous page](https://hub.mender.io/t/data-folder-present-in-mender-artifact-rootfs-update/1329.md?page=1)
