diff options
author | Volker Uhrig | 2007-04-17 15:00:27 +0200 |
---|---|---|
committer | Volker Uhrig | 2007-04-17 15:00:27 +0200 |
commit | 1f1f96c88cf527f5d1aa5428d754c12b2a8c93a8 (patch) | |
tree | 22e7a3820bcf8cc5a479579ffc313d2fb8557d03 /virtualization | |
parent | AUFS changes. (diff) | |
download | core-1f1f96c88cf527f5d1aa5428d754c12b2a8c93a8.tar.gz core-1f1f96c88cf527f5d1aa5428d754c12b2a8c93a8.tar.xz core-1f1f96c88cf527f5d1aa5428d754c12b2a8c93a8.zip |
xdialog integrated, misc minor fixes
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@906 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'virtualization')
-rw-r--r-- | virtualization/README | 6 | ||||
-rwxr-xr-x | virtualization/menulist-creator | 55 | ||||
-rw-r--r-- | virtualization/templates/xdialog.sh | 19 |
3 files changed, 65 insertions, 15 deletions
diff --git a/virtualization/README b/virtualization/README index 28266e35..09d8196d 100644 --- a/virtualization/README +++ b/virtualization/README @@ -6,12 +6,14 @@ Earlier checkin, cause it was requested. Structure and files: - menulist-creator: - creates desktop entrys and runvmwares runscripts from - template using xml files + creates desktop entrys, runvmwares runscripts and + xdialog skript for the different Pools from template using + xml files - templates/runvmware-v2: runvmware-v2 template, needed by menulist-creator - templates/Vorlage_VMWareImageAdministrator.xml: example xml file with verbose description +- templates/ Goal: - better documentation of source and virtualisation diff --git a/virtualization/menulist-creator b/virtualization/menulist-creator index bf2eb607..d4da929c 100755 --- a/virtualization/menulist-creator +++ b/virtualization/menulist-creator @@ -12,6 +12,7 @@ ## ${vmdir}/$image.vbox vbox image file ## ${vmdir}/runscripts/$pool/*.vmware vmware runscript ## ${vmdir}/runscripts/$pool/*.vbox virtualbox runscript +## ${vmdir}/xdialog-files/$pool/*.xdialog xdialog menu entrys ## ${vmdir}/xdmsession/$pool/*.desktop .desktop files for xdm, ## can't avoid masses of them ## ${vmdir}/templates/runvmware-v2 image exec template script @@ -26,7 +27,6 @@ vmdir="." && cd ${vmdir} # template for runvmware templatevmware="${vmdir}/templates/runvmware-v2" - # Take all xml files and work with them for xml in *.xml;do @@ -143,6 +143,10 @@ for xml in *.xml;do ############################################################################## # Main part, creates desktopentrys and image run scripts + # TODO: Perhaps its better if we put runscripts, xdmsessions and + # xdialog-files in one big folder with subfolder runscripts, + # xdmsessions, xdialog-files + # check if ${vmdir}/runscripts/ is available if [ ! -d ${vmdir}/runscripts ]; then mkdir ${vmdir}/runscripts @@ -152,6 +156,11 @@ for xml in *.xml;do if [ ! -d ${vmdir}/xdmsessions ]; then mkdir ${vmdir}/xdmsessions fi + + # check if ${vmdir}/xdmsessions/ for .desktop files is available + if [ ! -d ${vmdir}/xdmsessions ]; then + mkdir ${vmdir}/xdialog-files + fi # work with the different pools and... for i in ${pools}; do @@ -162,12 +171,16 @@ for xml in *.xml;do if [ ! -d ${vmdir}/xdmsessions/${i} ]; then mkdir -p ${vmdir}/xdmsessions/${i} fi - # ... remove startscript and xdmsessions if it isn't active. + if [ ! -d ${vmdir}/xdialog-files/${i} ]; then + mkdir -p ${vmdir}/xdialog-files/${i} + fi + # ... remove startscript, xdmsessions and Xdialog files if it isn't active. if [ ${active} -ne 1 ]; then if [ -f ${vmdir}/runscripts/${i}/${image}.vmware \ -o -f runscripts/${i}/${image}.virtualbox ]; then rm -rf ${vmdir}/runscripts/${i}/${image}.* rm -rf ${vmdir}/xdmsessions/${i}/${image}.desktop + rm -rf ${vmdir}/xdialog-files/${i}/${image}.xdialog fi fi @@ -179,18 +192,18 @@ for xml in *.xml;do echo -e "\nCreating runfiles for ${image} and pool ${i}\n" # create the desktopentry #TODO: change it with < EOF, >> isnt nice for so much lines - echo "Desktop entry for ${image}" > \ - ${vmdir}/xdmsessions/${i}/${image}.desktop + echo "Desktop entry for ${image}" \ + >> ${vmdir}/xdmsessions/${i}/${image}.desktop echo "[Desktop Entry]" > ${vmdir}/xdmsessions/${i}/${image}.desktop - echo "X-SuSE-translate=true" >> \ - ${vmdir}/xdmsessions/${i}/${image}.desktop + echo "X-SuSE-translate=true" \ + >> ${vmdir}/xdmsessions/${i}/${image}.desktop echo "Encoding=UTF-8" >> ${vmdir}/xdmsessions/${i}/${image}.desktop echo "Type=XSession" >> ${vmdir}/xdmsessions/${i}/${image}.desktop #TODO: Fix path - echo "Exec=/path/to/the/execfile/${image}" >> \ - ${vmdir}/xdmsessions/${i}/${image}.desktop - echo "Name=${short_description}" >> \ - ${vmdir}/xdmsessions/${i}/${image}.desktop + echo "Exec=/path/to/the/execfile/${image}" \ + >> ${vmdir}/xdmsessions/${i}/${image}.desktop + echo "Name=${short_description}" \ + >> ${vmdir}/xdmsessions/${i}/${image}.desktop echo "Comment=${comment}" >> ${vmdir}/xdmsessions/${i}/${image}.desktop #TODO: I dont like SLXGrp as variable herein, why we need it here? #echo "SLXGrp=${pools}" >> ${vmdir}/xdmsessions/${i}/${image}.desktop @@ -199,15 +212,23 @@ for xml in *.xml;do fi - # If we have vmware, build execute from template + # If we have vmware, build executeable from template and + # Xdialog menu entrys if [ "${vm}" = "vmware" ]; then + # virtualmachine executable form template sed -e "s/imagename=\"CHANGEIT\"/imagename=\"${image}\"/" \ -e "s/displayname=\"CHANGEIT\"/displayname=\"${short_description}\"/" \ -e "s/vmostype=\"CHANGEIT\"/vmostype=\"${os}\"/" \ -e "s/network=\"CHANGEIT\"/network=\"${network}\"/" \ ${templatevmware} \ > ${vmdir}/runscripts/${i}/${image}.runvmware + + # Xdialog menu entrys + echo -e "\"${vmdir}/runscripts/${i}/${image}.vmware\" \\ + \"${short_description}\" \\ + \"${long_description}\" \\" \ + > ${vmdir}/xdialog-files/${i}/${image}.xdialog # if we have virtualbox, part here can only be vbox cause check above else @@ -215,10 +236,18 @@ for xml in *.xml;do exit 0 fi - done done +# Building Xdialog executable for each pool +for i in ${vmdir}/xdialog-files/*; do + cp ${vmdir}/templates/xdialog.sh ${i} + cat ${i}/*.xdialog >> ${i}/xdialog.sh + #closing bracket as last line invoked with \ + echo ")" >> ${i}/xdialog.sh +done + + # Delete all .utf files, we dont need them anymore -rm -f "*.xml.utf" +rm -f *.xml.utf diff --git a/virtualization/templates/xdialog.sh b/virtualization/templates/xdialog.sh new file mode 100644 index 00000000..520ac530 --- /dev/null +++ b/virtualization/templates/xdialog.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# This script will run Xdialog. menulist-create will add all menu entrys +# from the different .xdialog files +# +#TODO: change path_to_this_script to path of this file. needed, because +# a return will exit Xdialog + +exec $($(which Xdialog) --rc-file /var/lib/openslx/themes/Xdialog/gtkrc \ + --title "Desktop / VMware-ImageMenu" \ + --screen-center \ + --fill --no-wrap \ + --stdout \ + --no-tags \ + --ok-label "START" \ + --item-help \ + --menubox "Please choose the image you would like to run:" \ + 35 80 0 \ + "path_to_this_script" "No Image - Don't press return too fast" "" \ |