summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuleyman Farajli <suleyman@farajli.net>2024-10-14 20:25:44 +0400
committerSuleyman Farajli <suleyman@farajli.net>2024-10-14 20:25:44 +0400
commit664e9f72246567ff96834678e555539ad630fa37 (patch)
tree36824e8893d2a90e50fac2504279092b864105b7
parentee42814fee4507da61763438caa8a601ecb21d71 (diff)
scripts qw: new option was added to run qcow2 files
-rwxr-xr-xscripts/qw13
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/qw b/scripts/qw
index 1a1fe5a..6732ca8 100755
--- a/scripts/qw
+++ b/scripts/qw
@@ -6,8 +6,9 @@ ${0}: Qemu Wrapper, very simple script for abriviating \
verbose qemu commands and options
options:
- -c create an Image.img with 10G space
- -r [input.iso] run input.iso
+ -c create an Image.img with 10G space
+ -r [input.iso] run input.iso
+ -x [input.qcow2] run input.qcow2
EOF
}
@@ -36,17 +37,21 @@ if [ $# != 2 ] && [ $# != 1 ]; then
err "${0}: Invalid usage" "Try '${0} -h' for help."
fi
-while getopts "cr:h" option ;do
+while getopts "cr:x:h" option ;do
case "${option}" in
c)
run "qemu-img create -f qcow2 Image.img 10G" \
- "${0}: Failed to create Image.img"
+ "${0}: Failed to create Image.img"
;;
r)
run "qemu-system-x86_64 -enable-kvm -cdrom ${OPTARG} \
-boot menu=on -drive file=Image.img -m 4G" \
"${0}: Failed to run image"
;;
+ x)
+ run "qemu-system-x86_64 -drive file=${OPTARG},format=qcow2 -enable-kvm" \
+ "${0}: Failed to run image"
+ ;;
h) help; exit 0;;
*) err "Try '${0} -h' for help." ;;