-
Notifications
You must be signed in to change notification settings - Fork 0
/
rainymac.sh
executable file
·73 lines (61 loc) · 1.57 KB
/
rainymac.sh
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env bash
# Do not touch this if you don't know what you're doing !!
# Added this so the script can be executed from outside the directory it resides
pushd $(dirname "${0}") > /dev/null
basedir=$(pwd -L)
source ./rainymac.cfg
args=()
args+=("-L pc-bios")
args+=("-m $ram")
args+=("-boot $bootdevice ")
args+=("-prom-env 'boot-args=$bootargs'")
args+=("-prom-env 'vga-ndrv?=true'")
args+=("-M $machine")
args+=("-cpu $cpu")
args+=("-hda $hdd")
args+=("-boot $bootdevice")
# Probably not so efficient but whatever it works
if [ $cdrom == on ]
then
args+=("-cdrom $iso")
fi
if [ $usbaudio == on ]
then
args+=("-device ich9-usb-uhci1,id=newusb -device usb-audio,bus=newusb.0")
fi
if [ $autoboot == off ]
then
args+=("-prom-env \"auto-boot?=false\"")
fi
if [ $networking == on ] && [ $ssh_forward == on ]
then
args+=("-netdev user,id=mynet0,hostfwd=tcp::5555-:22 -device sungem,netdev=mynet0")
elif [ $networking == on ]
then
args+=("-netdev user,id=mynet0 -device sungem,netdev=mynet0")
elif [ $networking == off ]
then
args+=("-nic none")
fi
if [ $usbtablet == on ]
then
args+=("-device usb-tablet")
fi
if [ $accelerate_with_tcg == on ]
then
args+=("-accel tcg")
fi
if [ $ssh_forward == on ]
then
printf "SSH is running on port 5555\n"
printf "Connect using ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 -c 3des-cbc localhost -p 5555\n"
fi
if [ $vnc == on ]
then
printf "Starting with VNC on port 5900\n"
args+=("-vnc :0")
fi
qemu_args="${args[*]}"
printf "Starting qemu with options $qemu_args\n"
$qemu $qemu_args
popd > /dev/null