mirror of
https://github.com/quickemu-project/quickemu.git
synced 2024-09-20 00:02:03 +02:00
Catch missing iso with non-bootable disk scenario
This commit is contained in:
parent
3a367090c2
commit
e566e38e9c
10
quickemu
10
quickemu
|
@ -115,8 +115,12 @@ function vm_boot() {
|
||||||
|
|
||||||
echo " - Disk: ${disk_img} (${disk})"
|
echo " - Disk: ${disk_img} (${disk})"
|
||||||
if [ ! -f "${disk_img}" ]; then
|
if [ ! -f "${disk_img}" ]; then
|
||||||
# If there is no disk image, create a new image.
|
# If there is no disk image, create a new image.
|
||||||
${QEMU_IMG} create -q -f qcow2 "${disk_img}" "${disk}"
|
${QEMU_IMG} create -q -f qcow2 "${disk_img}" "${disk}"
|
||||||
|
if [ -z "${iso}" ]; then
|
||||||
|
echo "ERROR! You haven't specified a .iso image to boot from."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
echo " Just created, booting from ${iso}"
|
echo " Just created, booting from ${iso}"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "ERROR! Failed to create ${disk_img} of ${disk}. Stopping here."
|
echo "ERROR! Failed to create ${disk_img} of ${disk}. Stopping here."
|
||||||
|
@ -132,6 +136,10 @@ function vm_boot() {
|
||||||
disk_curr_size=$(stat -c%s "${disk_img}")
|
disk_curr_size=$(stat -c%s "${disk_img}")
|
||||||
if [ ${disk_curr_size} -le ${disk_min_size} ]; then
|
if [ ${disk_curr_size} -le ${disk_min_size} ]; then
|
||||||
echo " Looks unused, booting from ${iso}"
|
echo " Looks unused, booting from ${iso}"
|
||||||
|
if [ -z "${iso}" ]; then
|
||||||
|
echo "ERROR! You haven't specified a .iso image to boot from."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# If there is a disk image, that appears to have an install
|
# If there is a disk image, that appears to have an install
|
||||||
# then do not boot from the iso
|
# then do not boot from the iso
|
||||||
|
|
Loading…
Reference in New Issue
Block a user