sort the flags tuple

The output of this function is arbitrary because it's based on the
ordering of the dict keys of FMAP_FLAGS.  This leads to the unittest
sometimes passing & sometimes failing.  Since this is meant for us
humans, sort the tuple so it's stable and unittests are reliable.

TEST=`./ bin/example.bin` works

Change-Id: Ida9e6768aa6662a400655c52bc2ba793197ab591
Tested-by: Mike Frysinger <>
Commit-Ready: Mike Frysinger <>
Legacy-Commit-Queue: Commit Bot <>
Reviewed-by: Duncan Laurie <>
diff --git a/ b/
index 936b1ce..a5ec8ef 100755
--- a/
+++ b/
@@ -131,7 +131,9 @@
 def _fmap_decode_area_flags(area_flags):
   """(internal) Decodes a FMAP flags property"""
-  return tuple([name for name in FMAP_FLAGS if area_flags & FMAP_FLAGS[name]])
+  # Since FMAP_FLAGS is a dict with arbitrary ordering, sort the list so the
+  # output is stable.  Also sorting is nicer for humans.
+  return tuple(sorted(x for x in FMAP_FLAGS if area_flags & FMAP_FLAGS[x]))
 def _fmap_check_name(fmap, name):