summaryrefslogtreecommitdiffstats
path: root/core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include
diff options
context:
space:
mode:
authorJonathan Bauer2021-05-04 14:31:06 +0200
committerJonathan Bauer2021-05-04 14:31:06 +0200
commit9edb9e7edf996272ad2fdca573e874472fb8e226 (patch)
treebeed71f29f56fb21b2107d5e27b8a6bf031c15b6 /core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include
parentMerge branch 'master' into installer (diff)
parent[run-virt-docker] change to new email address (diff)
downloadmltk-9edb9e7edf996272ad2fdca573e874472fb8e226.tar.gz
mltk-9edb9e7edf996272ad2fdca573e874472fb8e226.tar.xz
mltk-9edb9e7edf996272ad2fdca573e874472fb8e226.zip
Merge branch 'master' into installer
Diffstat (limited to 'core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include')
-rwxr-xr-xcore/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include59
1 files changed, 59 insertions, 0 deletions
diff --git a/core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include b/core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include
new file mode 100755
index 00000000..610c7814
--- /dev/null
+++ b/core/modules/run-virt-docker/data/opt/openslx/vmchooser/plugins/docker/run-virt.include
@@ -0,0 +1,59 @@
+#!/bin/bash
+###############################################################################
+# -----------------------------------------------------------------------------
+#
+# Copyright (c) 2009..2018 bwLehrpool-Projektteam
+#
+# This program/file is free software distributed under the GPL version 2.
+# See https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
+#
+# If you have any feedback please consult https://bwlehrpool.de and
+# send your feedback to support@bwlehrpool.de.
+#
+# General information about bwLehrpool can be found at https://bwlehrpool.de
+#
+# -----------------------------------------------------------------------------
+# run-virt.include
+# - qemu/kvm plugin for vmchooser run-virt
+################################################################################
+
+# BASH_SOURCE[0] contains the file being sourced, namely this one
+declare -rg DOCKER_PLUGIN_DIR="$(dirname "${BASH_SOURCE[0]}")"
+declare -rg DOCKER_INCLUDE_DIR="${DOCKER_PLUGIN_DIR}/includes"
+
+# TODO make this part of the metadata coming from the server
+# TBD: "firewall printer usb slxfloppy sound netshares"
+declare -rg PLUGIN_FEATURES=""
+
+run_plugin() {
+
+ # VMX == bwlp-container-info.tar.gz
+ writelog "+ unpacking container ressources"
+ tar -xzvf "$TMPCONFIG" --directory "$CONFDIR"
+
+ # VARS
+ # location of scripts and config files which will be used in desktop
+ export USER_CONTAINER_CONTEXT="$HOME/.local/docker"
+ # config file which will be filed with vars in the follwing process
+ export USER_CONTAINER_CONFIG="$USER_CONTAINER_CONTEXT/.bwlp-user-conf"
+ # dictonary which maps a drive letter to a directory
+ declare -Ag NETSHARE_DIR
+
+ # apply "allow_root" option to gvfsd-fuse, so docker can bind mount gvfs network shares
+ writelog "+ gio_allow_root_fix.inc"
+ $( safesource "${DOCKER_INCLUDE_DIR}/gio_allow_root_fix.inc" )
+
+ # mount netshares from CONFDIR/netshares
+ writelog "+ gio_mount_netshare.inc"
+ $( safesource "${DOCKER_INCLUDE_DIR}/gio_mount_netshare.inc" )
+
+ writelog "+ init user container context"
+ $( safesource "${DOCKER_INCLUDE_DIR}/init_user_context.inc" )
+
+ # init bind mount option for container
+ writelog "+ init_bind_mount.inc"
+ $( safesource "${DOCKER_INCLUDE_DIR}/init_bind_mount.inc" )
+
+ # HACK: using the modified version of the wrapper script
+ declare -rg VIRTCMD="startxfce4"
+}