mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 14:36:58 +02:00
fix(vm_image_util): Do not generate a machine UUID.
If QEMU is given a uuid systemd will detect that and in turn use it for the machine-id. This made the bug causing the machine-id to be always re-generated on boot harder to notice since it didn't happen on QEMU.
This commit is contained in:
parent
c489d2f7c8
commit
11aabd7bd0
@ -98,12 +98,14 @@ if [ -n "${VM_INITRD}" ]; then
|
|||||||
set -- -initrd "${SCRIPT_DIR}/${VM_INITRD}" "$@"
|
set -- -initrd "${SCRIPT_DIR}/${VM_INITRD}" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "${VM_UUID}" ]; then
|
||||||
|
set -- -uuid "$VM_UUID" "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
# Default to KVM, fall back on full emulation
|
# Default to KVM, fall back on full emulation
|
||||||
# ${METADATA} will be mounted in CoreOS as /media/metadata
|
# ${METADATA} will be mounted in CoreOS as /media/metadata
|
||||||
qemu-system-x86_64 \
|
qemu-system-x86_64 \
|
||||||
-name "$VM_NAME" \
|
-name "$VM_NAME" \
|
||||||
-uuid "$VM_UUID" \
|
|
||||||
-m ${VM_MEMORY} \
|
-m ${VM_MEMORY} \
|
||||||
-machine accel=kvm:tcg \
|
-machine accel=kvm:tcg \
|
||||||
-net nic,vlan=0,model=virtio \
|
-net nic,vlan=0,model=virtio \
|
||||||
|
@ -33,7 +33,6 @@ VM_TMP_ROOT=
|
|||||||
VM_DST_IMG=
|
VM_DST_IMG=
|
||||||
VM_README=
|
VM_README=
|
||||||
VM_NAME=
|
VM_NAME=
|
||||||
VM_UUID=
|
|
||||||
|
|
||||||
# Contains a list of all generated files
|
# Contains a list of all generated files
|
||||||
VM_GENERATED_FILES=()
|
VM_GENERATED_FILES=()
|
||||||
@ -161,7 +160,6 @@ set_vm_paths() {
|
|||||||
VM_TMP_IMG="${VM_TMP_DIR}/disk_image.bin"
|
VM_TMP_IMG="${VM_TMP_DIR}/disk_image.bin"
|
||||||
VM_TMP_ROOT="${VM_TMP_DIR}/rootfs"
|
VM_TMP_ROOT="${VM_TMP_DIR}/rootfs"
|
||||||
VM_NAME="$(_src_to_dst_name "${src_name}" "")-${COREOS_VERSION_STRING}"
|
VM_NAME="$(_src_to_dst_name "${src_name}" "")-${COREOS_VERSION_STRING}"
|
||||||
VM_UUID=$(uuidgen)
|
|
||||||
VM_README="${dst_dir}/$(_src_to_dst_name "${src_name}" ".README")"
|
VM_README="${dst_dir}/$(_src_to_dst_name "${src_name}" ".README")"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,7 +347,6 @@ _write_qemu_common() {
|
|||||||
local vm_mem="$(_get_vm_opt MEM)"
|
local vm_mem="$(_get_vm_opt MEM)"
|
||||||
|
|
||||||
sed -e "s%^VM_NAME=.*%VM_NAME='${VM_NAME}'%" \
|
sed -e "s%^VM_NAME=.*%VM_NAME='${VM_NAME}'%" \
|
||||||
-e "s%^VM_UUID=.*%VM_UUID='${VM_UUID}'%" \
|
|
||||||
-e "s%^VM_MEMORY=.*%VM_MEMORY='${vm_mem}'%" \
|
-e "s%^VM_MEMORY=.*%VM_MEMORY='${vm_mem}'%" \
|
||||||
"${BUILD_LIBRARY_DIR}/qemu_template.sh" > "${script}"
|
"${BUILD_LIBRARY_DIR}/qemu_template.sh" > "${script}"
|
||||||
checkbashisms --posix "${script}" || die
|
checkbashisms --posix "${script}" || die
|
||||||
@ -518,7 +515,6 @@ _write_xl_conf() {
|
|||||||
|
|
||||||
builder = "generic"
|
builder = "generic"
|
||||||
name = "${VM_NAME}"
|
name = "${VM_NAME}"
|
||||||
uuid = "${VM_UUID}"
|
|
||||||
|
|
||||||
memory = "${vm_mem}"
|
memory = "${vm_mem}"
|
||||||
vcpus = 2
|
vcpus = 2
|
||||||
|
Loading…
Reference in New Issue
Block a user