mirror of
https://github.com/oSoWoSo/DistroHopper.git
synced 2024-08-14 22:46:53 +00:00
Allow using installed version of qemu (#28)
This commit is contained in:
parent
8618421abb
commit
df51b17d71
1 changed files with 23 additions and 8 deletions
21
quickemu
21
quickemu
|
@ -501,6 +501,7 @@ function usage() {
|
||||||
echo " --snapshot delete <tag> : Delete a snapshot."
|
echo " --snapshot delete <tag> : Delete a snapshot."
|
||||||
echo " --snapshot info : Show disk/snapshot info."
|
echo " --snapshot info : Show disk/snapshot info."
|
||||||
echo " --status-quo : Do not commit any changes to disk/snapshot."
|
echo " --status-quo : Do not commit any changes to disk/snapshot."
|
||||||
|
echo " --system-qemu : Use system install of qemu."
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,9 +528,9 @@ SHORTCUT=0
|
||||||
|
|
||||||
readonly LAUNCHER=$(basename "${0}")
|
readonly LAUNCHER=$(basename "${0}")
|
||||||
readonly DISK_MIN_SIZE=$((197632 * 8))
|
readonly DISK_MIN_SIZE=$((197632 * 8))
|
||||||
readonly QEMU="/snap/bin/qemu-virgil"
|
QEMU="/snap/bin/qemu-virgil"
|
||||||
readonly QEMU_IMG="/snap/bin/qemu-virgil.qemu-img"
|
QEMU_IMG="/snap/bin/qemu-virgil.qemu-img"
|
||||||
readonly VIRGIL_PATH="/snap/qemu-virgil/current"
|
VIRGIL_PATH="/snap/qemu-virgil/current"
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
|
@ -560,6 +561,9 @@ while [ $# -gt 0 ]; do
|
||||||
-shortcut|--shortcut)
|
-shortcut|--shortcut)
|
||||||
SHORTCUT=1
|
SHORTCUT=1
|
||||||
shift;;
|
shift;;
|
||||||
|
-system-qemu|--system-qemu)
|
||||||
|
SYSTEM_QEMU=1
|
||||||
|
shift;;
|
||||||
-h|--h|-help|--help)
|
-h|--h|-help|--help)
|
||||||
usage;;
|
usage;;
|
||||||
*)
|
*)
|
||||||
|
@ -568,12 +572,23 @@ while [ $# -gt 0 ]; do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ -n "$SYSTEM_QEMU" ]; then
|
||||||
|
QEMU=$(which qemu-system-x86_64)
|
||||||
|
QEMU_IMG=$(which qemu-img)
|
||||||
|
VIRGIL_PATH=""
|
||||||
|
if [ ! -e "${QEMU}" ] && [ ! -e "${QEMU_IMG}" ]; then
|
||||||
|
echo "ERROR! qemu not found. Please install qemu."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "WARNING! using system install of qemu. Please make sure virgil is supported."
|
||||||
|
else
|
||||||
# Check we have qemu-virgil available
|
# Check we have qemu-virgil available
|
||||||
if [ ! -e "${QEMU}" ] && [ ! -e "${QEMU_IMG}" ]; then
|
if [ ! -e "${QEMU}" ] && [ ! -e "${QEMU_IMG}" ]; then
|
||||||
echo "ERROR! qemu-virgil not found. Please install the qemu-virgil snap."
|
echo "ERROR! qemu-virgil not found. Please install the qemu-virgil snap."
|
||||||
echo " https://snapcraft.io/qemu-virgil"
|
echo " https://snapcraft.io/qemu-virgil"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${VM}" ] && [ -e "${VM}" ]; then
|
if [ -n "${VM}" ] && [ -e "${VM}" ]; then
|
||||||
source "${VM}"
|
source "${VM}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue