From 83b64a7bc5da94461725965f1ad8edc0ef44364c Mon Sep 17 00:00:00 2001 From: Volker Uhrig Date: Tue, 23 Jun 2009 14:34:13 +0000 Subject: * Added installation checks * Basic structur of init.d git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2982 95ad53e4-c205-0410-b2fa-d234c58c8868 --- .../virtualbox/OpenSLX/OSPlugin/virtualbox.pm | 38 ++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) (limited to 'os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm') diff --git a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm index 5ce615c5..e88cec79 100644 --- a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm +++ b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm @@ -113,10 +113,12 @@ sub installationPhase # Different names of the tool (should be unified somehow!?) if (!isInPath('VirtualBox')) { - $engine->installPackages( - $engine->getInstallablePackagesForSelection('virtualbox-ose') - ); + $self->{distro}->installVbox(); } + if (!isInPath('VirtualBox')) { + print "VirtualBox is not installed. VirtualBox Plugin won't be installed!\n"; + exit + } # Copy run-virt.include to the appropriate place for inclusion in stage4 copyFile("$self->{openslxBasePath}/lib/plugins/virtualbox/files/run-virt.include", "$self->{pluginRepositoryPath}/"); @@ -158,6 +160,36 @@ sub _writeRunlevelScript spitFile($file, $runlevelScript); + # function: + # running() { + # lsmod | grep -q "$1[^_-]" + # } + # vmstatus() { + # if running vboxdrv; then + # if running vboxnetflt; then + # echo "VirtualBox kernel modules (vboxdrv and vboxnetflt) are loaded." + # else + # echo "VirtualBox kernel module is loaded." + # fi + # #TODO: check it: ignore user check. handling our own way: + # for i in /tmp/.vbox-*-ipc; do + # echo "Running: " + # $(VBoxManage --nologo list runningvms | sed -e 's/^".*"//' 2>/dev/null) + # done + # else + # echo "VirtualBox kernel module is not loaded." + # fi + # } + # start() { + # modprobe vboxdrv && modprobe vboxnetflt + # } + # stop() { + # rmmod vboxnetflt && rmmod vboxdrv + # } + # case start: start + # case stop: stop + # case status: vmstatus + # case restart: stop && start } # The bridge configuration needs the bridge module to be present in early -- cgit v1.2.3-55-g7522