summaryrefslogtreecommitdiffstats
path: root/os-plugins/OpenSLX/OSPlugin/Engine.pm
diff options
context:
space:
mode:
authorOliver Tappe2008-05-26 21:22:00 +0200
committerOliver Tappe2008-05-26 21:22:00 +0200
commitb943b09340c3e3c59f83823946ceeb3e453b3e52 (patch)
treecfbb91e9b11a909b3ffc785cb9c18fc68a06d1fc /os-plugins/OpenSLX/OSPlugin/Engine.pm
parentFixed non-working installation & deinstallation of plugins into/from the '<<<... (diff)
downloadcore-b943b09340c3e3c59f83823946ceeb3e453b3e52.tar.gz
core-b943b09340c3e3c59f83823946ceeb3e453b3e52.tar.xz
core-b943b09340c3e3c59f83823946ceeb3e453b3e52.zip
* reworked plugin-API concerning the way the parameters are passed into
installationPhase() and removalPhase() - now we use a hash as the amount of parameters has become too large * adjusted all plugins to these API change * now not only the openslx base path, but the openslx config path is bind mounted into the vendor-OS chroot, such that plugins can check the available local configuration extensions git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1803 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins/OpenSLX/OSPlugin/Engine.pm')
-rw-r--r--os-plugins/OpenSLX/OSPlugin/Engine.pm68
1 files changed, 48 insertions, 20 deletions
diff --git a/os-plugins/OpenSLX/OSPlugin/Engine.pm b/os-plugins/OpenSLX/OSPlugin/Engine.pm
index 8527e827..6db265e9 100644
--- a/os-plugins/OpenSLX/OSPlugin/Engine.pm
+++ b/os-plugins/OpenSLX/OSPlugin/Engine.pm
@@ -94,7 +94,8 @@ sub initialize
= "/tmp/slx-plugin/$self->{'plugin-name'}";
$self->{'plugin-temp-path'}
= "$self->{'vendor-os-path'}/$self->{'chrooted-plugin-temp-path'}";
- $self->{'chrooted-openslx-base-path'} = '/mnt/openslx';
+ $self->{'chrooted-openslx-base-path'} = '/mnt/opt/openslx';
+ $self->{'chrooted-openslx-config-path'} = '/mnt/etc/opt/openslx';
# check and store given attribute set
my $knownAttrs = $self->{plugin}->getAttrInfo();
@@ -168,12 +169,18 @@ sub installPlugin
$self->_callChrootedFunctionForPlugin(
sub {
# invoke plugin and let it install itself into vendor-OS
- $self->{plugin}->installationPhase(
- $self->{'chrooted-plugin-repo-path'},
- $self->{'chrooted-plugin-temp-path'},
- $self->{'chrooted-openslx-base-path'},
- $self->{'plugin-attrs'},
- );
+ $self->{plugin}->installationPhase( {
+ 'plugin-repo-path'
+ => $self->{'chrooted-plugin-repo-path'},
+ 'plugin-temp-path'
+ => $self->{'chrooted-plugin-temp-path'},
+ 'openslx-base-path'
+ => $self->{'chrooted-openslx-base-path'},
+ 'openslx-config-path'
+ => $self->{'chrooted-openslx-config-path'},
+ 'plugin-attrs'
+ => $self->{'plugin-attrs'},
+ } );
# serialize possibly changed attributes (executed inside chroot)
store $self->{'plugin-attrs'}, $chrootedSerializedAttrsFile;
@@ -208,11 +215,18 @@ sub removePlugin
$self->_callChrootedFunctionForPlugin(
sub {
- $self->{plugin}->removalPhase(
- $self->{'chrooted-plugin-repo-path'},
- $self->{'chrooted-plugin-temp-path'},
- $self->{'chrooted-openslx-base-path'},
- );
+ $self->{plugin}->removalPhase( {
+ 'plugin-repo-path'
+ => $self->{'chrooted-plugin-repo-path'},
+ 'plugin-temp-path'
+ => $self->{'chrooted-plugin-temp-path'},
+ 'openslx-base-path'
+ => $self->{'chrooted-openslx-base-path'},
+ 'openslx-config-path'
+ => $self->{'chrooted-openslx-config-path'},
+ 'plugin-attrs'
+ => $self->{'plugin-attrs'},
+ } );
}
);
@@ -550,25 +564,39 @@ sub _callChrootedFunctionForPlugin
my $function = shift;
# bind-mount openslx basepath to /mnt/openslx of vendor-OS:
- my $basePath = $openslxConfig{'base-path'};
- my $openslxPathInChroot = "$self->{'vendor-os-path'}/mnt/openslx";
- mkpath($openslxPathInChroot);
+ my $basePath = $openslxConfig{'base-path'};
+ my $basePathInChroot = "$self->{'vendor-os-path'}/mnt/opt/openslx";
+ mkpath($basePathInChroot);
+ my $configPath = $openslxConfig{'config-path'};
+ my $configPathInChroot = "$self->{'vendor-os-path'}/mnt/etc/opt/openslx";
+ mkpath($configPathInChroot);
my $pluginSession = OpenSLX::ScopedResource->new({
name => 'osplugin::session',
acquire => sub {
- # bind mount openslx base path into vendor-OS
- slxsystem("mount -o bind -o ro $basePath $openslxPathInChroot") == 0
+ # bind mount openslx base and config paths into vendor-OS
+ slxsystem("mount -o bind -o ro $basePath $basePathInChroot") == 0
or die _tr(
"unable to bind mount '%s' to '%s'! (%s)",
- $basePath, $openslxPathInChroot, $!
+ $basePath, $basePathInChroot, $!
+ );
+ slxsystem(
+ "mount -o bind -o ro $configPath $configPathInChroot"
+ ) == 0
+ or die _tr(
+ "unable to bind mount '%s' to '%s'! (%s)",
+ $configPath, $configPathInChroot, $!
);
1
},
release => sub {
- slxsystem("umount $openslxPathInChroot") == 0
+ slxsystem("umount $basePathInChroot") == 0
+ or die _tr(
+ "unable to umount '%s'! (%s)", $basePathInChroot, $!
+ );
+ slxsystem("umount $configPathInChroot") == 0
or die _tr(
- "unable to umount '%s'! (%s)", $openslxPathInChroot, $!
+ "unable to umount '%s'! (%s)", $configPathInChroot, $!
);
1
},