summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Tappe2008-02-10 18:22:23 +0100
committerOliver Tappe2008-02-10 18:22:23 +0100
commitef8c212ad80bc3a01dbe6aa1400b07ccae244c64 (patch)
tree38494e15b6c947daf390bb02873b82a731b0a1fb
parent* filled README.de with content (meant as a suggestion only, open for discuss... (diff)
downloadcore-ef8c212ad80bc3a01dbe6aa1400b07ccae244c64.tar.gz
core-ef8c212ad80bc3a01dbe6aa1400b07ccae244c64.tar.xz
core-ef8c212ad80bc3a01dbe6aa1400b07ccae244c64.zip
* implement support for letting the plugins suggest additional kernel_params
* the theme plugin now suggests the use of the kernel-params 'vga=0x317' and 'quiet' unless they have already been set [these values should be moved into the DB later, such that the user can change them (i.e. to set a different resolution via vga=...)]. git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1532 95ad53e4-c205-0410-b2fa-d234c58c8868
-rwxr-xr-xconfig-db/slxconfig-demuxer3
-rw-r--r--initramfs/OpenSLX/MakeInitRamFS/Engine.pm7
-rw-r--r--os-plugins/OpenSLX/OSPlugin/Base.pm10
-rw-r--r--os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm22
4 files changed, 42 insertions, 0 deletions
diff --git a/config-db/slxconfig-demuxer b/config-db/slxconfig-demuxer
index e4b418fa..c25153f1 100755
--- a/config-db/slxconfig-demuxer
+++ b/config-db/slxconfig-demuxer
@@ -540,6 +540,9 @@ sub makeInitRamFS
my $makeInitRamFSEngine = OpenSLX::MakeInitRamFS::Engine->new($params);
$makeInitRamFSEngine->execute($option{dryRun});
+ # copy back kernel-params, as they might have been changed (by plugins)
+ $info->{kernel_params} = $makeInitRamFSEngine->{'kernel-params'};
+
return;
}
diff --git a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
index efbcb585..cbd5ff5a 100644
--- a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
+++ b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
@@ -687,6 +687,13 @@ sub _handlePlugins
}
my $plugin = OpenSLX::OSPlugin::Roster->getPlugin($pluginName);
next if !$plugin;
+ my @suggestedKernelParams
+ = $plugin->suggestAdditionalKernelParams($self->{'kernel-params'});
+ if (@suggestedKernelParams) {
+ $self->{'kernel-params'}
+ .= ($self->{'kernel-params'} ? ' ' : '')
+ . join ' ', @suggestedKernelParams;
+ }
$plugin->copyRequiredFilesIntoInitramfs(
$self->{'build-path'}, $self->{attrs}, $self
);
diff --git a/os-plugins/OpenSLX/OSPlugin/Base.pm b/os-plugins/OpenSLX/OSPlugin/Base.pm
index 4b370375..0f601704 100644
--- a/os-plugins/OpenSLX/OSPlugin/Base.pm
+++ b/os-plugins/OpenSLX/OSPlugin/Base.pm
@@ -129,6 +129,16 @@ sub postRemovalPhase
my $pluginTempPath = shift;
}
+sub suggestAdditionalKernelParams
+{ # called by config-demuxer in order to give the plugin a chance to add
+ # any kernel params it requires.
+ # In order to do so, the plugin should analyse the contents of the
+ # given string ('kernel-params') and return a list of additional params
+ # that it would like to see added.
+ my $self = shift;
+ my $kernelParams = shift;
+}
+
sub copyRequiredFilesIntoInitramfs
{ # called by config-demuxer in order to give the plugin a chance to copy
# all required files from the vendor-OS into the initramfs.
diff --git a/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
index 7de608af..a00cd8a2 100644
--- a/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
+++ b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
@@ -111,6 +111,28 @@ sub getAttrInfo
};
}
+sub suggestAdditionalKernelParams
+{
+ my $self = shift;
+ my $kernelParams = shift;
+
+ my @suggestedParams;
+
+ # add vga=0x317 unless explicit vga-mode is already set
+ if ($kernelParams !~ m{\bvga=}) {
+ vlog(1, "theme-plugin: adding kernel-param vga=0x317");
+ push @suggestedParams, 'vga=0x317';
+ }
+
+ # add quiet, if not already set
+ if ($kernelParams !~ m{\bquiet\b}) {
+ vlog(1, "theme-plugin: adding kernel-param quiet");
+ push @suggestedParams, 'quiet';
+ }
+
+ return @suggestedParams;
+}
+
sub copyRequiredFilesIntoInitramfs
{
my $self = shift;