From 3467aef515acaac01760c3e92cc3db09dc474d96 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 7 Jan 2016 16:19:27 +0100 Subject: [run-virt,vmware,vbox] Unify directory layout in /tmp, better cleanup --- .../vmware/includes/set_vmware_include_variables.inc | 11 ----------- .../vmware/data/opt/openslx/vmchooser/vmware/run-virt.include | 1 - 2 files changed, 12 deletions(-) (limited to 'remote/modules/vmware/data/opt') diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc index 5a5d1132..0c45ee59 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/set_vmware_include_variables.inc @@ -5,17 +5,6 @@ set_vmware_include_variables() { [ "$mem" -gt 3800 -a "$(uname -m)" != "x86_64" ] && mem=3800 - # VM-ID static (0D), remove if changed to 00 - VM_ID="0D" - - # should be dynamic - if [ "x$(which bc)" != "x" ]; then - VM_ID=$(echo "obase=16; $$" | bc) - VM_ID=$(expr substr $VM_ID $(expr ${#VM_ID} - 1) 2) - else - VM_ID=$[ $$ % 100 ] - fi - # temporary disk space for logs, etc... redodir="/tmp/virt/vmware/${USER}.$$" diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include index a823df72..f63092bd 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/run-virt.include @@ -68,5 +68,4 @@ cp "$conffile" "/tmp/vmware-last-config" # using the modified version of the wrapper script VIRTCMD="/opt/openslx/bin/vmplayer" VIRTCMDOPTS="${vmopt} ${conffile}" -RMDIRS="${redodir} ${conffile}" -- cgit v1.2.3-55-g7522 From fc611666134f8b4a1073eca14bb2ecfe1b3aa954 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 8 Jan 2016 11:50:40 +0100 Subject: Preparations for exam mode --- .../scripts/includes/set_runvirt_variables.inc | 2 +- .../includes/create_vmhome_preferences_file.inc | 6 ++-- .../vmchooser/vmware/includes/parse_vmx.inc | 19 ++++++++--- remote/rootfs/rootfs-stage31/data/init | 38 ++++++++++++++++++++++ 4 files changed, 58 insertions(+), 7 deletions(-) (limited to 'remote/modules/vmware/data/opt') diff --git a/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_variables.inc b/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_variables.inc index f0aae889..5215eb2d 100644 --- a/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_variables.inc +++ b/remote/modules/run-virt/data/opt/openslx/scripts/includes/set_runvirt_variables.inc @@ -5,8 +5,8 @@ VMCHOOSER_DIR="/opt/openslx/vmchooser" VMCHOOSER_CONF_DIR="$VMCHOOSER_DIR/config" LOGFILE="/var/log/openslx/run-virt.${USER}.$$.log" -TMPDIR="/tmp/virt/$(whoami)" USER="$(whoami)" +TMPDIR="/tmp/virt/${USER}/$$" readonly VMCHOOSER_DIR VMCHOOSER_CONF_DIR LOGFILE TMPDIR USER diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc index e33320ad..b618041c 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/create_vmhome_preferences_file.inc @@ -35,7 +35,6 @@ create_vmhome_preferences_file() { pref.hotkey.alt = "true" pref.hotkey.shift = "true" pref.hotkey.gui = "true" - gui.restricted = "true" # fullscreen/mouse/keyboard pref.fullscreen.toolbarPixels = "0" @@ -65,5 +64,8 @@ create_vmhome_preferences_file() { pref.eula1.product = "VMware Workstation" pref.eula1.build = "$vmware_build" HEREEND - writelog "Vmware preferences file created in vmhome." + if [ -n "$SLX_EXAM" ]; then + echo 'pref.hotkey.rightControl = "true"' >> "$vmhome/preferences" + fi + writelog "Vmware preferences file created in $vmhome." } diff --git a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc index 3d82d934..f8f43ad3 100644 --- a/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc +++ b/remote/modules/vmware/data/opt/openslx/vmchooser/vmware/includes/parse_vmx.inc @@ -55,10 +55,16 @@ MemTrimRate = "-1" HEREEND # USB -cat >> "$TMPDIR/$IMGUUID" <<-HEREEND -usb.present = "TRUE" -usb.generic.autoconnect = "TRUE" -HEREEND +if [ -n "$SLX_EXAM" ]; then + # Exam mode: No USB (TODO: Configurable) + sed -i '/^usb\./d' "$TMPDIR/$IMGUUID" + echo 'usb.present = "FALSE"' >> "$TMPDIR/$IMGUUID" +else + cat >> "$TMPDIR/$IMGUUID" <<-HEREEND + usb.present = "TRUE" + usb.generic.autoconnect = "TRUE" + HEREEND +fi # shared folders cat >> "$TMPDIR/$IMGUUID" <<-HEREEND @@ -106,6 +112,11 @@ fi sed -i '/^gui.applyHostDisplayScaling/d' "$TMPDIR/$IMGUUID" echo 'gui.applyHostDisplayScalingToGuest = "FALSE"' >> "$TMPDIR/$IMGUUID" +# Additinal exam mode settings +if [ -n "$SLX_EXAM" ]; then + echo 'gui.restricted = "true"' >> "$TMPDIR/$IMGUUID" +fi + # Killing duplicate lines (output much nicer than sort -u): awk '!a[$0]++' "${TMPDIR}/${IMGUUID}" > "${TMPDIR}/${IMGUUID}.tmp" && mv "${TMPDIR}/${IMGUUID}.tmp" "${TMPDIR}/${IMGUUID}" diff --git a/remote/rootfs/rootfs-stage31/data/init b/remote/rootfs/rootfs-stage31/data/init index 7c66cd11..51010ffa 100755 --- a/remote/rootfs/rootfs-stage31/data/init +++ b/remote/rootfs/rootfs-stage31/data/init @@ -111,6 +111,44 @@ for mnt in proc sys run ; do busybox umount -f -l "/$mnt" 2>/dev/null done +# HACK HACK: Klausurmodus +# Putting this here as we're hopefully moving to the all new dracut solution soon +# so there's no reason to make it pretty now +if [ -n "$SLX_EXAM" ]; then + # Visual: Make kdm all orange + sed -i 's/#e3e4e9/#f9a72b/g' "${FUTURE_ROOT}/usr/share/desktop/themes/kdm/bwlehrpool/theme.xml" + # Visual: Move splash screen to upper left corner + if [ -e "/etc/splash.ppm.gz" ]; then + fbsplash -b -s "/etc/splash.ppm.gz" & + elif [ -e "/etc/splash.ppm" ]; then + fbsplash -b -s "/etc/splash.ppm" & + fi + # Visual: ssh banner + echo "+ - - - - KLAUSURMODUS AKTIV - - - - +" >> "${FUTURE_ROOT}/etc/issue.net" + echo "++++++++++++++++++++++++++++++++++++++" >> "${FUTURE_ROOT}/etc/issue.net" + # Disable some services, ldap/ad + rm -- "${FUTURE_ROOT}/etc/systemd/system/network.target.wants/sssd.service" + sed -i 's/ sss//' "${FUTURE_ROOT}/etc/nsswitch.conf" + # Disable ctrl-alt-delete + rm -- "${FUTURE_ROOT}/usr/lib/systemd/system/ctrl-alt-del.target" + # No idleaction + rm -- "${FUTURE_ROOT}/etc/cron.d/openslx-idleaction" + # Ignore everything but power button + cat > "${FUTURE_ROOT}/etc/systemd/logind.conf" < "${FUTURE_ROOT}/opt/openslx/.benchmark" # Prepare environment (HOME is needed as a hack for nss_ldap with ssl and no caching) -- cgit v1.2.3-55-g7522