mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 06:01:41 +02:00
image_to_vm: Default to qemu_uefi on ARM
qemu makes no sense on that platform.
This commit is contained in:
parent
791a530a44
commit
c98788befc
@ -100,6 +100,7 @@ fi
|
|||||||
. "${BUILD_LIBRARY_DIR}/prod_image_util.sh" || exit 1
|
. "${BUILD_LIBRARY_DIR}/prod_image_util.sh" || exit 1
|
||||||
. "${BUILD_LIBRARY_DIR}/dev_image_util.sh" || exit 1
|
. "${BUILD_LIBRARY_DIR}/dev_image_util.sh" || exit 1
|
||||||
. "${BUILD_LIBRARY_DIR}/test_image_content.sh" || exit 1
|
. "${BUILD_LIBRARY_DIR}/test_image_content.sh" || exit 1
|
||||||
|
. "${BUILD_LIBRARY_DIR}/vm_image_util.sh" || exit 1
|
||||||
|
|
||||||
PROD_IMAGE=0
|
PROD_IMAGE=0
|
||||||
DEV_IMAGE=0
|
DEV_IMAGE=0
|
||||||
@ -216,7 +217,7 @@ print_image_to_vm() {
|
|||||||
To convert it to a virtual machine image, use:
|
To convert it to a virtual machine image, use:
|
||||||
./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD} ${flags}
|
./image_to_vm.sh --from=${OUTSIDE_OUTPUT_DIR} --board=${BOARD} ${flags}
|
||||||
|
|
||||||
The default type is qemu, see ./image_to_vm.sh --help for other options.
|
The default type is $(get_default_vm_type ${BOARD}), see ./image_to_vm.sh --help for other options.
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -296,6 +296,22 @@ IMG_interoute_BUNDLE_FORMAT=ova
|
|||||||
|
|
||||||
###########################################################
|
###########################################################
|
||||||
|
|
||||||
|
# Print the default vm type for the specified board
|
||||||
|
get_default_vm_type() {
|
||||||
|
local board="$1"
|
||||||
|
case "$board" in
|
||||||
|
amd64-usr)
|
||||||
|
echo "qemu"
|
||||||
|
;;
|
||||||
|
arm64-usr)
|
||||||
|
echo "qemu_uefi"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
return 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
# Validate and set the vm type to use for the rest of the functions
|
# Validate and set the vm type to use for the rest of the functions
|
||||||
set_vm_type() {
|
set_vm_type() {
|
||||||
local vm_type="$1"
|
local vm_type="$1"
|
||||||
|
@ -28,7 +28,7 @@ DEFINE_string board "${DEFAULT_BOARD}" \
|
|||||||
|
|
||||||
# We default to TRUE so the buildbot gets its image. Note this is different
|
# We default to TRUE so the buildbot gets its image. Note this is different
|
||||||
# behavior from image_to_usb.sh
|
# behavior from image_to_usb.sh
|
||||||
DEFINE_string format "qemu" \
|
DEFINE_string format "" \
|
||||||
"Output format, one of: ${VALID_IMG_TYPES[*]}"
|
"Output format, one of: ${VALID_IMG_TYPES[*]}"
|
||||||
DEFINE_string from "" \
|
DEFINE_string from "" \
|
||||||
"Directory containing rootfs.image and mbr.image"
|
"Directory containing rootfs.image and mbr.image"
|
||||||
@ -59,6 +59,10 @@ switch_to_strict_mode
|
|||||||
|
|
||||||
check_gsutil_opts
|
check_gsutil_opts
|
||||||
|
|
||||||
|
if [[ -z "${FLAGS_format}" ]]; then
|
||||||
|
FLAGS_format="$(get_default_vm_type ${FLAGS_board})"
|
||||||
|
fi
|
||||||
|
|
||||||
if ! set_vm_type "${FLAGS_format}"; then
|
if ! set_vm_type "${FLAGS_format}"; then
|
||||||
die_notrace "Invalid format: ${FLAGS_format}"
|
die_notrace "Invalid format: ${FLAGS_format}"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user