]> code.ossystems Code Review - openembedded-core.git/commitdiff
image: Fix "metadata is not deterministic" when chaining 2+ CONVERSION_CMDs
authorTom Rini <trini@konsulko.com>
Tue, 25 Jul 2017 19:58:09 +0000 (15:58 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 25 Jul 2017 22:15:30 +0000 (23:15 +0100)
When we have more than one CONVERSION_CMD being used, for example
ext4.gz.sha256sum we will see errors about "metadata is not
deterministic".  This is because we do not have a stable order of
intermediate files that will be removed in the generated shell command.
We fix this by calling sorted() on the set of rm_tmp_images so that we
will have a stable hash again.

Cc: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/image.bbclass

index b095bca7c12ae2448b8c580015aeb9a4c8871f93..dee17ae9f96662d5e52276abc67fc1a8e05a46e8 100644 (file)
@@ -474,7 +474,7 @@ python () {
         # Clean up after applying all conversion commands. Some of them might
         # use the same input, therefore we cannot delete sooner without applying
         # some complex dependency analysis.
-        for image in rm_tmp_images:
+        for image in sorted(rm_tmp_images):
             cmds.append("\trm " + image)
 
         after = 'do_image'