From 5ce1a589efa011e85402bfeda699b6c63c8ebcbb Mon Sep 17 00:00:00 2001 From: Christian Rößler Date: Tue, 17 Dec 2013 17:04:16 +0100 Subject: [qemukvm] services, addon-init, env file, udev reload etc. NOT TESTED ENOUGH! --- remote/modules/qemukvm/data/addon-init | 8 ++++++++ .../etc/systemd/system/graphical.target.wants/qemukvm.service | 1 + remote/modules/qemukvm/data/etc/systemd/system/qemukvm.service | 9 +++++++++ .../modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env | 8 +++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 remote/modules/qemukvm/data/addon-init create mode 120000 remote/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service create mode 100644 remote/modules/qemukvm/data/etc/systemd/system/qemukvm.service (limited to 'remote/modules') diff --git a/remote/modules/qemukvm/data/addon-init b/remote/modules/qemukvm/data/addon-init new file mode 100755 index 00000000..cccc1e8a --- /dev/null +++ b/remote/modules/qemukvm/data/addon-init @@ -0,0 +1,8 @@ +#!/bin/ash + +systemctl daemon-reload +systemctl start qemukvm.service + +# this seems to be necessary due to the misbehaviour of udevd +# in view of the undetected ENV dev_type +systemctl restart systemd-udevd diff --git a/remote/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service b/remote/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service new file mode 120000 index 00000000..89d8afbf --- /dev/null +++ b/remote/modules/qemukvm/data/etc/systemd/system/graphical.target.wants/qemukvm.service @@ -0,0 +1 @@ +../qemukvm.service \ No newline at end of file diff --git a/remote/modules/qemukvm/data/etc/systemd/system/qemukvm.service b/remote/modules/qemukvm/data/etc/systemd/system/qemukvm.service new file mode 100644 index 00000000..8faf5d06 --- /dev/null +++ b/remote/modules/qemukvm/data/etc/systemd/system/qemukvm.service @@ -0,0 +1,9 @@ +[Unit] +Description=Sets up the virtual box environment +Requires=vmchooser.service +After=vmchooser.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/opt/openslx/scripts/systemd-qemukvm_env start diff --git a/remote/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env b/remote/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env index 3173ca45..2d1483aa 100644 --- a/remote/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env +++ b/remote/modules/qemukvm/data/opt/openslx/scripts/systemd-qemukvm_env @@ -14,8 +14,14 @@ # - This is the preparation script for the configuration of Linux Qemu/KVM. ################################################################################ + +modprobe kvm +modprobe kvm_amd +modprobe kvm_intel + # check for Linux kvm modules (if required at all) -# lsmod |grep kvm || slxlog "qemukvm-modules" "Cannot find any kvm kernel module(s)" + +lsmod |grep kvm || slxlog "qemukvm-modules" "Cannot find any kvm kernel module(s)" cat >> /etc/sudoers << EOF # allow to start and stop kvm services / load-/unload kvm modules -- cgit v1.2.3-55-g7522