diff options
Diffstat (limited to 'remote/modules/vmchooser')
12 files changed, 121 insertions, 50 deletions
diff --git a/remote/modules/vmchooser/data/etc/openslx/vmchooser/virtualization.conf b/remote/modules/vmchooser/data/etc/openslx/vmchooser/virtualization.conf new file mode 100644 index 00000000..8887ee6f --- /dev/null +++ b/remote/modules/vmchooser/data/etc/openslx/vmchooser/virtualization.conf @@ -0,0 +1,8 @@ +totalmem=1000 +cpu_cores=1 +host_arch=i686 +vtflag=0 +hostmacaddr=00:0c:29:4e:ee:57 +hostip=132.230.4.54 +hostname=slx-client +cdrom_0=/dev/sr0 diff --git a/remote/modules/vmchooser/data/etc/systemd/system/var-lib-virt.mount b/remote/modules/vmchooser/data/etc/systemd/system/var-lib-virt.mount new file mode 100644 index 00000000..704606a6 --- /dev/null +++ b/remote/modules/vmchooser/data/etc/systemd/system/var-lib-virt.mount @@ -0,0 +1,10 @@ +[Unit] + Description=Mount vm-store NFS + + [Mount] + What=vm-store.public.ads.uni-freiburg.de:vmwareImages/vmware/vmware65 + Where=/var/lib/virt + Type=nfs + Options=rw,async,nolock,vers=3 + StandardOutput=syslog + StandardError=syslog diff --git a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/run-virt.sh b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh index b3863a2e..9314bb42 100755 --- a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/run-virt.sh +++ b/remote/modules/vmchooser/data/opt/openslx/bin/run-virt.sh @@ -18,27 +18,25 @@ # fied virtualization tool. ################################################################################ -. /etc/opt/openslx/openslx.conf - ################################################################################ ### Define default dirs / get configs ################################################################################ -PLUGINCONFROOT=${OPENSLX_DEFAULT_CONFDIR}/plugins -PLUGINCONFDIR=${PLUGINCONFROOT}/vmchooser +PLUGINCONFROOT=/etc/opt/openslx/plugins +PLUGINCONFDIR=/etc/opt/openslx/plugins/vmchooser # include general configuration from vmchooser -[ -f ${PLUGINCONFROOT}/vmchooser/vmchooser.conf ] && \ - . ${PLUGINCONFROOT}/vmchooser/vmchooser.conf +[ -f /etc/openslx/vmchooser/vmchooser.conf ] && \ + . /etc/openslx/vmchooser/vmchooser.conf # load general virtualization information -[ -f ${PLUGINCONFROOT}/virtualization/virtualization.conf ] && \ - . ${PLUGINCONFROOT}/virtualization/virtualization.conf +[ -f /etc/openslx/vmchooser/virtualization.conf ] && \ + . /etc/openslx/vmchooser/virtualization.conf ################################################################################ ### Functions used throughout the script ################################################################################ # function to write to stdout and logfile -LOGFILE=${OPENSLX_DEFAULT_LOGDIR}/run-virt.${USER}.$$.log +LOGFILE=/var/log/openslx/run-virt.${USER}.$$.log writelog () { # write to stdout echo -e "$1" @@ -118,7 +116,7 @@ if ls ${xmlfile} 2>/dev/null | grep '/' >/dev/null 2>&1; then xmlpath=$(dirname ${xmlfile}) xmlfile=$(basename ${xmlfile}) else - xmlpath=${vmchooser_xmlpath} + xmlpath=${path} fi # full path xmlfile="${xmlpath}/${xmlfile%.xml}.xml" @@ -318,7 +316,7 @@ fdtest=${floppy_0:+"TRUE"} # if $fdtest not set floppy0="FALSE", else "TRUE" floppy0=${fdtest:-"FALSE"} floppy1="TRUE" -floppy1name="${PLUGINCONFDIR}/loopimg/fd.img" +floppy1name="/etc/openslx/vmchooser/loopimg/fd.img" # if $cdrom_0 from run-virt.include set then cdtest="TRUE" cdtest= cdtest=${cdrom_0:+"TRUE"} @@ -379,30 +377,31 @@ writelog "\tVM Hostname:\t\t$hostname" ### Setup the rest of the environment and run the configured vm ################################################################################ +#TODO: ALSA MIXER IN STAGE32 # Adjust sound volume -writelog "Unmuting sound...\c " -amixer -q sset Master 80% unmute 2>/dev/null -amixer -q sset PCM 80% unmute 2>/dev/null -amixer -q sset CD 80% unmute 2>/dev/null -amixer -q sset Headphone 80% unmute 2>/dev/null -amixer -q sset Front 80% unmute 2>/dev/null # in SUSE 11.0 it's headphone -amixer -q sset Speaker 80% unmute 2>/dev/null # annoying built-in speaker -writelog "finished\n" +#writelog "Unmuting sound...\c " +#amixer -q sset Master 80% unmute 2>/dev/null +#amixer -q sset PCM 80% unmute 2>/dev/null +#amixer -q sset CD 80% unmute 2>/dev/null +#amixer -q sset Headphone 80% unmute 2>/dev/null +#amixer -q sset Front 80% unmute 2>/dev/null # in SUSE 11.0 it's headphone +#amixer -q sset Speaker 80% unmute 2>/dev/null # annoying built-in speaker +#writelog "finished\n" # Copy guest configuration (with added information) config.xml to be accessed # via virtual floppy # fixme -> to be changed (vmchooser adapts the file content!?) #TODO: wozu echo? #echo "Please fix the config.xml generation" -cp ${xmlfile} ${PLUGINCONFDIR}/fd-loop/config.xml +cp ${xmlfile} /etc/openslx/vmchooser/fd-loop/config.xml # Get all virtual machine specific stuff from the respective include file -if [ -e ${PLUGINCONFROOT}/${xmlvirt}/run-virt.include ] ; then +if [ -e /etc/openslx/${xmlvirt}/run-virt.include ] ; then self=${xmlvirt} - . ${PLUGINCONFROOT}/${xmlvirt}/run-virt.include + . /etc/openslx/${xmlvirt}/run-virt.include # start a windowmanager for easier handling # (expect problems /w windows opening in background /w vmware without wm) - for dm in xfwm4 metacity openbox blackbox kwin fvwm2 ; do + for dm in twm xfwm4 metacity openbox blackbox kwin fvwm2 ; do if which $dm >/dev/null 2>&1 ; then if [ "$dm" = "fvwm2" ] ; then echo "EdgeScroll 0 0" > ${redodir}/fvwm @@ -414,9 +413,9 @@ if [ -e ${PLUGINCONFROOT}/${xmlvirt}/run-virt.include ] ; then fi done # Start poolvideoswitch if we find the autostarter file - if [ -e /etc/xdg/autostart/pvsgui.desktop ]; then - /usr/local/bin/pvsgui -p 2 -b >/dev/null 2>&1 & - fi + #if [ -e /etc/xdg/autostart/pvsgui.desktop ]; then + # /usr/local/bin/pvsgui -p 2 -b >/dev/null 2>&1 & + #fi eval ${VIRTCMD} ${VIRTCMDOPTS} writelog "Bye." diff --git a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/xmlfilter.sh b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh index ded5d114..ded5d114 100755 --- a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/xmlfilter.sh +++ b/remote/modules/vmchooser/data/opt/openslx/bin/xmlfilter.sh diff --git a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/vmplayer b/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/vmplayer deleted file mode 100755 index c9b57a65..00000000 --- a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/vmplayer +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# written by OpenSLX-plugin 'vmware' in Stage1 -# radically simplified version of the original script vmplayer by VMware Inc. -PREFIX=/usr/lib/vmware # depends on the vmware location -exec "$PREFIX"'/lib/wrapper-gtk24.sh' \ - "$PREFIX"'/lib' \ - "$PREFIX"'/bin/vmplayer' \ - "$PREFIX"'/libconf' "$@" diff --git a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/vmware b/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/vmware deleted file mode 100755 index 8b568f53..00000000 --- a/remote/modules/vmchooser/data/opt/openslx/vmchooser/bin/vmware +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -# written by OpenSLX-plugin 'vmware' in Stage1 -# radically simplified version of the original script vmware by VMware Inc. -PREFIX=/usr/lib/vmware # depends on the vmware location -exec "$PREFIX"'/lib/wrapper-gtk24.sh' \ - "$PREFIX"'/lib' \ - "$PREFIX"'/bin/vmware' \ - "$PREFIX"'/libconf' "$@" diff --git a/remote/modules/vmchooser/data/usr/local/share/icons/xterm_48x48.xpm b/remote/modules/vmchooser/data/usr/local/share/icons/xterm_48x48.xpm new file mode 100644 index 00000000..44fb8109 --- /dev/null +++ b/remote/modules/vmchooser/data/usr/local/share/icons/xterm_48x48.xpm @@ -0,0 +1,53 @@ +/* XPM */ +static char * xterm_48x48_xpm[] = { +"48 48 2 1", +" c #000000", +". c #FFFFFF", +"................................................", +"...... ........", +"..... .................................. ......", +"..... ... ... . .....", +"..... .. ............................ .. .. ....", +"..... . .............................. . ... ...", +"..... . . .... ................... . .... ..", +"..... . .. .... .................... . .... ..", +"..... . ... .. ..................... . .... ..", +"..... . ... .. ..................... . .... ..", +"..... . .... ...................... . .... ..", +"..... . .... ...................... . .... ..", +"..... . ..... ....................... . .... ..", +"..... . .... ...................... . .... ..", +"..... . .... ...................... . .... ..", +"..... . ... .. ..................... . .... ..", +"..... . ... .. ..................... . .... ..", +"..... . .. .... .................... . .... ..", +"..... . . .... ................... . .... ..", +"..... . .............................. . .... ..", +"..... . .............................. . .... ..", +"..... . . . .. ... ... . . .... ..", +"..... . ... .... ...... ... .. ... . . .... ..", +"..... . ... .... ...... ... .. . . . . . .... ..", +"..... . ... .... ... ... . . . . . .... ..", +"..... . ... .... ...... . .... .. .. . . ... ...", +"..... . ... .... ...... .. ... .. .. . . ... ...", +"..... . ... .... .. ... .. ..... . . .. ....", +"..... . .............................. . .. ....", +"..... . .............................. . . .....", +"..... .. ............................ .. . .....", +"..... ... ... ......", +"..... .................................. ......", +"...... ........", +"................................................", +"................................................", +"...... ......", +"..... .................................. ......", +"..... . . . . . . . . . . . . . . . . .. ......", +".... .................................. . ......", +".... . . . . . . . . . . . . . . . . .. . ......", +"... .................................. .. ......", +"... . . . . . . . . . . . . . . . . .. .. ......", +".. .................................. .. .......", +".. . . . . . ........", +". .................................. . .........", +". ..........", +"................................................"}; diff --git a/remote/modules/vmchooser/data/usr/share/xsessions/default.desktop b/remote/modules/vmchooser/data/usr/share/xsessions/default.desktop index 48812a8e..d33615cf 100755 --- a/remote/modules/vmchooser/data/usr/share/xsessions/default.desktop +++ b/remote/modules/vmchooser/data/usr/share/xsessions/default.desktop @@ -4,7 +4,7 @@ Name=virtual machine chooser (default) Name[de]=Virtuelle Maschine auswählen Comment=This session starts the vm session chooser Comment[de]=Diese Sitzung startet das Auswahlmenü für die vorhandenen Sitzungen -Exec=/opt/openslx/vmchooser/bin/vmchooser -c /etc/openslx/vmchooser/vmchooser.conf -TryExec=/opt/openslx/vmchooser/bin/vmchooser -c /etc/openslx/vmchooser/vmchooser.conf +Exec=/opt/openslx/bin/vmchooser -c /etc/openslx/vmchooser/vmchooser.conf +TryExec=/opt/openslx/bin/vmchooser Icon= Type=Application diff --git a/remote/modules/vmchooser/data/usr/share/xsessions/xterm.desktop b/remote/modules/vmchooser/data/usr/share/xsessions/xterm.desktop new file mode 100755 index 00000000..150b65f2 --- /dev/null +++ b/remote/modules/vmchooser/data/usr/share/xsessions/xterm.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=Xterm +Name[de]=Xterm +Comment=This session starts Xterm +Comment[de]=Diese Sitzung startet Xterm +Exec=/usr/bin/xterm -fullscreen +TryExec=/usr/bin/xterm +Icon=/usr/local/share/icons/xterm_48x48.xpm +Type=Application diff --git a/remote/modules/vmchooser/data/var/opt/openslx/bin/run-virt.sh b/remote/modules/vmchooser/data/var/opt/openslx/bin/run-virt.sh new file mode 120000 index 00000000..ea04a6ad --- /dev/null +++ b/remote/modules/vmchooser/data/var/opt/openslx/bin/run-virt.sh @@ -0,0 +1 @@ +/opt/openslx/bin/run-virt.sh
\ No newline at end of file diff --git a/remote/modules/vmchooser/vmchooser.build b/remote/modules/vmchooser/vmchooser.build index 340b1d9a..facd8c54 100644 --- a/remote/modules/vmchooser/vmchooser.build +++ b/remote/modules/vmchooser/vmchooser.build @@ -5,11 +5,17 @@ fetch_source() { } build() { - cd src - pinfo "Running vmchooser buildscript" - . build.sh - pinfo "" - cd - &> /dev/null + +SRCDIR="${MODULE_DIR}/src/" + +[ ! -d "${MODULE_BUILD_DIR}/${PREFIX}" ] && mkdir -p "${MODULE_BUILD_DIR}/${PREFIX}" +cd "${MODULE_BUILD_DIR}/${PREFIX}" + +pinfo "Running make" +cmake $CMAKE_ARGS $SRCDIR && make + +cd - &> /dev/null + } post_copy() { diff --git a/remote/modules/vmchooser/vmchooser.conf b/remote/modules/vmchooser/vmchooser.conf index 4054d59b..976384aa 100644 --- a/remote/modules/vmchooser/vmchooser.conf +++ b/remote/modules/vmchooser/vmchooser.conf @@ -1,5 +1,5 @@ GIT=git://git.openslx.org/openslx/tools/vmchooser.git REQUIRED_DEPENDENCIES=" cmake libqt4-dev" -TARGET_DIR="opt/openslx/vmchooser/bin" +PREFIX="/opt/openslx/bin" REQUIRED_BINARIES="vmchooser" |