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

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 that, what happens to the manifest once, we changed any rootfs file.

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

ROOTFS_POSTINSTALL_COMMAND

ROOTFS_POSTPROCESS_COMMAND

1 Like

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?

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

1 Like

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 :slight_smile:

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

1 Like

@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.

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?

1 Like

@oleorhagen thank you for your confirmation.

I have tried and is working as I mentioned previously.

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

Thank you @mirzak , @dellgreen and @oleorhagen for your time :+1:

1 Like