blob: 11992270ed593614be28835b09afbedbce631dbb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#!/bin/sh
. slib
help() {
cat << EOF
${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
-x [input.qcow2] run input.qcow2
EOF
exit 0
}
check_program "qemu-img"
check_program "qemu-system-x86_64"
[ $# != 2 ] && [ $# != 1 ] && invalid_use
while getopts "cr:x:h" option ;do
case "${option}" in
c) run "qemu-img create -f qcow2 Image.img 10G" ;;
x) run "qemu-system-x86_64 -drive file=${OPTARG},format=qcow2 -enable-kvm -cpu host -smp 2 -m 2048 -net nic -net user -display sdl" ;;
r)
run "qemu-system-x86_64 -enable-kvm -cdrom ${OPTARG} \
-boot menu=on -drive file=Image.img -m 4G"
;;
h) help ;;
*) invalid_use -h ;;
esac
done
# Unreachable
invalid_use
|