summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm62
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm61
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm62
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm61
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm11
5 files changed, 171 insertions, 86 deletions
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm
index fa9546ad..9e82a2df 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Base.pm
@@ -44,6 +44,7 @@ sub fillRunlevelScript
{
my $self = shift;
my $location = shift;
+ my $kind = shift;
my $script = unshiftHereDoc(<<" End-of-Here");
#! /bin/sh
@@ -65,27 +66,48 @@ sub fillRunlevelScript
# Description: Manages the services needed to run VMware software
### END INIT INFO
load_modules() {
- if [ \${vmware_kind} = "local" ]; then
- # to be filled in via the stage1 configuration script
- modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
- # most probably nobody wants to run the parallel port driver ...
- #modprobe vm...
- else
- # load module manuall
- vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
- module_src_path=\${vmware_kind_path}/vmroot/modules
- if [ \${vmware_kind} != "vmpl1.0" ]; then
- insmod \${module_src_path}/vmblock.ko
- fi
- insmod \${module_src_path}/vmmon.ko
- insmod \${module_src_path}/vmnet.ko
- fi
+ End-of-Here
+
+ # Load modules
+ if ($kind eq 'local') {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # to be filled in via the stage1 configuration script
+ modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
+ # most probably nobody wants to run the parallel port driver ...
+ #modprobe vm...
+ End-of-Here
+ } else {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # load module manuall
+ vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
+ module_src_path=\${vmware_kind_path}/vmroot/modules
+ insmod \${module_src_path}/vmmon.ko
+ insmod \${module_src_path}/vmnet.ko
+ End-of-Here
+ if ($kind ne "vmpl1.0") {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ insmod \${module_src_path}/vmblock.ko
+ End-of-Here
+ }
+ }
+
+ # unload modules
+ $script .= unshiftHereDoc(<<" End-of-Here");
}
+
unload_modules() {
- # to be filled with the proper list within via the stage1 configuration
- # script
+ # to be filled with the proper list within via the stage1
+ # configuration script
rmmod vmmon vmblock vmnet 2>/dev/null
}
+ End-of-Here
+
+
+ # setup vmnet0 and vmnet8
+ # depends on specific stage3 setting. I let this if in the code
+ # because else this whole if-reducing process will become more
+ # complicated and the code will get less understandable
+ $script .= unshiftHereDoc(<<" End-of-Here");
# the bridged interface
setup_vmnet0() {
if [ -n "\$vmnet0" ] ; then
@@ -112,7 +134,7 @@ sub fillRunlevelScript
fi
$location/vmnet-dhcpd -cf /etc/vmware/dhcpd-vmnet1.conf -lf \\
/var/run/vmware/dhcpd-vmnet1.leases \\
- -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1
+ -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1 2>/dev/null # or logfile
fi
}
# incomplete ...
@@ -125,10 +147,10 @@ sub fillRunlevelScript
ip link set vmnet8 up
# /etc/vmware/vmnet-natd-8.mac simply contains a mac like 00:50:56:F1:30:50
$location/vmnet-natd -d /var/run/vmnet-natd-8.pid \\
- -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf
+ -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf 2>/dev/null # or logfile
$location/vmnet-dhcpd -cf /etc/vmware/dhcpd-vmnet8.conf -lf \\
/var/run/vmware/dhcpd-vmnet8.leases \\
- -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8
+ -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8 2>/dev/null # or logfile
fi
}
case \$1 in
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm
index 88ba695e..02c93501 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Debian.pm
@@ -30,6 +30,7 @@ sub fillRunlevelScript
{
my $self = shift;
my $location = shift;
+ my $kind = shift;
my $script = unshiftHereDoc(<<" End-of-Here");
#! /bin/sh
@@ -52,27 +53,47 @@ sub fillRunlevelScript
### END INIT INFO
load_modules() {
- if [ \${vmware_kind} = "local" ]; then
- # to be filled in via the stage1 configuration script
- modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
- # most probably nobody wants to run the parallel port driver ...
- #modprobe vm...
- else
- # load module manuall
- vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
- module_src_path=\${vmware_kind_path}/vmroot/modules
- if [ \${vmware_kind} != "vmpl1.0" ]; then
- insmod \${module_src_path}/vmblock.ko
- fi
- insmod \${module_src_path}/vmmon.ko
- insmod \${module_src_path}/vmnet.ko
- fi
+ End-of-Here
+
+ # Load modules
+ if ($kind eq 'local') {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # to be filled in via the stage1 configuration script
+ modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
+ # most probably nobody wants to run the parallel port driver ...
+ #modprobe vm...
+ End-of-Here
+ } else {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # load module manuall
+ vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
+ module_src_path=\${vmware_kind_path}/vmroot/modules
+ insmod \${module_src_path}/vmmon.ko
+ insmod \${module_src_path}/vmnet.ko
+ End-of-Here
+ if ($kind ne "vmpl1.0") {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ insmod \${module_src_path}/vmblock.ko
+ End-of-Here
+ }
+ }
+
+ # unload modules
+ $script .= unshiftHereDoc(<<" End-of-Here");
}
+
unload_modules() {
- # to be filled with the proper list within via the stage1 configuration
- # script
+ # to be filled with the proper list within via the stage1
+ # configuration script
rmmod vmmon vmblock vmnet 2>/dev/null
}
+ End-of-Here
+
+ # setup vmnet0 and vmnet8
+ # depends on specific stage3 setting. I let this if in the code
+ # because else this whole if-reducing process will become more
+ # complicated and the code will get less understandable
+ $script .= unshiftHereDoc(<<" End-of-Here");
# the bridged interface
setup_vmnet0() {
if [ -n "\$vmnet0" ] ; then
@@ -101,7 +122,7 @@ sub fillRunlevelScript
fi
$location/vmnet-dhcpd -cf /etc/vmware/dhcpd-vmnet1.conf -lf \\
/var/run/vmware/dhcpd-vmnet1.leases \\
- -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1
+ -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1 2>/dev/null # or logfile
fi
}
# incomplete ...
@@ -116,10 +137,10 @@ sub fillRunlevelScript
ip link set vmnet8 up
# /etc/vmware/vmnet-natd-8.mac simply contains a mac like 00:50:56:F1:30:50
$location/vmnet-natd -d /var/run/vmnet-natd-8.pid \\
- -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf
+ -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf 2>/dev/null # or logfile
$location/vmnet-dhcpd -cf /etc/vmware/dhcpd-vmnet8.conf \\
-lf /var/run/vmware/dhcpd-vmnet8.leases \\
- -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet8
+ -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet8 2>/dev/null # or logfile
fi
}
# initialize the lsb status messages
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm
index 5b865532..a3f31840 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Gentoo.pm
@@ -29,6 +29,7 @@ sub fillRunlevelScript
{
my $self = shift;
my $location = shift;
+ my $kind = shift;
my $script = unshiftHereDoc(<<" End-of-Here");
#!/sbin/runscript
@@ -48,27 +49,48 @@ sub fillRunlevelScript
# helper functions
load_modules() {
- if [ \${vmware_kind} = "local" ]; then
- # to be filled in via the stage1 configuration script
- modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
- # most probably nobody wants to run the parallel port driver ...
- #modprobe vm...
- else
- # load module manuall
- vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
- module_src_path=\${vmware_kind_path}/vmroot/modules
- if [ \${vmware_kind} != "vmpl1.0" ]; then
- insmod \${module_src_path}/vmblock.ko
- fi
- insmod \${module_src_path}/vmmon.ko
- insmod \${module_src_path}/vmnet.ko
- fi
+ End-of-Here
+
+ if ($kind eq 'local') {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # to be filled in via the stage1 configuration script
+ modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
+ # most probably nobody wants to run the parallel port driver ...
+ #modprobe vm...
+ End-of-Here
+ } else {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # load module manuall
+ vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
+ module_src_path=\${vmware_kind_path}/vmroot/modules
+ insmod \${module_src_path}/vmmon.ko
+ insmod \${module_src_path}/vmnet.ko
+ End-of-Here
+ if ($kind ne "vmpl1.0") {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ insmod \${module_src_path}/vmblock.ko
+ End-of-Here
+ }
+ }
+
+ # unload modules
+ $script .= unshiftHereDoc(<<" End-of-Here");
}
+
unload_modules() {
- # to be filled with the proper list within via the stage1 configuration
- # script
+ # to be filled with the proper list within via the stage1
+ # configuration script
rmmod vmmon vmblock vmnet 2>/dev/null
}
+ End-of-Here
+
+
+
+ # setup vmnet0 and vmnet8
+ # depends on specific stage3 setting. I let this if in the code
+ # because else this whole if-reducing process will become more
+ # complicated and the code will get less understandable
+ $script .= unshiftHereDoc(<<" End-of-Here");
# the bridged interface
setup_vmnet0() {
if [ -n "\$vmnet0" ] ; then
@@ -95,7 +117,7 @@ sub fillRunlevelScript
fi
$location/vmnet-dhcpd -cf /etc/vmware/dhcpd-vmnet8.conf \\
-lf /var/run/vmware/dhcpd-vmnet1.leases \\
- -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1
+ -pf /var/run/vmnet-dhcpd-vmnet1.pid vmnet1 2>/dev/null # or logfile
fi
}
# incomplete ...
@@ -108,10 +130,10 @@ sub fillRunlevelScript
ip link set vmnet8 up
# /etc/vmware/vmnet-natd-8.mac simply contains a mac like 00:50:56:F1:30:50
$location/vmnet-natd -d /var/run/vmnet-natd-8.pid \\
- -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf
+ -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf 2>/dev/null # or logfile
$location/vmnet-dhcpd -cf /etc/vmware/dhcpd-vmnet8.conf \\
-lf /var/run/vmware/dhcpd-vmnet8.leases \\
- -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8
+ -pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8 2>/dev/null # or logfile
fi
}
diff --git a/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
index bd790e45..66fa03a8 100644
--- a/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
@@ -29,6 +29,7 @@ sub fillRunlevelScript
{
my $self = shift;
my $location = shift;
+ my $kind = shift;
my $script = unshiftHereDoc(<<" End-of-Here");
#! /bin/sh
@@ -53,29 +54,47 @@ sub fillRunlevelScript
# helper functions
load_modules() {
- # shouldn't be in here (see ticket 240)
- if [ \${vmware_kind} = "local" ]; then
- # to be filled in via the stage1 configuration script
- modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
- # most probably nobody wants to run the parallel port driver ...
- #modprobe vm...
- else
- # load module manuall
- vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
- module_src_path=\${vmware_kind_path}/vmroot/modules
- # shouldn't be in here (see ticket 240)
- if [ \${vmware_kind} != "vmpl1.0" ]; then
- insmod \${module_src_path}/vmblock.ko
- fi
- insmod \${module_src_path}/vmmon.ko
- insmod \${module_src_path}/vmnet.ko
- fi
+ End-of-Here
+
+ # Load modules
+ if ($kind eq 'local') {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # to be filled in via the stage1 configuration script
+ modprobe -qa vmmon vmnet vmblock 2>/dev/null || return 1
+ # most probably nobody wants to run the parallel port driver ...
+ #modprobe vm...
+ End-of-Here
+ } else {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ # load module manuall
+ vmware_kind_path=/opt/openslx/plugin-repo/vmware/\${vmware_kind}/
+ module_src_path=\${vmware_kind_path}/vmroot/modules
+ insmod \${module_src_path}/vmmon.ko
+ insmod \${module_src_path}/vmnet.ko
+ End-of-Here
+ if ($kind ne 'vmpl1.0') {
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ insmod \${module_src_path}/vmblock.ko
+ End-of-Here
}
+ }
+
+ # unload modules
+ $script .= unshiftHereDoc(<<" End-of-Here");
+ }
+
unload_modules() {
- # to be filled with the proper list within via the stage1 configuration
- # script
+ # to be filled with the proper list within via the stage1
+ # configuration script
rmmod vmmon vmblock vmnet 2>/dev/null
}
+ End-of-Here
+
+ # setup vmnet0 and vmnet8
+ # depends on specific stage3 setting. I let this if in the code
+ # because else this whole if-reducing process will become more
+ # complicated and the code will get less understandable
+ $script .= unshiftHereDoc(<<" End-of-Here");
# the bridged interface
setup_vmnet0() {
if [ -n "\$vmnet0" ] ; then
@@ -120,7 +139,7 @@ sub fillRunlevelScript
ip link set vmnet8 up
# /etc/vmware/vmnet-natd-8.mac simply contains a mac like 00:50:56:F1:30:50
$location/vmnet-natd -d /var/run/vmnet-natd-8.pid \\
- -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf >/dev/null # or logfile
+ -m /etc/vmware/vmnet-natd-8.mac -c /etc/vmware/nat.conf 2>/dev/null # or logfile
$location/vmnet-dhcpd -cf /etc/vmware/dhcpd-vmnet8.conf \\
-lf /var/run/vmware/dhcpd-vmnet8.leases \\
-pf /var/run/vmnet-dhcpd-vmnet8.pid vmnet8 2>/dev/null # or logfile
@@ -147,6 +166,8 @@ sub fillRunlevelScript
echo -n "Stopping vmware background services ..."
killall vmnet-netifup vmnet-natd vmnet-bridge vmware vmplayer \\
vmware-tray vmnet-dhcpd 2>/dev/null
+ # workaround, because we can kill more as we have started
+ rc_reset
# wait for shutting down of interfaces. vmnet needs kinda
# long
usleep 500000
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
index e8ec74e2..14b44e39 100644
--- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
@@ -260,9 +260,7 @@ sub checkStage3AttrValues
my $vm_kind = $stage3Attrs->{'vmware::kind'} || '';
- print "DEBUG $vm_kind\n";
my $vmimg = $stage3Attrs->{'vmware::imagesrc'} || '';
- print "DEBUG $vmimg\n";
if ($vm_kind eq 'local' && ! -x "/usr/lib/vmware/bin/vmware") {
push @problems, _tr(
@@ -307,10 +305,11 @@ sub _writeRunlevelScript
my $self = shift;
my $location = shift;
my $file = shift;
+ my $kind = shift;
# $location points to the path where vmware helpers are installed
# call the distrospecific fillup
- my $runlevelScript = $self->{distro}->fillRunlevelScript($location);
+ my $runlevelScript = $self->{distro}->fillRunlevelScript($location, $kind);
# OLTA: this backup strategy is useless if invoked twice, so I have
# deactivated it
@@ -467,7 +466,7 @@ sub _localInstallation
##
## Create runlevel script
my $runlevelScript = "$self->{'pluginRepositoryPath'}/$kind/vmware.init";
- $self->_writeRunlevelScript($vmbin, $runlevelScript);
+ $self->_writeRunlevelScript($vmbin, $runlevelScript, $kind);
##
## Create wrapperscripts
@@ -515,7 +514,7 @@ sub _vmpl2Installation {
##
## Create runlevel script
my $runlevelScript = "$self->{'pluginRepositoryPath'}/$kind/vmware.init";
- $self->_writeRunlevelScript($vmbin, $runlevelScript);
+ $self->_writeRunlevelScript($vmbin, $runlevelScript, $kind);
##
## Create wrapperscripts
@@ -561,7 +560,7 @@ sub _vmpl1Installation {
##
## Create runlevel script
my $runlevelScript = "$self->{'pluginRepositoryPath'}/$kind/vmware.init";
- $self->_writeRunlevelScript($vmbin, $runlevelScript);
+ $self->_writeRunlevelScript($vmbin, $runlevelScript, $kind);
##
## Create wrapperscripts