# \[Solved\] How "Mender Artifact" will work with the manifest (rootfs' sha256 hash)?

**URL:** https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562
**Category:** General Discussions
**Tags:** yocto, sumo, nxp, standalone, mender-artifact
**Created:** [February 19, 2020, 7:47am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562 "2020-02-19T07:47:16Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)
#### Post date: [February 19, 2020, 7:47am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/1 "2020-02-19T07:47:16Z")

</div>

Hi,

I would like to modify one file (13MB file) of the rootfs (mender artifact) after the Yocto build.  
The possible easy option is to use the provided `mender-artifact` tool to modify the file with `cp` command.  
The above method is clear to me however, I’m confused with the manifest file.

Whether `mender-artifact` tool will automatically update the `manifest` with the updated SHA256 hash of the “`<rootfs>.ext4`”?  
It is not clear for me from the [examples](https://docs.mender.io/2.0/artifacts/modifying-a-mender-artifact) that, what happens to the `manifest` once, we changed any rootfs file.

---

<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 19, 2020, 8:06am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/2 "2020-02-19T08:06:59Z")

</div>

If using yocto, can you not use the rootfs post processing hooks to edit rootfs prior to the images being made?

ROOTFS\_POSTINSTALL\_COMMAND[¶](https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-ROOTFS_POSTINSTALL_COMMAND)

ROOTFS\_POSTPROCESS\_COMMAND[¶](https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-ROOTFS_POSTPROCESS_COMMAND)

---

<div class="post-metadata">

### Author: ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)
#### Post date: [February 19, 2020, 8:11am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/3 "2020-02-19T08:11:55Z")

</div>

Thank you @dellgreen for the suggestion.

Sorry for the confusion. My use case is different. The modification which I mentioned is not happening on the same build machine. It is happening on another machine where the file needs to be copied into the `.mender` artifact.  
Hence, `mender-artifact` tools suits for my case.

Could you please let me know whether `mender-artifact` tool automatically take care of the `manifest` file present inside the `.mender` artifact?

---

<div class="post-metadata">

### Author: ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)
#### Post date: [February 19, 2020, 8:19am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/4 "2020-02-19T08:19:13Z")

</div>

> [@ajithpv](#):
>
> Could you please let me know whether `mender-artifact` tool automatically take care of the `manifest` file present inside the `.mender` artifact?

I would expect the tool to update the sha256 hash if you are using `mender-artifact cp`

---

<div class="post-metadata">

### Author: ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)
#### Post date: [February 19, 2020, 8:22am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/5 "2020-02-19T08:22:02Z")

</div>

Even I expect the same @mirzak.

I have tried to untar and checked the manifest before and after the update (with cp command). The rootfs sha256 hash is changing. However, I need a confirmation that our expection is correct 🙂

---

<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 19, 2020, 8:56am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/6 "2020-02-19T08:56:30Z")

</div>

I would expect the hash to change and the new artifact to be resigned if you have supplied the key.

---

<div class="post-metadata">

### Author: ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)
#### Post date: [February 19, 2020, 9:15am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/7 "2020-02-19T09:15:36Z")

</div>

@dellgreen - Just to clarify, I have no signing in place. I’m just copy one file into the rootfs (.mender). However, the `.ext4` SHA256 hash will change as per my knowledge.

---

<div class="post-metadata">

### Author: ![oleorhagen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/oleorhagen/32/297_2.png) [@oleorhagen](https://hub.mender.io/u/oleorhagen)
#### Post date: [February 19, 2020, 10:08am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/8 "2020-02-19T10:08:16Z")

</div>

The manifest file should be recreated with the new sha.

Same goes for resigning.

If this does not work, I would call it a bug.

@ajithpv have you tried this and it fails? Or is this research simply?

---

<div class="post-metadata">

### Author: ![ajithpv](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/ajithpv/32/728_2.png) [@ajithpv](https://hub.mender.io/u/ajithpv)
#### Post date: [February 19, 2020, 10:22am UTC](https://hub.mender.io/t/solved-how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/9 "2020-02-19T10:22:04Z")

</div>

@oleorhagen thank you for your confirmation.

I have tried and is working as I [mentioned](https://hub.mender.io/t/how-mender-artifact-will-work-with-the-manifest-rootfs-sha256-hash/1562/5) previously.

I need to submit this method to another team and hence I thought of asking and get confirmation from the experts 🙂

Thank you @mirzak , @dellgreen and @oleorhagen for your time 👍
