Move config to..

This commit is contained in:
zenobit 2025-02-18 03:45:00 +01:00
parent f20f132ea2
commit 0ccf24de2a
2 changed files with 18 additions and 17 deletions

View File

@ -24,3 +24,21 @@ function get_() {
HASH="$(echo "${DATA}" | cut_1)"
echo "${URL}/${ISO} ${HASH}"
}
function distro_specific() {
if [[ ${ISO} =~ ".zst" ]]; then
zstd -d "${VM_PATH}/${ISO}"
ISO="${ISO/.zst/}"
if [[ ${ISO} =~ ".img" ]]; then
QEMU_IMG=$(command -v qemu-img)
if [ ! -x "${QEMU_IMG}" ]; then
echo $"ERROR! qemu-img not found. Please make sure qemu-img is installed."
exit 1
fi
qemu-img convert -f raw -O qcow2 "${VM_PATH}/${ISO}" "${VM_PATH}/disk.qcow2"
ISO="${ISO/.img/}"
else
ISO="${ISO/.zst/}"
fi
fi
}

View File

@ -656,23 +656,6 @@ function create_vm() {
# shellcheck disable=SC2076
case "${OS}" in
#TODO
redox-os)
if [[ ${ISO} =~ ".zst" ]]; then
zstd -d "${VM_PATH}/${ISO}"
ISO="${ISO/.zst/}"
if [[ ${ISO} =~ ".img" ]]; then
QEMU_IMG=$(command -v qemu-img)
if [ ! -x "${QEMU_IMG}" ]; then
echo $"ERROR! qemu-img not found. Please make sure qemu-img is installed."
exit 1
fi
qemu-img convert -f raw -O qcow2 "${VM_PATH}/${ISO}" "${VM_PATH}/disk.qcow2"
ISO="${ISO/.img/}"
else
ISO="${ISO/.zst/}"
fi
fi;;
esac
make_vm_config "${ISO}"
}