summaryrefslogtreecommitdiffstats
path: root/src/os-plugins/plugins/emufe/files/run-virt.include
blob: 913b0380c079636b45eb9efc854784c4a66f8bff (plain) (blame)
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
74
75
76
77
78
79
80
81
82
83
84
85
# run-virt.include
# -----------------------------------------------------------------------------
# Copyright (c) 2011 - RZ Uni Freiburg
# Copyright (c) 2011 - OpenSLX GmbH
#
# This program/file is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
#
# If you have any feedback please consult http://openslx.org/feedback and
# send your feedback to feedback@openslx.org
#
# General information about OpenSLX can be found at http://openslx.org
# -----------------------------------------------------------------------------
# run-virt.include
#    - Include script for running the various emulators via a common frontend 
#      script via the common run-virt.sh of the vmchooser
################################################################################

################################################################################
### Include general configuration
################################################################################
if [ -f ${OPENSLX_DEFAULT_CONFDIR}/plugins/${self}/${self}.conf ]; then
  . ${OPENSLX_DEFAULT_CONFDIR}/plugins/${self}/${self}.conf
else 
  writelog "Problems reading config file of ${self} plugin"
  # TODO: exit wenn conf wichtig
  #exit 1
fi

################################################################################
### Declaration of default variables
################################################################################

PLUGINCONFQK="${PLUGINCONFROOT}/${self}"
PLUGINDIRQK=${OPENSLX_DEFAULT_DIR}/plugin-repo/${self}
# create TMPDIR for all users
mkdir -m 1777 /tmp/${self} 2>/dev/null
# TMPDIR
QKTMPDIR="/tmp/${self}/${USER}/${VM_ID}"
# define dirs and files which can be removed after exit, be carefull!
RMDIRS="${QKTMPDIR}"
rm -rf ${RMDIRS} 2>/dev/null
mkdir -m 1777 -p ${QKTMPDIR} 2>/dev/null
# vmpath is the path to the emulator/original system image
diskfile=${vmpath}


# display name, remove blanks because of cmdline problems
displayname=$(echo ${displayname} | sed -e "s, ,-,g")
VIRTCMDOPTS="${VIRTCMDOPTS} -name ${displayname}"

writelog "Directories:"
writelog "\tTMPDIR:\t\t\t$QKTMPDIR"
writelog "Diskimage:"
writelog "\tDisk type:\t\t$imgtype"
writelog "\tDisk file:\t\t$diskfile"

################################################################################
### Emulator definitions
################################################################################


writelog "Virtual Hardware:"
writelog "\tGuest RAM:\t\t${mem} MB"
# echo nur wenn memhost gesetzt
[ -n "${memhost}" ] && writelog "\tHost RAM:\t\t${memhost} MB"
writelog "\tMAC address:\t\t$macaddr"
writelog "\tNetwork card:\t\t${network_card}"
writelog "\tNetwork kind:\t\t${network_kind}"
#writelog "\tCD-ROM1:\t${cdrom0}"
#writelog "\tCD-ROM2:\t${cdrom1}"
#writelog "\tFloppy_A:\t${floppy0}"
#writelog "\tFloppy_B:\t${floppy1}"
#writelog "\tShared Folders 'home':\t/home/${USER}"

################################################################################
### finally set env for run-virt.sh
################################################################################


# define first, you do not want VIRTCMDOPTS from graphical start
VIRTCMDHL=${VIRTCMD}
VIRTCMDOPTSHL="${VIRTCMDOPTS} -nographic ${diskfile}"