diff options
Diffstat (limited to 'remote/modules/run-virt/data/opt')
7 files changed, 79 insertions, 56 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 diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/pam_script_auth.d/99-run_virt_credentials b/remote/modules/run-virt/data/opt/openslx/scripts/pam_script_auth.d/99-run_virt_credentials new file mode 100644 index 00000000..1e2c18e7 --- /dev/null +++ b/remote/modules/run-virt/data/opt/openslx/scripts/pam_script_auth.d/99-run_virt_credentials @@ -0,0 +1,39 @@ +#!/bin/ash +# This is being sourced and running in ash + +if [ -n "$TEMP_HOME_DIR" ]; then + if [ -z "$PAM_TTY" ] || [ "x$PAM_TTY" = "x:0" ]; then + # Pass on network path to home directory + if [ -z "$PERSISTENT_NETPATH" ]; then + PERSISTENT_NETPATH=$(grep -m1 -F " ${PERSISTENT_HOME_DIR} " "/proc/mounts" | awk '{print $1}') + fi + if [ -n "$PERSISTENT_NETPATH" ]; then + [ "x${PERSISTENT_NETPATH:0:2}" = "x//" ] && PERSISTENT_NETPATH=$(echo "$PERSISTENT_NETPATH" | tr '/' '\') + echo "${PERSISTENT_NETPATH}" > "${TEMP_HOME_DIR}/.home" + chmod 0644 "${TEMP_HOME_DIR}/.home" + fi + # pwdaemon + # Figure out username + XUSER="${REAL_ACCOUNT}" + [ -z "$XUSER" ] && XUSER="${PAM_USER}" + # Guess domain + XDOMAIN= + if [ -n "$PERSISTENT_OK" ]; then + XDOMAIN=$(grep -F " ${PERSISTENT_HOME_DIR} " "/proc/mounts" | grep -m1 -F 'domain=' | sed -r 's/^.*[ ,]domain=([^ ,]+)[ ,].*$/\1/g') + fi + if [ -z "$XDOMAIN" ]; then + XDOMAIN=$(grep -m1 -i '^BASE\s*DC=' "/etc/ldap.conf" | sed -r 's/^BASE\s*DC=([^,;]+)[,;].*$/\1/I') + fi + if [ -z "$XDOMAIN" ]; then + XDOMAIN=$(grep -m1 -i '^ldap_search_base\s*=' "/etc/sssd/sssd.conf" | sed -r 's/^ldap_search_base\s*=\s*DC=([^,;]+)[,;].*$/\1/I') + fi + if [ -n "$XDOMAIN" ]; then + XDOMAIN=$(echo "$XDOMAIN" | tr '[a-z]' '[A-Z]') + fi + USERNAME="$XDOMAIN\\$XUSER" PASSWORD="$PAM_AUTHTOK" PWSOCKET="${TEMP_HOME_DIR}/.pwsocket" su -c 'pwdaemon --daemon &' "${PAM_USER}" & + unset XUSER XDOMAIN + fi +fi + +true + diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/SHARELWS.BAT b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/SHARELWS.BAT deleted file mode 100644 index 01838705..00000000 --- a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/SHARELWS.BAT +++ /dev/null @@ -1,40 +0,0 @@ -@echo off - -setlocal EnableDelayedExpansion - -rem Kein sleep oder timeout bis Win7, also einen -rem haesslichen Hack (Zeitverz. ca. 5 sec) -rem Sinn der Verzoegerung: Mitunter (1/3) wird -rem sonst das erste Netzlaufwerk nicht eingehaengt - -@ping -n 5 localhost> nul - -rem Konfigdatei auslesen und erstmal in Feld: -set n=0 -for /f %%i in (b:\sharelw.cfg) do ( - set array[!n!]=%%i - set /A n+=1 -) - -rem Aufruf für net use erzeugen: -set "i=0" -for %%b in (K L M N O P Q R S T U V W X Y Z) do ( - if defined array[!i!] ( - call set aufruf[!i!]=%%b: %%array[!i!]%% - set /A "i+=1" - ) else ( - goto :Schleifenende - ) -) -:Schleifenende - -rem net use-Aufrufe -set "i=0" -:Ausdrucken -if defined aufruf[!i!] ( - call net use %%aufruf[!i!]%% - set /a "i+=1" - GOTO :Ausdrucken -) - -exit /B diff --git a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe Binary files differindex 114a0dc0..387f420b 100755 --- a/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe +++ b/remote/modules/run-virt/data/opt/openslx/vmchooser/data/openslx.exe |
