summaryrefslogtreecommitdiffstats
path: root/src/os-plugins
diff options
context:
space:
mode:
authorDirk2011-07-07 19:46:59 +0200
committerDirk2011-07-07 19:46:59 +0200
commit415a65c67f04884d94b7f14e83fca7b07bd6622b (patch)
tree0c580962f13742f93c89792caf0d795103444ee9 /src/os-plugins
parent... (diff)
downloadcore-415a65c67f04884d94b7f14e83fca7b07bd6622b.tar.gz
core-415a65c67f04884d94b7f14e83fca7b07bd6622b.tar.xz
core-415a65c67f04884d94b7f14e83fca7b07bd6622b.zip
Extensions of the emufe plugin ...
Diffstat (limited to 'src/os-plugins')
-rw-r--r--src/os-plugins/plugins/emufe/XX_emufe.sh4
-rw-r--r--src/os-plugins/plugins/emufe/files/run-virt.include42
-rw-r--r--src/os-plugins/plugins/vmchooser/files/run-virt.sh9
3 files changed, 44 insertions, 11 deletions
diff --git a/src/os-plugins/plugins/emufe/XX_emufe.sh b/src/os-plugins/plugins/emufe/XX_emufe.sh
index e1439912..22dabdf5 100644
--- a/src/os-plugins/plugins/emufe/XX_emufe.sh
+++ b/src/os-plugins/plugins/emufe/XX_emufe.sh
@@ -15,6 +15,10 @@
# include default directories
. /etc/openslx.conf
+ETCDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR}
+PLUGINCONFDIR=${ETCDIR}/plugins/emufe
+BINDIR=/mnt/${OPENSLX_DEFAULT_BINDIR}
+PLUGINDIR=/mnt/${OPENSLX_DEFAULT_DIR}/plugin-repo/emufe
VIRTDIR=/mnt/${OPENSLX_DEFAULT_VIRTDIR}
# check if the configuration file is available
diff --git a/src/os-plugins/plugins/emufe/files/run-virt.include b/src/os-plugins/plugins/emufe/files/run-virt.include
index 913b0380..e3fbfb7f 100644
--- a/src/os-plugins/plugins/emufe/files/run-virt.include
+++ b/src/os-plugins/plugins/emufe/files/run-virt.include
@@ -36,21 +36,49 @@ 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}"
+TMPDIR="/tmp/${self}/${USER}/${VM_ID}"
# define dirs and files which can be removed after exit, be carefull!
-RMDIRS="${QKTMPDIR}"
+RMDIRS="${TMPDIR}"
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}
+# 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}')
-# display name, remove blanks because of cmdline problems
displayname=$(echo ${displayname} | sed -e "s, ,-,g")
-VIRTCMDOPTS="${VIRTCMDOPTS} -name ${displayname}"
+
+VIRTCMD="${emulator}"
+
+case "${emulator}" in
+ dosbox*|Dosbox*)
+ tar -xpzf ${diskfile} -C "${TMPDIR}"
+ VIRTCMDOPTS="${VIRTCMDOPTS} ${TMPDIR}"
+ ;;
+ 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$QKTMPDIR"
+writelog "\tTMPDIR:\t\t\t$TMPDIR"
writelog "Diskimage:"
writelog "\tDisk type:\t\t$imgtype"
writelog "\tDisk file:\t\t$diskfile"
@@ -78,8 +106,4 @@ writelog "\tNetwork kind:\t\t${network_kind}"
################################################################################
-# define first, you do not want VIRTCMDOPTS from graphical start
-VIRTCMDHL=${VIRTCMD}
-VIRTCMDOPTSHL="${VIRTCMDOPTS} -nographic ${diskfile}"
-
diff --git a/src/os-plugins/plugins/vmchooser/files/run-virt.sh b/src/os-plugins/plugins/vmchooser/files/run-virt.sh
index c4866212..e38c0f19 100644
--- a/src/os-plugins/plugins/vmchooser/files/run-virt.sh
+++ b/src/os-plugins/plugins/vmchooser/files/run-virt.sh
@@ -211,6 +211,11 @@ displayname=${vm_name}
xmlvirt=$(grep -o 'virtualmachine param=.*"' ${xmlfile} \
| sed -e "s/&.*;/; /g" | awk -F '"' '{print $2}')
+# choose the proper virtualization/emulator plugin
+[ "x${xmlvirt}" != "x" -a "x${xmlvirt}" != "xqemukvm" -a \
+ "x${xmlvirt}" != "xvirtualbox" -a "x${xmlvirt}" != "xvmware" ] && \
+ xmlvirt="emulator"
+
# make a guess from the filename extension if ${xmlvirt} is empty
# (not set within the XML file)
# TODO: implement possibility to submit own configuration files
@@ -239,11 +244,11 @@ elif [ -z "${xmlvirt}" ]; then
vbox)
xmlvirt="virtualbox"
;;
- img|qcow*)
+ qcow*)
xmlvirt="qemukvm"
;;
*)
- xmlvirt="none"
+ xmlvirt="emulator"
;;
esac
writelog "result:\t${xmlvirt}"