build_image: cache DISK_LAYOUT_PATH early
Since get_disk_layout_path gets run in subshells, the computed value of
DISK_LAYOUT_PATH never makes it to the larger env. Even if it did, we
currently always recompute it. This can be a little expensive since it
involves walking all our overlays to find the json file.
Instead, let's compute this value once before we start building the image
and have the code use that value if it's been set already. This should
be backwards compatible.
TEST=`./build_image` produces the same image
Reviewed-by: Liam McLoughlin <email@example.com>
Commit-Queue: Mike Frysinger <firstname.lastname@example.org>
Tested-by: Mike Frysinger <email@example.com>
2 files changed