From 415a65c67f04884d94b7f14e83fca7b07bd6622b Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 7 Jul 2011 19:46:59 +0200 Subject: Extensions of the emufe plugin ... --- src/os-plugins/plugins/emufe/XX_emufe.sh | 4 +++ .../plugins/emufe/files/run-virt.include | 42 +++++++++++++++++----- 2 files changed, 37 insertions(+), 9 deletions(-) (limited to 'src/os-plugins/plugins/emufe') 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}" - -- cgit v1.2.3-55-g7522