mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-27 00:21:44 +02:00
fix(image_to_vm): Remove support for alternate state fs image.
We haven't really needed this, remove the option to simplify things.
This commit is contained in:
parent
213472652c
commit
8e0d630699
@ -195,17 +195,10 @@ _disk_ext() {
|
||||
esac
|
||||
}
|
||||
|
||||
# Unpack the source disk to individual partitions, optionally using an
|
||||
# alternate filesystem image for the state partition instead of the one
|
||||
# from VM_SRC_IMG. Start new image using the given disk layout.
|
||||
# Unpack the source disk to individual partitions.
|
||||
# Start new image using the given disk layout.
|
||||
unpack_source_disk() {
|
||||
get_disk_layout_type $(_get_vm_opt DISK_LAYOUT)
|
||||
local alternate_state_image="$1"
|
||||
|
||||
if [[ -n "${alternate_state_image}" && ! -f "${alternate_state_image}" ]]
|
||||
then
|
||||
die "State image does not exist: $alternate_state_image"
|
||||
fi
|
||||
|
||||
info "Unpacking source image to $(relpath "${VM_TMP_DIR}")"
|
||||
|
||||
@ -222,10 +215,6 @@ unpack_source_disk() {
|
||||
TEMP_OEM="${VM_TMP_DIR}"/part_${NUM_OEM}
|
||||
TEMP_ROOTFS="${VM_TMP_DIR}"/part_${NUM_ROOTFS_A}
|
||||
TEMP_STATE="${VM_TMP_DIR}"/part_${NUM_STATEFUL}
|
||||
# Copy the replacement STATE image if it is set
|
||||
if [[ -n "${alternate_state_image}" ]]; then
|
||||
cp --sparse=always "${alternate_state_image}" "${TEMP_STATE}"
|
||||
fi
|
||||
|
||||
if [[ $(_get_vm_opt PARTITIONED_IMG) -eq 1 ]]; then
|
||||
info "Initializing new partition table..."
|
||||
|
@ -39,8 +39,6 @@ DEFINE_string disk_layout "" \
|
||||
"The disk layout type to use for this image."
|
||||
DEFINE_integer mem "${DEFAULT_MEM}" \
|
||||
"Memory size for the vm config in MBs."
|
||||
DEFINE_string state_image "" \
|
||||
"Stateful partition image (defaults to creating new statful partition)"
|
||||
DEFINE_boolean prod_image "${FLAGS_FALSE}" \
|
||||
"Use the production image instead of the default developer image."
|
||||
DEFINE_string to "" \
|
||||
@ -105,9 +103,9 @@ legacy_offset_size_export ${VM_SRC_IMG}
|
||||
# Make sure things are cleaned up on failure
|
||||
trap vm_cleanup EXIT
|
||||
|
||||
# Unpack image, using alternate state image if defined
|
||||
# Unpack image
|
||||
# Resize to use all available space in new disk layout
|
||||
unpack_source_disk "${FLAGS_state_image}"
|
||||
unpack_source_disk
|
||||
resize_state_partition
|
||||
|
||||
# Optionally install any OEM packages
|
||||
|
Loading…
x
Reference in New Issue
Block a user