blob: 27af7aad60572b1351db398c7e6813f617f840df (
plain) (
tree)
|
|
# 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
TMPDIR="/tmp/${self}/${USER}"
# define dirs and files which can be removed after exit, be carefull!
RMDIRS="${TMPDIR}"
rm -rf ${RMDIRS} 2>/dev/null
mkdir -m 1777 -p ${TMPDIR} 2>/dev/null
# vmpath is the path to the emulator/original system image
diskfile=${vmpath}
# emulator is the information provided via xml file
emulator=$(grep -o 'virtualmachine param=.*"' ${xmlfile} \
| sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
rombios=$(grep -o 'rombios param=.*"' ${xmlfile} \
| sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
displayname=$(echo ${displayname} | sed -e "s, ,-,g")
VIRTCMD="${emulator}"
case "${emulator}" in
dosbox*|Dosbox*)
tar -xpzf ${diskfile} -C "${TMPDIR}"
emudir=$(ls ${TMPDIR})
[ $(echo ${filenumber}|wc|awk '{print $2}') -eq 1 ] && \
TMPDIR=${TMPDIR}/${emudir}
echo "# empty" > ${TMPDIR}/dosbox.conf
VIRTCMDOPTS="${emulator#*dosbox}"
VIRTCMDOPTS="${VIRTCMDOPTS} -conf ${TMPDIR}/dosbox.conf -fullscreen"
VIRTCMD="dosbox"
;;
SheepShaver*|sheepshaver*)
[ "x${rombios}" != "x" ] && rom="--rom ${xmlpath}${rombios}"
VIRTCMDOPTS="${VIRTCMDOPTS} --name ${displayname} ${rom}"
;;
hatari*|Hatari*)
;;
*mess*)
[ "x${rombios}" != "x" ] && rom="${xmlpath}${rombios}"
VIRTCMDOPTS="${VIRTCMDOPTS} ${rom}"
;;
*uae*)
[ "x${rombios}" != "x" ] && rom="-s kickstart_rom_file=${xmlpath}${rombios}"
VIRTCMDOPTS="${VIRTCMDOPTS} ${rom}"
;;
esac
writelog "Directories:"
writelog "\tTMPDIR:\t\t\t$TMPDIR"
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
################################################################################
|