From 1fb7585a5f7e3f27b97fd481554bff328267ea07 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 8 Apr 2016 15:17:19 +0200 Subject: [run-virt] Revert config.xml and hostres.txt for backwards compatibility --- .../data/opt/openslx/scripts/includes/setup_virtual_floppy.inc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'remote') 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 ddfbacbb..ee737ed3 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 @@ -10,10 +10,6 @@ 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 -#mcopy -i "${FLOPPYIMG}" "$xmlfile" "::/config.xml" - # Create file with resolution information etc. . "/opt/openslx/inc/shares" if [ -z "$SHARE_REMAP_MODE" ]; then @@ -44,7 +40,6 @@ HIER # Legacy: HOSTRES.TXT cat > "${TMPDIR}/HOSTRES.TXT" <<-HIER ${RESOLUTION} -This file is deprecated! Use openslx.ini HIER # Create file for network shares to mount @@ -69,6 +64,10 @@ fi # Copy all them files 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 +# via virtual floppy +mcopy -i "${FLOPPYIMG}" "$xmlfile" "::/config.xml" + rm -f -- "${SHARES}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" unset SHARES VAR NETHOME -- cgit v1.2.3-55-g7522 From 673ecc725fa3a369d51a3439e8676885797e6ec3 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 8 Apr 2016 15:35:56 +0200 Subject: [run-virt] Add username field to openslx.ini --- .../scripts/includes/setup_virtual_floppy.inc | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) (limited to 'remote') 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 ee737ed3..9d46f78f 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 @@ -22,21 +22,6 @@ fi RESOLUTION=$(xrandr | grep -o -E 'connected\s*(primary)?\s*[0-9]+x[0-9]+\+0\+0' \ | grep -o -E -m1 '[0-9]+x[0-9]+') -cat > "${TMPDIR}/openslx.ini" <<-HIER -[openslx] -resolution=${RESOLUTION} -createMissingRemap=${SHARE_CREATE_MISSING_REMAP} -remapMode=${SHARE_REMAP_MODE_INI} -homeDrive=${SHARE_HOME_DRIVE} - -[remap] -documents=${SHARE_DOCUMENTS} -downloads=${SHARE_DOWNLOADS} -desktop=${SHARE_DESKTOP} -media=${SHARE_MEDIA} -other=${SHARE_OTHER} -HIER - # Legacy: HOSTRES.TXT cat > "${TMPDIR}/HOSTRES.TXT" <<-HIER ${RESOLUTION} @@ -61,6 +46,27 @@ else done fi +# Info file +UNAME= +[ -s "${HOME}/.account" ] && UNAME=$(cat "${HOME}/.account") +[ -z "${UNAME}" ] && UNAME=$(whoami) +cat > "${TMPDIR}/openslx.ini" <<-HIER +[openslx] +username=${UNAME} +resolution=${RESOLUTION} +createMissingRemap=${SHARE_CREATE_MISSING_REMAP} +remapMode=${SHARE_REMAP_MODE_INI} +homeDrive=${SHARE_HOME_DRIVE} + +[remap] +documents=${SHARE_DOCUMENTS} +downloads=${SHARE_DOWNLOADS} +desktop=${SHARE_DESKTOP} +media=${SHARE_MEDIA} +other=${SHARE_OTHER} +HIER + + # Copy all them files into floppy image mcopy -i "${FLOPPYIMG}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" "${SHARES}" "::/" mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/" @@ -69,5 +75,5 @@ mcopy -i "${FLOPPYIMG}" "$VMCHOOSER_DIR/data/openslx.exe" "::/" mcopy -i "${FLOPPYIMG}" "$xmlfile" "::/config.xml" rm -f -- "${SHARES}" "${TMPDIR}/openslx.ini" "${TMPDIR}/HOSTRES.TXT" -unset SHARES VAR NETHOME +unset SHARES VAR NETHOME UNAME -- cgit v1.2.3-55-g7522