diff options
author | Volker Uhrig | 2009-08-13 18:31:29 +0200 |
---|---|---|
committer | Volker Uhrig | 2009-08-13 18:31:29 +0200 |
commit | 79921651f99f63e534f147d6e7b3436cb6aff21a (patch) | |
tree | 8807a97bc5a13f166526fbb4c42ada7c3a5a052c /os-plugins/plugins/virtualbox | |
parent | Fixes for Ubuntu 9.04 ... (diff) | |
download | core-79921651f99f63e534f147d6e7b3436cb6aff21a.tar.gz core-79921651f99f63e534f147d6e7b3436cb6aff21a.tar.xz core-79921651f99f63e534f147d6e7b3436cb6aff21a.zip |
Initfile now created by DistroUtils
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@3090 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/virtualbox')
4 files changed, 40 insertions, 44 deletions
diff --git a/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm b/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm index 33581b83..edd117ca 100644 --- a/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm +++ b/os-plugins/plugins/virtualbox/OpenSLX/Distro/Debian.pm @@ -37,7 +37,10 @@ sub installVbox # lenny(5.0) has v1.6 # testing is ok. but no clue which lsb_release -rs it has... if ( $release eq "999999.0") { - $engine->installPackages('virtualbox-ose'); + #the usual "in stage1 chroot we get another kernel vers. problem" + # kernel modules need to be installed from the cloned system + #$engine->installPackages('virtualbox-ose'); + #system('/etc/init.d/virtualbox-ose setup'); } else { print "Couldn't install VirtualBox, no package from distribution\n"; exit; diff --git a/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm b/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm index 3bb2735c..44695680 100644 --- a/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm +++ b/os-plugins/plugins/virtualbox/OpenSLX/Distro/Ubuntu.pm @@ -38,7 +38,10 @@ sub installVbox # hardy (8.04LTS): only version VBox v1.5 if ( $release eq "8.10" || $release eq "9.04") { - $engine->installPackages("virtualbox-ose"); + #the usual "in stage1 chroot we get another kernel vers. problem" + # kernel modules need to be installed from the cloned system + #$engine->installPackages("virtualbox-ose"); + #system('/etc/init.d/virtualbox-ose setup'); } else { print "Couldn't install VirtualBox, no package from distribution!\n"; exit; diff --git a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm index a70d5f3d..fd4c827f 100644 --- a/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm +++ b/os-plugins/plugins/virtualbox/OpenSLX/OSPlugin/virtualbox.pm @@ -157,45 +157,40 @@ sub _writeRunlevelScript my $self = shift; my $initfile = newInitFile(); - my $workaround = "# Workaround till DistroUtils support functions\n"; $initfile->setName("virtualbox.slx"); $initfile->setDesc("Setup environment for virtualbox. Part of OpenSLX virtualbox plugin."); - #$initfile->addScript( - # 'running', - # 'lsmod | grep -q "$1[^_-]"' - #); - #$initfile->addScript( - # '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' - #); - #$initfile->addScript( - # 'start', - # 'modprobe vboxdrv && modprobe vboxnetflt', - #); - # why to load the modules already loaded in stage3?? - $workaround .= "start() { modprobe vboxdrv && modprobe vboxnetflt; }\n"; - #$initfile->addScript( - # 'stop', - # 'rmmod vboxnetflt && rmmod vboxdrv', - #); - $workaround .= "stop() { rmmod vboxnetflt && rmmod vboxdrv; }\n"; - - # please check for the new type of runlevel script writing (r3079) + # todo: Function need to be formated proper... not important right now + $initfile->addFunction( + 'running', + 'lsmod | grep -q "$1[^_-]"' + ); + $initfile->addFunction( + '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' + ); + $initfile->addFunction( + 'start', + ' modprobe vboxdrv && modprobe vboxnetflt', + ); + $initfile->addFunction( + 'stop', + ' rmmod vboxnetflt && rmmod vboxdrv', + ); $initfile->addToCase( 'start', 'start' @@ -220,11 +215,9 @@ sub _writeRunlevelScript my $workaround_distro = (split('-',$self->{'os-plugin-engine'}->distroName()))[0]; my $runlevelscript = getInitFileForDistro($initfile, $workaround_distro); - $workaround .= $runlevelscript; - # todo: because we dont have distribution or version dependend # init scripts we could put it directly into /etc/init.d... - spitFile("$self->{'pluginRepositoryPath'}/vbox-slx", $workaround); + spitFile("$self->{'pluginRepositoryPath'}/vbox-slx", $runlevelscript); } # The bridge configuration needs the bridge module to be present in early diff --git a/os-plugins/plugins/virtualbox/XX_virtualbox.sh b/os-plugins/plugins/virtualbox/XX_virtualbox.sh index 28505fdb..6f7b89ce 100644 --- a/os-plugins/plugins/virtualbox/XX_virtualbox.sh +++ b/os-plugins/plugins/virtualbox/XX_virtualbox.sh @@ -49,14 +49,11 @@ ${virtualbox_imagesrc}." nonfatal # copy and activate init file cp /mnt/opt/openslx/plugin-repo/virtualbox/vbox-slx \ /mnt/etc/init.d - chmod 755 /mnt/etc/init.d/vbox-slx rllinker "vbox-slx" 20 2 - # loading of the required kernel modules - modprobe vboxdrv - modprobe vboxnetflt mknod -m 0660 /dev/vboxdrv c 10 59 chown root:vboxusers /dev/vboxdrv + chmod 755 /etc/init.d/vbox-slx fi else [ $DEBUGLEVEL -gt 0 ] && echo " * Configuration of virtualbox plugin failed" |