summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorroot2014-09-04 15:26:54 +0200
committerroot2014-09-04 15:26:54 +0200
commit841538401ae376061035b577018676f0e656cbd1 (patch)
treec3efe7ca6f3a5c4f413286f36024b40bd0f1cb6b
parent[vanilla-kernel] New Module (diff)
parent[pvs2] Move pvs2.ini in its in directory (diff)
downloadtm-scripts-841538401ae376061035b577018676f0e656cbd1.tar.gz
tm-scripts-841538401ae376061035b577018676f0e656cbd1.tar.xz
tm-scripts-841538401ae376061035b577018676f0e656cbd1.zip
Merge branch 'master' of git://git.openslx.org/openslx-ng/tm-scripts
-rw-r--r--remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient7
-rw-r--r--remote/rootfs/rootfs-stage31/data/inc/setup_stage469
-rw-r--r--server/modules/pvs2-freiburg/etc/xdg/openslx/pvs2.ini140
3 files changed, 72 insertions, 144 deletions
diff --git a/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient b/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
index 1981736f..bef2449b 100644
--- a/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
+++ b/remote/modules/pvs2/data/opt/openslx/vmchooser/sessionstart.d/50-PVSclient
@@ -1,11 +1,10 @@
#!/bin/ash
# If the ENV var PVS has been set by vmchooser start pvsclient
-if [ -n "$PVS_START" -a "$PVS_START" == "yes" ]; then
- if [ -n "$PVS_SESSIONID" ]; then
- pvsclient "$PVS_SESSIONID" &
- else
+if [ -n "$PVS_AUTO_CONNECT" -a "$PVS_AUTO_CONNECT" == "TRUE" ]; then
pvsclient --auto &
+ else
+ pvsclient &
fi
fi
diff --git a/remote/rootfs/rootfs-stage31/data/inc/setup_stage4 b/remote/rootfs/rootfs-stage31/data/inc/setup_stage4
new file mode 100644
index 00000000..585627c2
--- /dev/null
+++ b/remote/rootfs/rootfs-stage31/data/inc/setup_stage4
@@ -0,0 +1,69 @@
+#!/bin/ash
+
+[ -z "${SLX_STAGE4}" ] && { echo "SLX_STAGE4 is not set in /opt/openslx/config." && exit 1; }
+
+MOUNTPOINT="/rorootfs/"
+mkdir -p "$MOUNTPOINT"
+
+
+# first load module
+insmod /lib/modules/dnbd3/dnbd3.ko
+
+# dnbd3 it is
+if [ -z "${SLX_DNBD3_SERVERS}${SLX_DNBD3_PRIO_SERVERS}" ]; then
+ slxlog --echo "mount-stage4" "dnbd3 stage4 configured, but SLX_DNBD3(_PRIO)_SERVERS empty or not set in /opt/openslx/config."
+ exit 1
+fi
+# Determine revision
+if [ -z "$SLX_STAGE4_RID" ] || echo "$SLX_STAGE4_RID" | grep -v -q -E "^[0-9]+$"; then
+ SLX_STAGE4_RID="0"
+fi
+# Randomize list
+SERVERS=$(for SERVER in $SLX_DNBD3_SERVERS; do echo "$RANDOM $SERVER"; done | sort -u | sed -r 's/^[0-9]+ //')
+IMAGE=$(echo $SLX_STAGE4 | awk '{printf $2}')
+[ -e /var/run/dnbd3.socket ] || sleep 2 # Ugly, service should only start when dnbd3 daemon is up and running
+RET=1337
+for SRV in $SLX_DNBD3_PRIO_SERVERS $SERVERS; do
+ echo "Requesting $IMAGE from $SRV"
+ dnbd3=$(/opt/openslx/bin/dnbd3-client -h "$SRV" -i "$IMAGE" -r "$SLX_STAGE4_RID" -d /dev/dnbd0)
+ RET=$?
+ [ "$RET" -eq "0" ] && break
+ echo "... didn't work ($RET)"
+ sleep 1
+done
+if [ "$RET" -ne "0" ]; then
+ drop_shell "Omg"
+ slxlog --echo "mount-stage4" "Could not get stage4 via dnbd3 ($IMAGE : $SLX_STAGE4_RID) ($SLX_DNBD3_PRIO_SERVERS / $SERVERS)"
+ exit $RET
+fi
+echo "Mounting /dev/dnbd0 to $MOUNTPOINT"
+if ! busybox mount -t squashfs -o ro /dev/dnbd0 "$MOUNTPOINT"; then
+ slxlog --echo "mount-stage4" "Could not mount stage4 from '$dnbd3' to '$MOUNTPOINT' ($SRV, $IMAGE)"
+ exit 1
+fi
+
+busybox mount -n -t aufs -o "br:${FUTURE_ROOT}:${MOUNTPOINT}=ro" none /mnt || drop_shell "Problem building aufs."
+mkdir -p /mnt/opt/openslx/uniontmp /mnt/tmp
+FUTURE_ROOT="/mnt"
+
+cp /etc/hostname /etc/hosts "${FUTURE_ROOT}/etc/"
+cp /etc/resolv.conf "${FUTURE_ROOT}/opt/openslx/"
+[ -s "/run/config" ] && cat "/run/config" >> "${FUTURE_ROOT}/opt/openslx/config"
+
+# if booting with splash, suppress kernel output in stage32
+if [ $SPLASH -eq 1 ]; then
+ if grep -q -E "^ *kernel.printk" "${FUTURE_ROOT}/usr/lib/sysctl.d/50-default.conf"; then
+ sed -i 's/^ *kernel\.printk.*/kernel\.printk = 1 1 0 1/g' "${FUTURE_ROOT}/usr/lib/sysctl.d/50-default.conf"
+ else
+ echo "kernel.printk = 1 1 0 1" >> "${FUTURE_ROOT}/usr/lib/sysctl.d/50-default.conf"
+ fi
+fi
+
+# Kinda specific for virtualization environment: Autologin and run VM for benchmarks
+if [ -n "$SLX_BENCHMARK_VM" ]; then
+ # Enable KDM autologin for demo user
+ sed -i 's/^AutoLoginUser=.*//;s/^AutoLoginEnable=.*/AutoLoginEnable=true\nAutoLoginUser=demo/' "${FUTURE_ROOT}/etc/kde4/kdm/kdmrc"
+ # Running the VM automatically has to be taken care of by run-virt and vmchooser. SLX_BENCHMARK_VM should contain
+ # a numeric value for the index in vmchooser
+fi
+
diff --git a/server/modules/pvs2-freiburg/etc/xdg/openslx/pvs2.ini b/server/modules/pvs2-freiburg/etc/xdg/openslx/pvs2.ini
deleted file mode 100644
index 70f8c82a..00000000
--- a/server/modules/pvs2-freiburg/etc/xdg/openslx/pvs2.ini
+++ /dev/null
@@ -1,140 +0,0 @@
-# This denotes the groups that have to be available here
-rooms=-100,-101,-113,-114
-
-[-100]
-mgrIP=132.230.4.26
-client/size=16
-client/1/ip=132.230.4.156
-client/1/pos=@Point(1 6)
-client/2/ip=132.230.4.157
-client/2/pos=@Point(0 4)
-client/3/ip=132.230.4.158
-client/3/pos=@Point(1 4)
-client/4/ip=132.230.4.159
-client/4/pos=@Point(3 4)
-client/5/ip=132.230.4.160
-client/5/pos=@Point(4 4)
-client/6/ip=132.230.4.161
-client/6/pos=@Point(5 4)
-client/7/ip=132.230.4.162
-client/7/pos=@Point(0 2)
-client/8/ip=132.230.4.163
-client/8/pos=@Point(1 2)
-client/9/ip=132.230.4.164
-client/9/pos=@Point(3 2)
-client/10/ip=132.230.4.165
-client/10/pos=@Point(4 2)
-client/11/ip=132.230.4.166
-client/11/pos=@Point(5 2)
-client/12/ip=132.230.4.167
-client/12/pos=@Point(0 0)
-client/13/ip=132.230.4.168
-client/13/pos=@Point(1 0)
-client/14/ip=132.230.4.169
-client/14/pos=@Point(3 0)
-client/15/ip=132.230.4.170
-client/15/pos=@Point(4 0)
-client/16/ip=132.230.4.171
-client/16/pos=@Point(5 0)
-
-[-101]
-mgrIP=132.230.4.26
-client/size=16
-client/1/ip=132.230.4.140
-client/1/pos=@Point(6 2)
-client/2/ip=132.230.4.141
-client/2/pos=@Point(4 0)
-client/3/ip=132.230.4.142
-client/3/pos=@Point(4 1)
-client/4/ip=132.230.4.143
-client/4/pos=@Point(4 2)
-client/5/ip=132.230.4.144
-client/5/pos=@Point(4 4)
-client/6/ip=132.230.4.145
-client/6/pos=@Point(4 5)
-client/7/ip=132.230.4.146
-client/7/pos=@Point(2 0)
-client/8/ip=132.230.4.147
-client/8/pos=@Point(2 1)
-client/9/ip=132.230.4.148
-client/9/pos=@Point(2 2)
-client/10/ip=132.230.4.149
-client/10/pos=@Point(2 4)
-client/11/ip=132.230.4.150
-client/11/pos=@Point(2 5)
-client/12/ip=132.230.4.151
-client/12/pos=@Point(0 0)
-client/13/ip=132.230.4.152
-client/13/pos=@Point(0 1)
-client/14/ip=132.230.4.153
-client/14/pos=@Point(0 2)
-client/15/ip=132.230.4.154
-client/15/pos=@Point(0 4)
-client/16/ip=132.230.4.155
-client/16/pos=@Point(0 5)
-
-[-113]
-mgrIP=132.230.4.30
-client/size=16
-client/1/ip=123.230.4.120
-client/1/pos=@Point(3 3)
-client/2/ip=123.230.4.121
-client/2/pos=@Point(6 4)
-client/3/ip=123.230.4.122
-client/3/pos=@Point(6 3)
-client/4/ip=123.230.4.123
-client/4/pos=@Point(6 2)
-client/5/ip=123.230.4.124
-client/5/pos=@Point(6 1)
-client/6/ip=123.230.4.125
-client/6/pos=@Point(6 0)
-client/7/ip=123.230.4.126
-client/7/pos=@Point(4 0)
-client/8/ip=123.230.4.127
-client/8/pos=@Point(4 1)
-client/9/ip=123.230.4.128
-client/9/pos=@Point(4 2)
-client/10/ip=123.230.4.129
-client/10/pos=@Point(2 0)
-client/11/ip=123.230.4.130
-client/11/pos=@Point(2 1)
-client/12/ip=123.230.4.131
-client/12/pos=@Point(2 2)
-client/13/ip=123.230.4.132
-client/13/pos=@Point(0 0)
-client/14/ip=123.230.4.133
-client/14/pos=@Point(0 1)
-client/15/ip=123.230.4.134
-client/15/pos=@Point(0 2)
-client/16/ip=123.230.4.135
-client/16/pos=@Point(0 3)
-
-[-114]
-mgrIP=132.230.4.26
-client/size=13
-client/1/ip=132.230.4.100
-client/1/pos=@Point(4 3)
-client/2/ip=132.230.4.101
-client/2/pos=@Point(3 5)
-client/3/ip=132.230.4.102
-client/3/pos=@Point(3 6)
-client/4/ip=132.230.4.103
-client/4/pos=@Point(4 5)
-client/5/ip=132.230.4.104
-client/5/pos=@Point(0 6)
-client/6/ip=132.230.4.105
-client/6/pos=@Point(3 1)
-client/7/ip=132.230.4.106
-client/7/pos=@Point(1 5)
-client/8/ip=132.230.4.107
-client/8/pos=@Point(1 1)
-client/9/ip=132.230.4.108
-client/9/pos=@Point(0 0)
-client/10/ip=132.230.4.109
-client/10/pos=@Point(0 6)
-client/11/ip=132.230.4.110
-client/11/pos=@Point(3 0)
-client/12/ip=132.230.4.111
-client/12/pos=@Point(4 1)
-client/13/ip=132.230.4.112
-client/13/pos=@Point(0 1)