summaryrefslogtreecommitdiffstats
path: root/remote/modules
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules')
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc17
1 files changed, 16 insertions, 1 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
index 5f12fe29..9856f66a 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc
@@ -5,6 +5,10 @@
declare -rg FLOPPYIMG="${TMPDIR}/floppy.img"
declare -rg TMPHOME="${HOME}"
+declare -rg RUNSCRIPT="${TMPDIR}/runscript.tmp"
+
+wget -T 6 -O "${RUNSCRIPT}" -nv "${SLX_VMCHOOSER_BASE_URL}/lecture/${IMGUUID}/runscript" &
+WGET=$?
dd "if=/dev/zero" "of=${FLOPPYIMG}" count=1440 bs=1024
chmod 0600 "${FLOPPYIMG}"
@@ -66,8 +70,13 @@ media=${SHARE_MEDIA}
other=${SHARE_OTHER}
HIER
+wait "$WGET"
+EXT=
+if [ -s "$RUNSCRIPT" ]; then
+ EXT=$(head -n 1 "$RUNSCRIPT" | grep -o -i '^EXT=.*$' | cut -d '=' -f 2-)
+fi
-# Copy all them there files into floppy image
+# Copy all them there filez into floppy image
mcopy -i "${FLOPPYIMG}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" "${SHARES}" "::/"
mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/"
# Copy guest configuration (with added information) config.xml to be accessed
@@ -77,6 +86,12 @@ mcopy -i "${FLOPPYIMG}" "$xmlfile" "::/config.xml"
# Copying linux directory:
mcopy -s -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/linux" "::/"
+# User supplied runscript
+if [ -n "$EXT" ]; then
+ sed -i '1d' "${RUNSCRIPT}"
+ mcopy -i "${FLOPPYIMG}" "${RUNSCRIPT}" "::/runscript.${EXT}"
+fi
+
rm -f -- "${SHARES}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT"
unset SHARES VAR NETHOME UNAME