mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 14:36:58 +02:00
Add defaults for cros_make_image_bootable.
This will allow dev who didn't build an image to still use cros_make_image_bootable to update their image -- including mod_image_for_test / image_to_vm. Change-Id: I1ba4292223b28b21d5416745e7744641100fa4ad BUG=7370 TEST=Ran image_to_vm with other image and image I built myself. Also ran cros_make_image_bootable directly on a the same two images. Review URL: http://codereview.chromium.org/3569015
This commit is contained in:
parent
c90b71ed1f
commit
c1b14b52d0
@ -28,8 +28,9 @@ if [ $# -lt 2 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
BOOT_DESC_FILE="${1}/boot.desc"
|
||||
IMAGE="${1}/${2}"
|
||||
IMAGE_DIR="$(readlink -f "${1}")"
|
||||
BOOT_DESC_FILE="${IMAGE_DIR}/boot.desc"
|
||||
IMAGE="${IMAGE_DIR}/${2}"
|
||||
shift
|
||||
shift
|
||||
FLAG_OVERRIDES="${@}"
|
||||
@ -233,6 +234,16 @@ make_image_bootable() {
|
||||
-s "${FLAGS_statefulfs_mountpoint}"
|
||||
}
|
||||
|
||||
# Use default of current image location if the output dir doesn't exist.
|
||||
if [ ! -d ${FLAGS_output_dir} ]; then
|
||||
warn "Output dir not found, using ${IMAGE_DIR}."
|
||||
FLAGS_output_dir="${IMAGE_DIR}"
|
||||
FLAGS_rootfs_hash="${IMAGE_DIR}/rootfs.hash"
|
||||
FLAGS_rootfs_mountpoint="${IMAGE_DIR}/rootfs_dir"
|
||||
FLAGS_statefulfs_mountpoint="${IMAGE_DIR}/stateful_dir"
|
||||
FLAGS_espfs_mountpoint="${IMAGE_DIR}/esp"
|
||||
fi
|
||||
|
||||
# Create the directories if they don't exist.
|
||||
mkdir -p ${FLAGS_rootfs_mountpoint}
|
||||
mkdir -p ${FLAGS_statefulfs_mountpoint}
|
||||
|
Loading…
Reference in New Issue
Block a user