DoRelease - Switch to bash so replacement works
[tpg/acess2.git] / RunQemu
1 #!/bin/sh
2 #qemu-system-x86_64 -fda DiskImage.img -boot a -serial stdio -net user,hostname=prelude,dns=10.0.2.1 -net nic,model=ne2k_pci -vga std
3
4 QEMU=qemu-system-x86_64
5 USE_GDB=
6 BOOTOPT="-fda DiskImage.img -boot a"
7
8 QEMU_PARAMS=""
9 QEMU_PARAMS=$QEMU_PARAMS" -hda AcessHDD.img"
10 QEMU_PARAMS=$QEMU_PARAMS" -vga std"
11 QEMU_PARAMS=$QEMU_PARAMS" -smp 2"
12
13 _NETTYPE="user,hostfwd=tcp::5555-:23"
14 _NETMODEL=e1000
15
16 _EVAL=eval
17
18 while [ $# -ne 0 ]; do
19         case $1 in
20         -gdb)
21                 QEMU_PARAMS=$QEMU_PARAMS" -s -S"
22                 ;;
23         -dbin)
24                 shift
25                 if [ "x$2" = "xdefault" ] || [ "x$2" = "x" ]; then
26                         _kfile="KernelLand/Acess2.$1.bin"
27                 else
28                         _kfile="KernelLand/Acess2.$1-$2.bin"
29                 fi
30                 BOOTOPT="-kernel $_kfile"
31                 BOOTOPT=$BOOTOPT" -initrd KernelLand/Modules/Filesystems/FS_InitRD.kmd.$1 -append \"$3\""
32                 shift
33                 shift
34                 ;;
35         -dbgbin)
36                 QEMU=/home/tpg/apps/bin/qemu-system-x86_64
37                 ;;
38         -bin)
39                 shift
40                 QEMU=$1
41                 ;;
42         -dbgscript)
43                 QEMU="echo $QEMU"
44                 ;;
45         -extramem)
46                 QEMU_PARAMS=$QEMU_PARAMS" -m 768"
47                 ;;
48         -e)
49                 shift
50                 QEMU_PARAMS=$QEMU_PARAMS" "$1
51                 ;;
52         -n)
53                 _EVAL=echo
54                 ;;
55         -fwd)
56                 _NETTYPE=$_NETTYPE",hostfwd=tcp::10023-10.0.2.10:23"
57                 ;;
58         -tuntap)
59                 _NETTYPE="tap"
60                 ;;
61         -nousb)
62                 _NOUSB="yes"
63                 ;;
64         -notee)
65                 _NOTEE="yes"
66                 ;;
67         -nographic)
68                 _NOGRAPHIC="yes"
69                 ;;
70         -netmodel)
71                 shift
72                 _NETMODEL=$1
73                 ;;
74         esac
75         shift
76 done
77
78 QEMU_PARAMS=$QEMU_PARAMS" -net nic,model="$_NETMODEL
79 QEMU_PARAMS=$QEMU_PARAMS" -net "$_NETTYPE
80
81 if [ "x$_NOUSB" != "xyes" ] ; then
82         QEMU_PARAMS=$QEMU_PARAMS" -usb"
83         QEMU_PARAMS=$QEMU_PARAMS" -device usb-ehci"
84         QEMU_PARAMS=$QEMU_PARAMS" -drive id=test_usb_image,file=USB_Test_Image.img,if=none"
85         QEMU_PARAMS=$QEMU_PARAMS" -device usb-storage,drive=test_usb_image"
86         QEMU_PARAMS=$QEMU_PARAMS" -usbdevice mouse"
87 #       QEMU_PARAMS=$QEMU_PARAMS" -usbdevice keyboard"
88 fi
89
90 if [ "x$_NOTEE" = "xyes" ] ; then
91         _TEECMD=
92 else
93         _TEECMD=" | tee QemuLog.txt"
94 fi
95
96 #       /home/tpg/apps/bin/qemu-system-x86_64 $QEMU_PARAMS -serial stdio -serial file:QemuLog.txt
97 #       qemu-system-x86_64 $QEMU_PARAMS -serial stdio | tee QemuLog.txt
98 #echo $QEMU $BOOTOPT $QEMU_PARAMS
99 if [ "x$_NOGRAPHIC" = "xyes" ] ; then
100         $_EVAL $QEMU $BOOTOPT $QEMU_PARAMS -nographic $_TEECMD
101         exit
102 fi
103
104 $_EVAL $QEMU $BOOTOPT $QEMU_PARAMS -serial stdio $_TEECMD

UCC git Repository :: git.ucc.asn.au