mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-26 16:11:56 +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
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# Unpack the source disk to individual partitions, optionally using an
|
# Unpack the source disk to individual partitions.
|
||||||
# alternate filesystem image for the state partition instead of the one
|
# Start new image using the given disk layout.
|
||||||
# from VM_SRC_IMG. Start new image using the given disk layout.
|
|
||||||
unpack_source_disk() {
|
unpack_source_disk() {
|
||||||
get_disk_layout_type $(_get_vm_opt DISK_LAYOUT)
|
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}")"
|
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_OEM="${VM_TMP_DIR}"/part_${NUM_OEM}
|
||||||
TEMP_ROOTFS="${VM_TMP_DIR}"/part_${NUM_ROOTFS_A}
|
TEMP_ROOTFS="${VM_TMP_DIR}"/part_${NUM_ROOTFS_A}
|
||||||
TEMP_STATE="${VM_TMP_DIR}"/part_${NUM_STATEFUL}
|
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
|
if [[ $(_get_vm_opt PARTITIONED_IMG) -eq 1 ]]; then
|
||||||
info "Initializing new partition table..."
|
info "Initializing new partition table..."
|
||||||
|
@ -39,8 +39,6 @@ DEFINE_string disk_layout "" \
|
|||||||
"The disk layout type to use for this image."
|
"The disk layout type to use for this image."
|
||||||
DEFINE_integer mem "${DEFAULT_MEM}" \
|
DEFINE_integer mem "${DEFAULT_MEM}" \
|
||||||
"Memory size for the vm config in MBs."
|
"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}" \
|
DEFINE_boolean prod_image "${FLAGS_FALSE}" \
|
||||||
"Use the production image instead of the default developer image."
|
"Use the production image instead of the default developer image."
|
||||||
DEFINE_string to "" \
|
DEFINE_string to "" \
|
||||||
@ -105,9 +103,9 @@ legacy_offset_size_export ${VM_SRC_IMG}
|
|||||||
# Make sure things are cleaned up on failure
|
# Make sure things are cleaned up on failure
|
||||||
trap vm_cleanup EXIT
|
trap vm_cleanup EXIT
|
||||||
|
|
||||||
# Unpack image, using alternate state image if defined
|
# Unpack image
|
||||||
# Resize to use all available space in new disk layout
|
# Resize to use all available space in new disk layout
|
||||||
unpack_source_disk "${FLAGS_state_image}"
|
unpack_source_disk
|
||||||
resize_state_partition
|
resize_state_partition
|
||||||
|
|
||||||
# Optionally install any OEM packages
|
# Optionally install any OEM packages
|
||||||
|
Loading…
x
Reference in New Issue
Block a user