forked from daynix/VirtHCK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_hck_studio.sh
executable file
·45 lines (36 loc) · 1.91 KB
/
run_hck_studio.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
#!/bin/sh
# Copyright (c) 2013, Daynix Computing LTD (www.daynix.com)
# All rights reserved.
#
# Maintained by [email protected]
#
# This file is a part of Bricklets library, see "Bricklets" page
# on www.daynix.com for more.
#
# This code is licensed under standard 3-clause BSD license.
# See file LICENSE supplied with this package for the full license text.
echo "Starting HCK studio..."
. `dirname $0`/hck_setup.cfg
STUDIO_CONTROL_IFNAME=cs_${UNIQUE_ID}
STUDIO_CONTROL_MAC=56:cc:cc:ff:cc:cc
STUDIO_TRANSFER_MAC=56:aa:aa:ff:aa:aa
STUDIO_WORLD_IFNAME=ws_${UNIQUE_ID}
STUDIO_WORLD_MAC=56:${UNIQUE_ID}:${UNIQUE_ID}:${UNIQUE_ID}:${UNIQUE_ID}:${UNIQUE_ID}
WORLD_NET_DEVICE="-netdev tap,id=hostnet0,script=${HCK_ROOT}/hck_world_bridge_ifup.sh,downscript=no,ifname=${STUDIO_WORLD_IFNAME}
-device ${WORLD_NET_DEVICE},netdev=hostnet0,mac=${STUDIO_WORLD_MAC},bus=pci.0,id=${STUDIO_WORLD_IFNAME}"
CTRL_NET_DEVICE="-netdev tap,id=hostnet1,script=${HCK_ROOT}/hck_ctrl_bridge_ifup.sh,downscript=no,ifname=${STUDIO_CONTROL_IFNAME}
-device ${CTRL_NET_DEVICE},netdev=hostnet1,mac=${STUDIO_CONTROL_MAC},bus=pci.0,id=${STUDIO_CONTROL_IFNAME}"
if [ ${SHARE_ON_HOST} != "false" ]; then
FILE_TRANSFER_SETUP="-netdev user,id=filenet0,net=${SHARE_ON_HOST_NET}.0/24,dhcpstart=${SHARE_ON_HOST_NET}.15,smb=${SHARE_ON_HOST},smbserver=${SHARE_ON_HOST_NET}.1,restrict=on \
-device ${FILE_TRANSFER_DEVICE},netdev=filenet0,mac=${STUDIO_TRANSFER_MAC}"
fi
${QEMU_BIN} \
-drive file=${STUDIO_IMAGE},if=ide${DRIVE_CACHE_OPTION} \
${WORLD_NET_DEVICE} \
${CTRL_NET_DEVICE} \
${FILE_TRANSFER_SETUP} \
-m 768M -smp 1 -enable-kvm -cpu qemu64,+x2apic,+fsgsbase -usbdevice tablet \
-uuid 9999127c-8795-4e67-95da-8dd0a8891cd1 \
-name HCK-Studio_${UNIQUE_ID}_`hostname`${_TITLE_POSTFIX} \
-rtc base=localtime \
${GRAPHICS_STUDIO} ${MONITOR_STUDIO} ${SNAPSHOT_OPTION} ${STUDIO_EXTRA} $1