diff options
Diffstat (limited to 'os-plugins/plugins/vmchooser')
-rw-r--r-- | os-plugins/plugins/vmchooser/XX_vmchooser.sh | 2 | ||||
-rw-r--r-- | os-plugins/plugins/vmchooser/files/run-virt.sh | 26 | ||||
-rw-r--r-- | os-plugins/plugins/vmchooser/files/vmchooser | bin | 2323406 -> 2374039 bytes | |||
-rwxr-xr-x | os-plugins/plugins/vmchooser/files/xmlfilter.sh | 3 |
4 files changed, 17 insertions, 14 deletions
diff --git a/os-plugins/plugins/vmchooser/XX_vmchooser.sh b/os-plugins/plugins/vmchooser/XX_vmchooser.sh index 4f656478..7f8096c3 100644 --- a/os-plugins/plugins/vmchooser/XX_vmchooser.sh +++ b/os-plugins/plugins/vmchooser/XX_vmchooser.sh @@ -29,8 +29,6 @@ if [ -e $CONFFILE ]; then testmkd ${PLUGINCONFDIR}/loopimg testmkd ${PLUGINCONFDIR}/fd-loop 1777 cp $CONFFILE ${PLUGINCONFDIR}/vmchooser.conf - # TODO: remove vmchooser-stage3.conf when vmchooser path adapted - cp $CONFFILE /mnt/${OPENSLX_DEFAULT_CONFDIR}/vmchooser-stage3.conf ln -s ${PLUGINDIR}/run-virt.sh ${BINDIR}/run-virt.sh ln -s ${PLUGINDIR}/vmchooser ${BINDIR}/vmchooser diff --git a/os-plugins/plugins/vmchooser/files/run-virt.sh b/os-plugins/plugins/vmchooser/files/run-virt.sh index 4d210b88..d7a587f2 100644 --- a/os-plugins/plugins/vmchooser/files/run-virt.sh +++ b/os-plugins/plugins/vmchooser/files/run-virt.sh @@ -25,7 +25,7 @@ PLUGINCONFDIR=${OPENSLX_DEFAULT_CONFDIR}/plugins/vmchooser . ${PLUGINCONFDIR}/run-virt.include # Sanity checks -############################################################################### +################################################################################ # Theck for running in graphical environment otherwise no much use here [ -z "$DISPLAY" ] && echo -e "\n\tStart only within a graphical desktop!\n" \ @@ -36,10 +36,11 @@ xml=$1 [ -e "${xml}" ] || { echo -e "\n\tNo XML file given!\n"; exit 1; } # Read needed variables from XML file -############################################################################### +################################################################################ # File name of the image -imagename=$(grep -io "<image_name param=.*\"" ${xml} | awk -F "\"" '{ print $2 }') +imagename=$(grep -io "<image_name param=.*\"" ${xml} | \ + awk -F "\"" '{ print $2 }') case ${xml} in /tmp/*) @@ -47,7 +48,8 @@ case ${xml} in diskfile=$imagename ;; *) - # Path to the image (readlink produces the absolute path if called relatively) + # Path to the image + # (readlink produces the absolute path if called relatively) [ -z $imgpath ] && \ { imgpath=$(readlink -f $xml); imgpath=${imgpath%/*.xml}; } # Diskfile is file including absolute path to it @@ -88,21 +90,23 @@ if [ -z ${virt_mach} ] ; then fi # Definition of the client system -vmostype=$(grep -io "<os param=.*\"" ${xml} | awk -F "\"" '{ print $2 }') +vmostype=$(grep -io '<os param=.*"' ${xml} | awk -F '"' '{ print $2 }') # Definition of the networking the client system is connected to -network_kind=$(grep -io "<network param=.*\"" ${xml} | awk -F "\"" '{ print $2 }') -network_card=$(grep -io "<netcard param=.*\"" ${xml} | awk -F "\"" '{ print $2 }') +network_kind=$(grep -io '<network param=.*"' ${xml} | awk -F '"' '{ print $2 }') +network_card=$(grep -io '<netcard param=.*"' ${xml} | awk -F '"' '{ print $2 }') # Serial/parallel ports defined (e.g. "ttyS0" or "autodetect") -serial=$(grep -io "<serialport param=.*\"" ${xml} | awk -F "\"" '{ print $2 }') -parallel=$(grep -io "<parport param=.*\"" ${xml} | awk -F "\"" '{ print $2 }') +serial=$(grep -io '<serialport param=.*"' ${xml} | awk -F '"' '{ print $2 }') +parallel=$(grep -io '<parport param=.*"' ${xml} | awk -F '"' '{ print $2 }') # Declaration of default variables ############################################################################### # Get total amount of memory installed in your machine totalmem=$(expr $(grep -i "memtotal" /proc/meminfo | awk '{print $2}') / 1024) +permem=60 +mem=$(expr ${totalmem} / 100 \* ${permem} / 4 \* 4) # Configuring ethernet mac address: first four bytes are fixed (00:50:56:0D) # the last two bytes are taken from the first local network adaptor of the host @@ -156,7 +160,7 @@ filecheck () # Check if link if [ -L "${diskfile}" ]; then # take link target - rightsfile=$(ls -lh ${diskfile} 2>&1 | awk -F "-> *" '{print $2}') + rightsfile=$(ls -lh ${diskfile} 2>&1 | awk -F '-> *' '{print $2}') rightsfile=${vmdir}/${rightsfile} filecheck=$(LANG=us ls -lh ${rightsfile} 2>&1) fi @@ -227,7 +231,7 @@ 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% umute 2>/dev/null # In SUSE 11.0 it's Headphone +amixer -q sset Front 80% umute 2>/dev/null # in SUSE 11.0 it's headphone amixer -q sset Speaker 0 mute 2>/dev/null # annoying built-in speaker writelog "finished\n" diff --git a/os-plugins/plugins/vmchooser/files/vmchooser b/os-plugins/plugins/vmchooser/files/vmchooser Binary files differindex e2b7cc07..7badf25c 100644 --- a/os-plugins/plugins/vmchooser/files/vmchooser +++ b/os-plugins/plugins/vmchooser/files/vmchooser diff --git a/os-plugins/plugins/vmchooser/files/xmlfilter.sh b/os-plugins/plugins/vmchooser/files/xmlfilter.sh index 5e47e511..5196992c 100755 --- a/os-plugins/plugins/vmchooser/files/xmlfilter.sh +++ b/os-plugins/plugins/vmchooser/files/xmlfilter.sh @@ -38,7 +38,8 @@ for FILE in $1/*.xml; do if [ $(grep "<active param=.*true.*" ${FILE} | wc -l) -eq 1 ]; then if [ -n ${vmchooser_env} ]; then # filter all xmls with pool-param not equal to vmchooser::env - if [ $(grep "<pools param=\"${vmchooser_env}\"" ${FILE} | wc -l) -eq 1 ]; then + if [ $(grep "<pools param=\"${vmchooser_env}\"" ${FILE} | wc -l) -eq 1 ];\ + then echo ${FILE}; fi else |