From e84fb140c6af6cbce98abb71d059394c3804f0a1 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Wed, 11 Feb 2009 19:18:05 +0000 Subject: * 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 --- config-db/slxconfig-demuxer | 45 +++++++++++++++++++++++++++++++++------------ 1 file changed, 33 insertions(+), 12 deletions(-) (limited to 'config-db/slxconfig-demuxer') 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 : ''; - 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 : ''; + vlog(0, _tr("active plugins: %s", $activePluginStr)); # create all required (pre-)boot-environments (PXE, CD, ...) my $attrFile = "$buildPath/initramfs/machine-setup"; -- cgit v1.2.3-55-g7522