mirror of
https://github.com/flatcar/scripts.git
synced 2025-11-28 14:01:43 +01:00
Create a latest link to point at newest image
build_image creates it after a successful build, and get_latest_image can use it if it exists. Fall back to old behavior for now when there are directories without a link. BUG=none TEST=Try building an image, check link. Rebuild, check new link. Review URL: http://codereview.chromium.org/3014051
This commit is contained in:
parent
77e8092a9c
commit
58f25cca72
@ -760,6 +760,10 @@ rm -f "${ROOT_FS_IMG}" "${STATEFUL_FS_IMG}" "${OUTPUT_DIR}/vmlinuz.image" \
|
||||
"${ESP_FS_IMG}" "${OEM_FS_IMG}" "${OUTPUT_DIR}/vmlinuz_hd.vblock"
|
||||
rmdir "${ROOT_FS_DIR}" "${STATEFUL_FS_DIR}" "${OEM_FS_DIR}" "${ESP_FS_DIR}"
|
||||
|
||||
# Create a 'latest' link
|
||||
rm -f ${FLAGS_output_root}/${FLAGS_board}/latest
|
||||
ln -s $(basename ${OUTPUT_DIR}) ${FLAGS_output_root}/${FLAGS_board}/latest
|
||||
|
||||
echo "Done. Image created in ${OUTPUT_DIR}"
|
||||
echo "Chromium OS image created as ${PRISTINE_IMAGE_NAME}"
|
||||
if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
|
||||
|
||||
@ -30,7 +30,11 @@ IMAGES_DIR="${DEFAULT_BUILD_ROOT}/images/${FLAGS_board}"
|
||||
# If there are no images, return nothing
|
||||
[ -d $IMAGES_DIR ] || exit 0
|
||||
|
||||
# Default to the most recent image
|
||||
DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`"
|
||||
# Use latest link if it exists, otherwise most recently changed dir
|
||||
if [ -L ${IMAGES_DIR}/latest ] ; then
|
||||
DEFAULT_FROM="${IMAGES_DIR}/`readlink ${IMAGES_DIR}/latest`"
|
||||
else
|
||||
DEFAULT_FROM="${IMAGES_DIR}/`ls -t $IMAGES_DIR | head -1`"
|
||||
fi
|
||||
|
||||
echo $DEFAULT_FROM
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user