diff options
| author | Jonathan Bauer | 2013-11-26 15:08:26 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2013-11-26 15:08:26 +0100 |
| commit | 412423798480ab11047a73fc79d82546c050e082 (patch) | |
| tree | e667b326a6a129ea4827638def89a6945f5bbce0 /remote/modules/vmchooser/data | |
| parent | [pam-freiburg] improved the pam-script scripts: each user now gets a (diff) | |
| parent | <stage4 blacklist> do not exclude pulseaudio anymore, needed for most desktop... (diff) | |
| download | tm-scripts-412423798480ab11047a73fc79d82546c050e082.tar.gz tm-scripts-412423798480ab11047a73fc79d82546c050e082.tar.xz tm-scripts-412423798480ab11047a73fc79d82546c050e082.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote/modules/vmchooser/data')
| -rwxr-xr-x | remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env | 56 | ||||
| -rwxr-xr-x | remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt | 23 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/config/smb.conf (renamed from remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/smb.conf) | 0 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/config/vmchooser.conf (renamed from remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/vmchooser.conf) | 0 | ||||
| -rwxr-xr-x | remote/modules/vmchooser/data/opt/openslx/vmchooser/data/openslx.exe (renamed from remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/openslx.exe) | bin | 12800 -> 12800 bytes | |||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool-left.png (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool-left.png) | bin | 5361 -> 5361 bytes | |||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool-right.png (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool-right.png) | bin | 3390 -> 3390 bytes | |||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool.ini (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool.ini) | 0 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx-left.png (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx-left.png) | bin | 9187 -> 9187 bytes | |||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx-right.png (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx-right.png) | bin | 3390 -> 3390 bytes | |||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx.ini (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx.ini) | 0 | ||||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets-left.png (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets-left.png) | bin | 11337 -> 11337 bytes | |||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets-right.png (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets-right.png) | bin | 3082 -> 3082 bytes | |||
| -rw-r--r-- | remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets.ini (renamed from remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets.ini) | 0 |
14 files changed, 41 insertions, 38 deletions
diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env index 4119ad9c..167f1a96 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env @@ -11,23 +11,23 @@ hwinfo --cdrom | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo. hwinfo --floppy | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo.floppy #from plugins/vmchooser/XX_vmchooser.sh -VMCHOOSER_CONF_DIR=/opt/openslx/etc/vmchooser +VMCHOOSER_DIR="/opt/openslx/vmchooser" +VMCHOOSER_CONF_DIR="$VMCHOOSER_DIR/config" -mkdir -p ${VMCHOOSER_CONF_DIR}/loopimg -mkdir -p ${VMCHOOSER_CONF_DIR}/fd-loop -m 1777 +mkdir -p "${VMCHOOSER_DIR}/data/loopimg" +mkdir -p "${VMCHOOSER_DIR}/fd-loop" -m 1777 # mount a clean tempfs (bug in UnionFS prevents loopmount to work) grep -qE "unionfs |aufs " /proc/mounts && \ -mount -n -o size=1500k -t tmpfs vm-loopimg ${VMCHOOSER_CONF_DIR}/loopimg + mount -n -o size=1500k -t tmpfs vm-loopimg "${VMCHOOSER_DIR}/data/loopimg" # create an empty floppy image of 1.4MByte size -dd if=/dev/zero of=${VMCHOOSER_CONF_DIR}/loopimg/fd.img count=2880 bs=512 2>/dev/null -chmod 0777 ${VMCHOOSER_CONF_DIR}/loopimg/fd.img +dd "if=/dev/zero" "of=${VMCHOOSER_DIR}/data/loopimg/fd.img" count=2880 bs=512 2>/dev/null +chmod 0777 "${VMCHOOSER_DIR}/data/loopimg/fd.img" # use dos formatter copied into stage3 -mkdosfs ${VMCHOOSER_CONF_DIR}/loopimg/fd.img >/dev/null 2>&1 #|| error -mount -n -t msdos -o loop,umask=000 ${VMCHOOSER_CONF_DIR}/loopimg/fd.img \ - ${VMCHOOSER_CONF_DIR}/fd-loop +mkdosfs "${VMCHOOSER_DIR}/data/loopimg/fd.img" +mount -n -t msdos -o loop,umask=000 "${VMCHOOSER_DIR}/data/loopimg/fd.img" "${VMCHOOSER_DIR}/fd-loop" #pvs integration #if [ $vmchooser_pvs -ne 0 ]; then @@ -58,7 +58,7 @@ mkdir -p /var/log/samba #from plugins/vmchooser/80-after-plugins/virtualization.sh -# change free mem +# estimate free mem mem_free=$(grep -i "^memfree:" /proc/meminfo | awk '{print $2}') mem_cached=$(grep -i "^cached:" /proc/meminfo | awk '{print $2}') mem_swapcached=$(grep -i "^swapcached:" /proc/meminfo | awk '{print $2}') @@ -66,51 +66,51 @@ mem_swapcached=$(grep -i "^swapcached:" /proc/meminfo | awk '{print $2}') [ -z "$mem_cached" ] && mem_cached="0" [ -z "$mem_swapcached" ] && mem_swapcached="0" totalmem="$[ ( $mem_free + $mem_cached + $mem_swapcached ) / 1024 ]" -echo "totalmem=${totalmem}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf +echo "totalmem=${totalmem}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" -# cpu cores +# determine number of cpu cores CPU_CORES=$(grep '^processor.*:' /proc/cpuinfo | wc -l) if [ "${CPU_CORES}" -gt "1" 2>/dev/null ]; then - echo "cpu_cores=${CPU_CORES}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf + echo "cpu_cores=${CPU_CORES}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" else - echo 'cpu_cores=1' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf + echo 'cpu_cores=1' >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" fi # arch -echo "host_arch=$(uname -m)" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf +echo "host_arch=$(uname -m)" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" # VT enabled cpu? -if grep -q ^flags.*\\\<vmx\\\> /proc/cpuinfo; then - echo "vtflag=1" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - echo 'kvm_module="kvm_intel"' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - elif grep -q ^flags.*\\\<svm\\\> /proc/cpuinfo; then - echo "vtflag=1" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf - echo 'kvm_module="kvm_amd"' >> ${VMCHOOSER_CONF_DIR}/virtualization.conf +if grep -q '^flags.*\<vmx\>' "/proc/cpuinfo"; then + echo "vtflag=1" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" + echo 'kvm_module="kvm_intel"' >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" + elif grep -q '^flags.*\<svm\>' "/proc/cpuinfo"; then + echo "vtflag=1" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" + echo 'kvm_module="kvm_amd"' >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" else - echo "vtflag=0" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf + echo "vtflag=0" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" fi # write mac if [ -n "$SLX_PXE_MAC" ]; then - echo "hostmacaddr=${SLX_PXE_MAC}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf + echo "hostmacaddr=${SLX_PXE_MAC}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" else ## Fallback: - echo "hostmacaddr=$(ip a | grep ether | grep -o -E -i '([0-9a-f]{2}:){5}[0-9a-f]{2}' | head -n 1)" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf + echo "hostmacaddr=$(ip a | grep ether | grep -o -E -i '([0-9a-f]{2}:){5}[0-9a-f]{2}' | head -n 1)" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" fi # ip addr -echo "hostip=${SLX_PXE_CLIENT_IP}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf +echo "hostip=${SLX_PXE_CLIENT_IP}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" # hostname -echo "hostname=${SLX_HOSTNAME}" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf +echo "hostname=${SLX_HOSTNAME}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" # get further hw information j=0 for i in $(cat /etc/openslx/hwinfo.cdrom); do - echo "cdrom_$j=$i" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf + echo "cdrom_$j=$i" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" j=$(expr $j + 1) done j=0 for i in $(cat /etc/openslx/hwinfo.floppy); do - echo "floppy_$j=$i" >> ${VMCHOOSER_CONF_DIR}/virtualization.conf + echo "floppy_$j=$i" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf" j=$(expr $j + 1) done diff --git a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt index a5bb735d..5c85dfcd 100755 --- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt +++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt @@ -22,12 +22,15 @@ ### Define default dirs / get configs ################################################################################ +VMCHOOSER_DIR="/opt/openslx/vmchooser" +VMCHOOSER_CONF_DIR="$VMCHOOSER_DIR/config" + # include general configuration from vmchooser -[ -f /opt/openslx/etc/vmchooser/vmchooser.conf ] && . /opt/openslx/etc/vmchooser/vmchooser.conf +[ -f "$VMCHOOSER_CONF_DIR/vmchooser.conf" ] && . "$VMCHOOSER_CONF_DIR/vmchooser.conf" # load general virtualization information -[ -f /opt/openslx/etc/vmchooser/virtualization.conf ] && . /opt/openslx/etc/vmchooser/virtualization.conf +[ -f "$VMCHOOSER_CONF_DIR/virtualization.conf" ] && . "$VMCHOOSER_CONF_DIR/virtualization.conf" # Load general openslx config -[ -f /opt/openslx/config ] && . /opt/openslx/config +[ -f "/opt/openslx/config" ] && . "/opt/openslx/config" ################################################################################ ### Functions used throughout the script @@ -39,7 +42,7 @@ writelog () { # write to stdout echo -e "$1" # log into file - echo -e "$1" >> ${LOGFILE} + echo -e "$1" >> "${LOGFILE}" } # Clean exit will be called at the end of this script @@ -380,7 +383,7 @@ fdtest=${floppy_0:+"TRUE"} # if $fdtest not set floppy0="FALSE", else "TRUE" floppy0=${fdtest:-"FALSE"} floppy1="TRUE" -floppy1name="/opt/openslx/etc/vmchooser/loopimg/fd.img" +floppy1name="$VMCHOOSER_DIR/data/loopimg/fd.img" # if $cdrom_0 from run-virt.include set then cdtest="TRUE" cdtest= cdtest=${cdrom_0:+"TRUE"} @@ -455,11 +458,11 @@ PID_LPD="$!" # Copy guest configuration (with added information) config.xml to be accessed # via virtual floppy -cp "$xmlfile" "/opt/openslx/etc/vmchooser/fd-loop/config.xml" +cp "$xmlfile" "$VMCHOOSER_DIR/fd-loop/config.xml" # Add another file with resolution information -xrandr | grep -o -E 'current\s*[0-9]+\s*x\s*[0-9]+' | cut -c 8- | sed -r 's/(\s|\t|\n)//g' | head -n 1 > "/opt/openslx/etc/vmchooser/fd-loop/hostres.txt" +xrandr | grep -o -E 'current\s*[0-9]+\s*x\s*[0-9]+' | cut -c 8- | sed -r 's/(\s|\t|\n)//g' | head -n 1 > "$VMCHOOSER_DIR/fd-loop/hostres.txt" # Add our magic openslx binary that sets the correct guest resolution -cp "/opt/openslx/etc/vmchooser/openslx.exe" "/opt/openslx/etc/vmchooser/fd-loop/" +cp "$VMCHOOSER_DIR/data/openslx.exe" "$VMCHOOSER_DIR/fd-loop/" # Try to use dnbd3 to access the image unset vm_diskfile @@ -503,13 +506,13 @@ fi writelog "Used diskfile: $vm_diskfile" # Get all virtual machine specific stuff from the respective include file -if [ ! -e "/opt/openslx/etc/${xmlvirt}/run-virt.include" ] ; then +if [ ! -e "$VMCHOOSER_DIR/$xmlvirt/run-virt.include" ] ; then writelog "Failed because of missing ${xmlvirt} plugin." cleanexit 1 fi self="${xmlvirt}" -. "/opt/openslx/etc/${xmlvirt}/run-virt.include" || writelog "Erroneous run-virt.include for $xmlvirt" +. "$VMCHOOSER_DIR/$xmlvirt/run-virt.include" || writelog "Erroneous run-virt.include for $xmlvirt" # start a windowmanager for easier handling # (expect problems w/ windows opening in background w/ vmware without wm) for dm in openbox kwin xfwm4 metacity blackbox twm fvwm2 ; do diff --git a/remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/smb.conf b/remote/modules/vmchooser/data/opt/openslx/vmchooser/config/smb.conf index ec757ce4..ec757ce4 100644 --- a/remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/smb.conf +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/config/smb.conf diff --git a/remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/vmchooser.conf b/remote/modules/vmchooser/data/opt/openslx/vmchooser/config/vmchooser.conf index 203f125b..203f125b 100644 --- a/remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/vmchooser.conf +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/config/vmchooser.conf diff --git a/remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/openslx.exe b/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/openslx.exe Binary files differindex e016f407..13092874 100755 --- a/remote/modules/vmchooser/data/opt/openslx/etc/vmchooser/openslx.exe +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/data/openslx.exe diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool-left.png b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool-left.png Binary files differindex c9d8ab0d..c9d8ab0d 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool-left.png +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool-left.png diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool-right.png b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool-right.png Binary files differindex 8ca9347b..8ca9347b 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool-right.png +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool-right.png diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool.ini b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool.ini index 90d00617..90d00617 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/bwlehrpool/bwlehrpool.ini +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/bwlehrpool/bwlehrpool.ini diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx-left.png b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx-left.png Binary files differindex 900dd867..900dd867 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx-left.png +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx-left.png diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx-right.png b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx-right.png Binary files differindex 8ca9347b..8ca9347b 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx-right.png +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx-right.png diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx.ini b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx.ini index 57a22821..57a22821 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/openslx/openslx.ini +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/openslx/openslx.ini diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets-left.png b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets-left.png Binary files differindex c8736b72..c8736b72 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets-left.png +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets-left.png diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets-right.png b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets-right.png Binary files differindex e21f0d8b..e21f0d8b 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets-right.png +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets-right.png diff --git a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets.ini b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets.ini index d9aa17f6..d9aa17f6 100644 --- a/remote/modules/vmchooser/data/opt/openslx/usr/share/vmchooser/themes/planets/planets.ini +++ b/remote/modules/vmchooser/data/opt/openslx/vmchooser/themes/planets/planets.ini |
