summaryrefslogtreecommitdiffstats
path: root/remote/modules/run-virt/data/opt/openslx/scripts/includes
diff options
context:
space:
mode:
Diffstat (limited to 'remote/modules/run-virt/data/opt/openslx/scripts/includes')
-rwxr-xr-xremote/modules/run-virt/data/opt/openslx/scripts/includes/TEST.sh6
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables.inc2
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables_legacy.inc2
-rw-r--r--remote/modules/run-virt/data/opt/openslx/scripts/includes/setup_virtual_floppy.inc46
4 files changed, 40 insertions, 16 deletions
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/TEST.sh b/remote/modules/run-virt/data/opt/openslx/scripts/includes/TEST.sh
new file mode 100755
index 00000000..fd5f755d
--- /dev/null
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/TEST.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+. usb_detector.inc
+
+get_usb_devices "bla=%VENDOR% kacke=%PRODUCT%" 0:6 0:7 0:e 0:10
+
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables.inc
index 400c1bf4..a93bf62c 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables.inc
@@ -51,8 +51,6 @@ fi
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 virtualization.conf set then cdtest="TRUE"
cdtest=${cdrom_0:+"TRUE"}
# if $cdtest not set cdrom0="FALSE", else "TRUE"
diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables_legacy.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables_legacy.inc
index 0da5e2be..05d55f00 100644
--- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables_legacy.inc
+++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_hardware_variables_legacy.inc
@@ -51,8 +51,6 @@ fi
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 virtualization.conf set then cdtest="TRUE"
cdtest=${cdrom_0:+"TRUE"}
# if $cdtest not set cdrom0="FALSE", else "TRUE"
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 4b8e10aa..d1343700 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
@@ -1,21 +1,43 @@
+#!/bin/bash
##############################################
# Include: Setup virtual floppy for drive b: #
##############################################
+declare -rg FLOPPYIMG="${TMPDIR}/floppy.img"
+declare -rg TMPHOME="${HOME}"
+
+dd "if=/dev/zero" "of=${FLOPPYIMG}" count=1440 bs=1024
+chmod 0600 "${FLOPPYIMG}"
+mkfs.fat "${FLOPPYIMG}" || mkfs.vfat "${FLOPPYIMG}" || mkdosfs "${FLOPPYIMG}"
+
# Copy guest configuration (with added information) config.xml to be accessed
# via virtual floppy
-cp "$xmlfile" "$VMCHOOSER_DIR/fd-loop/config.xml"
+#mcopy -i "${FLOPPYIMG}" "$xmlfile" "::/config.xml"
+
+# Create file with resolution information
+xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \
+ | grep -o -E -m1 '[0-9]+x[0-9]+' > "${TMPDIR}/hostres.txt"
-# Add another file with resolution information
-xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' | grep -o -E '[0-9]+x[0-9]+' | head -n 1 > "$VMCHOOSER_DIR/fd-loop/hostres.txt"
+# Create file for network shares to mount
+SHARES="${TMPDIR}/shares.dat"
+touch "${SHARES}"
+chmod 0600 "${SHARES}"
+if pwdaemon --query "${TMPHOME}/.pwsocket" > "${SHARES}"; then
+ sed -i 's/^/192.168.101.1\t/' "${SHARES}" # TODO: Depending on nettype (in case we have != nat some day)
+ if [ -e "${TMPHOME}/.home" ]; then
+ NETHOME=$(cat "${TMPHOME}/.home")
+ [ -z "$SLX_HOME_DRIVE" ] && SLX_HOME_DRIVE="H:"
+ # Tab between items, so spaces can be used!
+ echo "${NETHOME} ${SLX_HOME_DRIVE} Home-Verzeichnis" >> "${SHARES}"
+ fi
+ for VAR in ${!SLX_SHARE_*}; do
+ echo "${!VAR}" >> "${SHARES}"
+ done
+fi
-# Add our magic openslx binary that sets the correct guest resolution
-cp "$VMCHOOSER_DIR/data/openslx.exe" "$VMCHOOSER_DIR/fd-loop/"
-cp "$VMCHOOSER_DIR/data/SHARELWS.BAT" "$VMCHOOSER_DIR/fd-loop/"
-rm "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG"
+# Copy all them files into floppy image
+mcopy -i "${FLOPPYIMG}" "${TMPDIR}/hostres.txt" "::/"
+mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/"
+mcopy -i "${FLOPPYIMG}" "${SHARES}" "::/"
+unset SHARES VAR NETHOME
-for SHARE in $(grep -o -E '^SLX_SHARE_.*_PATH' /opt/openslx/config); do
- eval "echo -n \$${SHARE} | /opt/openslx/bin/tr '/' '\' " >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG"
- #eval echo -n " \$${SHARE%PATH}AUTH_PASS /user:\$${SHARE%PATH}AUTH_USER" >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG"
- echo -e '\r\n' >> "$VMCHOOSER_DIR/fd-loop/SHARELW.CFG"
-done