summaryrefslogtreecommitdiffstats
path: root/os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
diff options
context:
space:
mode:
authorVolker Uhrig2008-07-17 18:34:26 +0200
committerVolker Uhrig2008-07-17 18:34:26 +0200
commit5de5662fa5582e28781c43f257b17464b41653e5 (patch)
tree7e85ad25768391c99b614f0231c479ea3bb30f46 /os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm
parentvmchooser: (diff)
downloadcore-5de5662fa5582e28781c43f257b17464b41653e5.tar.gz
core-5de5662fa5582e28781c43f257b17464b41653e5.tar.xz
core-5de5662fa5582e28781c43f257b17464b41653e5.zip
* Sync of changeset 1929
* reducing if statements in init script git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1931 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm')
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/Distro/Suse.pm61
1 files changed, 41 insertions, 20 deletions
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