summaryrefslogtreecommitdiffstats
path: root/remote/modules/vmchooser
diff options
context:
space:
mode:
authorDirk2013-12-06 18:58:20 +0100
committerDirk2013-12-06 18:58:20 +0100
commitc44f4fed95ed7e45b91e9d7448e1584401f6e04d (patch)
treea9467039b1c223fa7cb901100e898ddc8f21a921 /remote/modules/vmchooser
parentMerge branch 'master' of dnbd3:openslx-ng/tm-scripts (diff)
downloadtm-scripts-c44f4fed95ed7e45b91e9d7448e1584401f6e04d.tar.gz
tm-scripts-c44f4fed95ed7e45b91e9d7448e1584401f6e04d.tar.xz
tm-scripts-c44f4fed95ed7e45b91e9d7448e1584401f6e04d.zip
Fixing the cdrom and floppy detection ...
Diffstat (limited to 'remote/modules/vmchooser')
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env38
-rwxr-xr-xremote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt8
2 files changed, 29 insertions, 17 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 18f5db16..b429bb55 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/systemd-vmchooser_env
@@ -1,16 +1,28 @@
#!/bin/bash
+# Full bash required
+# -----------------------------------------------------------------------------
+# Copyright (c) 2007..2013 - RZ Uni FR
+# Copyright (c) 2007..2013 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# systemd-vmchooser_env
+# - This is the preparation script for the configuration of the virtuali-
+# zation tools used later on.
+################################################################################
export PATH=$PATH:/opt/openslx/bin:/opt/openslx/sbin:/opt/openslx/usr/bin:/opt/openslx/usr/sbin
-#source config file with vars (e.g. ipaddr, macaddr, hostname)
+# source config file with vars (e.g. ipaddr, macaddr, hostname)
. /opt/openslx/config
-#from plugins/vmchooser/40-started-hw-config/run-virt.sh
-#TODO: extra systemd-service for hwinfo
-hwinfo --cdrom | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo.cdrom
-hwinfo --floppy | grep -i "Device File:" | awk {'print $3'} >/etc/openslx/hwinfo.floppy
-
-#from plugins/vmchooser/XX_vmchooser.sh
+# from plugins/vmchooser/XX_vmchooser.sh
VMCHOOSER_DIR="/opt/openslx/vmchooser"
VMCHOOSER_CONF_DIR="$VMCHOOSER_DIR/config"
@@ -99,18 +111,18 @@ fi
# ip addr
echo "hostip=${SLX_PXE_CLIENT_IP}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
# hostname
-echo "hostname=${SLX_HOSTNAME}" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
+echo "hostname=$(hostname -s)" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
-# get further hw information
+# get further hw information and check for traces of available optical and floppy drives
j=0
-for i in $(cat /etc/openslx/hwinfo.cdrom); do
- echo "cdrom_$j=$i" >> "${VMCHOOSER_CONF_DIR}/virtualization.conf"
+for cdrom in $(dmesg|grep -i "Attached scsi CD-ROM sr" | sed "s,.*Attached scsi CD-ROM ,,"); do
+ echo "cdrom_$j=/dev/${cdrom}" >> "${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"
+for floppy in $(dmesg|grep -i "Floppy drive"|sed "s,.*(s): ,,;s, is .*,,"); do
+ echo "floppy_$j=/dev/${floppy}" >> "${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 6b9c4f0f..2a6a3272 100755
--- a/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
+++ b/remote/modules/vmchooser/data/opt/openslx/scripts/vmchooser-run_virt
@@ -2,7 +2,7 @@
# Full bash required
# -----------------------------------------------------------------------------
# Copyright (c) 2007..2010 - RZ Uni FR
-# Copyright (c) 2007..2011 - OpenSLX GmbH
+# Copyright (c) 2007..2013 - OpenSLX GmbH
#
# This program is free software distributed under the GPL version 2.
# See http://openslx.org/COPYING
@@ -379,17 +379,17 @@ if ! echo "$macaddrsuffix" | grep -q -E '^[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}$';
fi
# Virtual fd/cd/dvd and drive devices, floppy b: for configuration
-# if $floppy_0 from run-virt.include set then fdtest="TRUE"
+# if $floppy_0 from virtualization.conf set then fdtest="TRUE"
fdtest=${floppy_0:+"TRUE"}
# if $fdtest not set floppy0="FALSE", else "TRUE"
floppy0=${fdtest:-"FALSE"}
floppy1="TRUE"
floppy1name="$VMCHOOSER_DIR/data/loopimg/fd.img"
-# if $cdrom_0 from run-virt.include set then cdtest="TRUE"
+# if $cdrom_0 from virtualization.conf set then cdtest="TRUE"
cdtest=${cdrom_0:+"TRUE"}
# if $cdtest not set cdrom0="FALSE", else "TRUE"
cdrom0=${cdtest:-"FALSE"}
-# if $cdrom_1 from run-virt.include set then cdtest="TRUE"
+# if $cdrom_1 from virtualization.conf set then cdtest="TRUE"
cdtest=${cdrom_1:+"TRUE"}
# if $cdtest not set cdrom1="FALSE", else "TRUE"
cdrom1=${cdtest:-"FALSE"}