mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
Convert various scripts to use get_latest_image
Convert image_to_usb.sh, mod_image_for_recovery.sh, and mod_image_for_test.sh to use get_latest image; previously these scripts wouldn't honor the 'latest' symlink. BUG=None TEST=re-link 'latest' to an alternate directory; test scripts Change-Id: Ibb56bb993eae9b6ff9dbfea5090c7cae46f2c133 Reviewed-on: http://gerrit.chromium.org/gerrit/10267 Tested-by: Richard Barnette <jrbarnette@chromium.org> Commit-Ready: Richard Barnette <jrbarnette@chromium.org> Reviewed-by: David James <davidjames@chromium.org>
This commit is contained in:
parent
7d7d2ef0f0
commit
8b1328b17c
@ -114,10 +114,7 @@ fi
|
||||
|
||||
# We have a board name but no image set. Use image at default location
|
||||
if [ -z "${FLAGS_from}" ]; then
|
||||
IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}"
|
||||
|
||||
# Get latest image directory
|
||||
FLAGS_from="${IMAGES_DIR}/$(ls -t ${IMAGES_DIR} 2>&-| head -1)"
|
||||
FLAGS_from="$($SCRIPT_ROOT/get_latest_image.sh --board=${FLAGS_board})"
|
||||
fi
|
||||
|
||||
if [ ! -d "${FLAGS_from}" ] ; then
|
||||
|
@ -70,11 +70,10 @@ fi
|
||||
|
||||
EMERGE_BOARD_CMD="emerge-$BOARD"
|
||||
|
||||
# We have a board name but no image set. Use image at default location
|
||||
# No image was provided. Use the standard latest image
|
||||
if [ -z "$FLAGS_image" ]; then
|
||||
IMAGES_DIR="$DEFAULT_BUILD_ROOT/images/$BOARD"
|
||||
FILENAME="$CHROMEOS_IMAGE_NAME"
|
||||
FLAGS_image="$IMAGES_DIR/$(ls -t $IMAGES_DIR 2>&-| head -1)/$FILENAME"
|
||||
IMAGES_DIR="$($SCRIPT_ROOT/get_latest_image.sh --board=$BOARD)"
|
||||
FLAGS_image="$IMAGES_DIR/$CHROMEOS_IMAGE_NAME"
|
||||
fi
|
||||
|
||||
# Turn path into an absolute path.
|
||||
|
@ -52,17 +52,15 @@ set -e
|
||||
. "${BUILD_LIBRARY_DIR}/test_image_util.sh" || exit 1
|
||||
|
||||
|
||||
# We have a board name but no image set. Use image at default location
|
||||
# No image was provided. Use the standard latest image
|
||||
if [ -z "$FLAGS_image" ]; then
|
||||
IMAGES_DIR="$DEFAULT_BUILD_ROOT/images/$BOARD"
|
||||
FILENAME="$CHROMEOS_IMAGE_NAME"
|
||||
FLAGS_image="$IMAGES_DIR/$(ls -t $IMAGES_DIR 2>&-| head -1)/$FILENAME"
|
||||
IMAGES_DIR="$($SCRIPT_ROOT/get_latest_image.sh --board=$BOARD)"
|
||||
FLAGS_image="$IMAGES_DIR/$CHROMEOS_IMAGE_NAME"
|
||||
fi
|
||||
|
||||
# Turn path into an absolute path.
|
||||
FLAGS_image=$(eval readlink -f "$FLAGS_image")
|
||||
|
||||
|
||||
IMAGE_DIR=$(dirname "$FLAGS_image")
|
||||
ROOT_FS_DIR="${IMAGE_DIR}/rootfs"
|
||||
STATEFUL_FS_DIR="${IMAGE_DIR}/stateful_partition"
|
||||
|
Loading…
Reference in New Issue
Block a user