From 78a77be447311f092e92c19b0371379f533c4ec5 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Sat, 16 Feb 2008 17:18:42 +0000 Subject: Refactored call-out to plugins when making the initramfs: * The code for setting up the plugin in the initramfs has been moved into the plugin base, as this makes it possible for any plugin to override it (should the need ever arise). * The plugin scripts themselves are now being copied into the initramfs, instead of being part of the config-TGZ - they are static scripts, so there's no need to make them part of the config. Only the actual settings of each plugin are part of the config-TGZ now. * Cleaned up most accesses from plugins to private data of the makeInitRamFS- engine. I have tested with these changes with Ubuntu and Debian, and splashy still works for both, so it should be ok. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1551 95ad53e4-c205-0410-b2fa-d234c58c8868 --- config-db/slxconfig-demuxer | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) (limited to 'config-db') diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer index 5ae29150..091c8c8b 100755 --- a/config-db/slxconfig-demuxer +++ b/config-db/slxconfig-demuxer @@ -522,7 +522,7 @@ sub makeInitRamFS 'export-name' => $info->{export}->{name}, 'export-uri' => $info->{'export-uri'}, 'initramfs' => "$pxeVendorOSPath/$info->{'initramfs-name'}", - 'kernel-params' => $info->{kernel_params} || '', + 'kernel-params' => [ split ' ', ($info->{kernel_params} || '') ], 'kernel-version' => $kernelFile =~ m[-(.+)$] ? $1 : '', 'plugins' => $info->{'active-plugins'}, 'root-path' @@ -530,9 +530,9 @@ sub makeInitRamFS 'slx-version' => $slxVersion, 'system-name' => $info->{name}, }; + # TODO: make debug-level an explicit attribute, it's used in many places! - my $kernelParams = $info->{kernel_params} || ''; - if ($kernelParams =~ m{debug(?:=(\d+))?}) { + if ($info->{kernel_params} =~ m{debug(?:=(\d+))?}) { my $debugLevel = defined $1 ? $1 : '1'; $params->{'debug-level'} = $debugLevel; } @@ -541,7 +541,7 @@ sub makeInitRamFS $makeInitRamFSEngine->execute($option{dryRun}); # copy back kernel-params, as they might have been changed (by plugins) - $info->{kernel_params} = $makeInitRamFSEngine->{'kernel-params'}; + $info->{kernel_params} = join ' ', $makeInitRamFSEngine->kernelParams(); return; } @@ -656,8 +656,6 @@ sub writePluginConfigurationsForSystem my $buildPath = shift || confess 'need to pass in build-path!'; my $pluginConfPath = "$buildPath/initramfs/plugin-conf"; - my $pluginInitdPath = "$buildPath/initramfs/plugin-init.d"; - my $initHooksPath = "$buildPath/initramfs/init-hooks"; my $attrs = $info->{attrs} || {}; @@ -672,7 +670,7 @@ sub writePluginConfigurationsForSystem next if $option{dryRun}; - mkpath([ $pluginConfPath, $pluginInitdPath, $initHooksPath]); + mkpath([ $pluginConfPath ]); vlog(2, _tr("writing configuration file for plugin '%s'", $pluginName)); # write plugin configuration to a file: @@ -691,20 +689,6 @@ sub writePluginConfigurationsForSystem vlog(0, $content); vlog(0, "--- END OF $fileName --- "); } - - # copy runlevel script to be used in stage3: - my $precedence - = sprintf('%02d', $attrs->{"${pluginName}::precedence"}); - my $pluginFolder - = "$openslxConfig{'base-path'}/lib/plugins/$pluginName"; - my $scriptName = "$pluginFolder/XX_${pluginName}.sh"; - my $targetName = "$pluginInitdPath/${precedence}_${pluginName}.sh"; - if (slxsystem("cp $scriptName $targetName && chmod a+x $targetName")) { - die _tr( - "unable to copy runlevel script '%s' to '%s'! (%s)", - $scriptName, $targetName, $! - ); - } } $info->{'active-plugins'} = \@activePlugins; my $activePluginStr = @activePlugins ? join ',', @activePlugins : ''; -- cgit v1.2.3-55-g7522