diff options
author | Oliver Tappe | 2009-02-11 20:18:05 +0100 |
---|---|---|
committer | Oliver Tappe | 2009-02-11 20:18:05 +0100 |
commit | e84fb140c6af6cbce98abb71d059394c3804f0a1 (patch) | |
tree | ec94756ab4fd58f35dae96eaacf34e623b578401 /config-db/slxconfig-demuxer | |
parent | * The xxx::active attribute of every plugin applies to clients, too. (diff) | |
download | core-e84fb140c6af6cbce98abb71d059394c3804f0a1.tar.gz core-e84fb140c6af6cbce98abb71d059394c3804f0a1.tar.xz core-e84fb140c6af6cbce98abb71d059394c3804f0a1.zip |
* improved support for plugin configurations such that it should now be possible
for a client to activate a plugin that has been installed in a vendor-OS,
but which is specified as inactive by the corresponding system. In such a case
the demuxer will print out an appropriate message and will cause the boot
environment to consider that plugin during generation of the initramfs, too.
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2574 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/slxconfig-demuxer')
-rwxr-xr-x | config-db/slxconfig-demuxer | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer index 0e0cde71..21c95ae9 100755 --- a/config-db/slxconfig-demuxer +++ b/config-db/slxconfig-demuxer @@ -444,8 +444,26 @@ sub writeClientConfigurationsForSystem $externalSystemID, $buildPath, $externalClientName ); - # add plugin configuration - writePluginConfigurationsForSystem($info, $buildPath); + # add plugin configuration and note if the client adds any active + # plugin (as opposed to current state) + my $activeClientPlugins = writePluginConfigurations( + $info, $buildPath, $client->{attrs} + ); + my @additionalActivePlugins = grep { + my $activeClientPlugin = $_; + ! grep { + $activeClientPlugin eq $_ + } @{$info->{'active-plugins'}}; + } @$activeClientPlugins; + if (@additionalActivePlugins) { + push @{$info->{'active-plugins'}}, @additionalActivePlugins; + my $additionalActivePluginStr + = join ',', @additionalActivePlugins; + vlog(0, _tr( + "client '%s' activates additional plugins: %s", + $client->{name}, $additionalActivePluginStr + )); + } # check attributes against illegal values and write them into # a file if they're ok: @@ -476,15 +494,14 @@ sub writeClientConfigurationsForSystem return; } -sub writePluginConfigurationsForSystem +sub writePluginConfigurations { my $info = shift || confess 'need to pass in info-hash!'; my $buildPath = shift || confess 'need to pass in build-path!'; + my $attrs = shift || {}; my $pluginConfPath = "$buildPath/initramfs/plugin-conf"; - my $attrs = $info->{attrs} || {}; - my @activePlugins; foreach my $pluginInfo (@{$info->{'installed-plugins'}}) { my $pluginName = $pluginInfo->{plugin_name}; @@ -535,10 +552,7 @@ sub writePluginConfigurationsForSystem vlog(0, "--- END OF $fileName --- "); } } - $info->{'active-plugins'} = \@activePlugins; - my $activePluginStr = @activePlugins ? join ',', @activePlugins : '<none>'; - vlog(0, _tr("active plugins: %s", $activePluginStr)); - return; + return \@activePlugins; } sub createBootEnvironmentsForSystem @@ -557,8 +571,6 @@ sub createBootEnvironmentsForSystem vlog(0, _tr("creating boot environment for $bootType")); my $bootEnv = bootEnvironmentForType($bootType); - $initramfsCount - += $bootEnv->writeFilesRequiredForBooting($info, $buildPath); # only create a default.tgz if required by boot environment if ($bootEnv->requiresDefaultClientConfig()) { @@ -572,6 +584,10 @@ sub createBootEnvironmentsForSystem writeClientConfigurationsForSystem( $info, $buildPath, $attrFile, $bootType, $clients ); + + # let boot environment copy the kernel and create the initramfs + $initramfsCount + += $bootEnv->writeFilesRequiredForBooting($info, $buildPath); } return; @@ -617,7 +633,12 @@ sub writeSystemConfiguration warn $complaint; } - writePluginConfigurationsForSystem($info, $buildPath); + my $activePlugins + = writePluginConfigurations($info, $buildPath, $info->{attrs}); + $info->{'active-plugins'} = $activePlugins; + my $activePluginStr + = @$activePlugins ? join ',', @$activePlugins : '<none>'; + vlog(0, _tr("active plugins: %s", $activePluginStr)); # create all required (pre-)boot-environments (PXE, CD, ...) my $attrFile = "$buildPath/initramfs/machine-setup"; |