From e6932d8986624845c542b0f5dc4febd74f0139cb Mon Sep 17 00:00:00 2001 From: Jonathan Kliegman Date: Tue, 8 Nov 2011 14:48:47 -0500 Subject: [PATCH] Fix clean_loopback_devices to actually parse board parameter clean_loopback_devices was never parsing command line arguments or properly setting the default board. As such it would always use the x86-wayland overlay as it came last alphabetically in the directory listing. BUG=chromium-os:22671 TEST=Ran clean_loopback_devices with various --board arguments Validated correct OUTPUT_DIR values for those, including an error and abort on null Change-Id: Ia8826bbeb88ed5bdac0aa7698dd262f72de2749a Reviewed-on: https://gerrit.chromium.org/gerrit/11332 Reviewed-by: Chris Sosa Commit-Ready: Jon Kliegman Tested-by: Jon Kliegman --- clean_loopback_devices | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/clean_loopback_devices b/clean_loopback_devices index 088f51d284..f66244bdc3 100755 --- a/clean_loopback_devices +++ b/clean_loopback_devices @@ -32,11 +32,22 @@ find_common_sh # Script must be run inside the chroot. assert_inside_chroot +get_default_board + DEFINE_string output_root "$DEFAULT_BUILD_ROOT/images" \ "Directory in which to place image result directories (named by version)" DEFINE_string board "$DEFAULT_BOARD" \ "The board to build an image for." +# Parse command line. +FLAGS "$@" || exit 1 +eval set -- "${FLAGS_ARGV}" + +if [[ -z "${FLAGS_board}" ]]; then + error "--board is required." + exit 1 +fi + OUTPUT_DIR="${FLAGS_output_root}/${FLAGS_board}" echo "This will unmount any directory under $OUTPUT_DIR:"