summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--initramfs/OpenSLX/MakeInitRamFS/Distro/Debian.pm6
-rw-r--r--initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm45
-rw-r--r--initramfs/OpenSLX/MakeInitRamFS/Distro/Ubuntu.pm18
-rw-r--r--initramfs/OpenSLX/MakeInitRamFS/Engine.pm51
-rw-r--r--os-plugins/OpenSLX/OSPlugin/Base.pm29
-rw-r--r--os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm17
-rw-r--r--os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm11
7 files changed, 163 insertions, 14 deletions
diff --git a/initramfs/OpenSLX/MakeInitRamFS/Distro/Debian.pm b/initramfs/OpenSLX/MakeInitRamFS/Distro/Debian.pm
index 4a652e69..0337b0b3 100644
--- a/initramfs/OpenSLX/MakeInitRamFS/Distro/Debian.pm
+++ b/initramfs/OpenSLX/MakeInitRamFS/Distro/Debian.pm
@@ -8,8 +8,8 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# MakeInitRamFS::Debian.pm
-# - provides Debian-specific overrides of the OpenSLX MakeInitRamFS API.
+# MakeInitRamFS::Distro::Debian.pm
+# - provides Debian-specific overrides of the MakeInitRamFS::Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::MakeInitRamFS::Distro::Debian;
@@ -37,6 +37,8 @@ sub applyChanges
my $self = shift;
my $engine = shift;
+ $engine->_addFilteredKernelModules( qw( af_packet hid unix ));
+
$engine->_addRequiredLib('/lib/libnss_compat.so.2');
return;
diff --git a/initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm b/initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm
new file mode 100644
index 00000000..4e5963a9
--- /dev/null
+++ b/initramfs/OpenSLX/MakeInitRamFS/Distro/SUSE.pm
@@ -0,0 +1,45 @@
+# Copyright (c) 2006, 2007 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# MakeInitRamFS::Distro::SUSE.pm
+# - provides SUSE-specific overrides of the MakeInitRamFS::Distro API.
+# -----------------------------------------------------------------------------
+package OpenSLX::MakeInitRamFS::Distro::SUSE;
+
+use strict;
+use warnings;
+
+use base qw(OpenSLX::MakeInitRamFS::Distro::Base);
+
+use OpenSLX::Basics;
+
+################################################################################
+### implementation
+################################################################################
+sub new
+{
+ my $class = shift;
+ my $self = {
+ 'base-name' => 'suse',
+ };
+ return bless $self, $class;
+}
+
+sub applyChanges
+{
+ my $self = shift;
+ my $engine = shift;
+
+ $engine->_addFilteredKernelModules( qw( hid unix ));
+
+ return;
+}
+
+1; \ No newline at end of file
diff --git a/initramfs/OpenSLX/MakeInitRamFS/Distro/Ubuntu.pm b/initramfs/OpenSLX/MakeInitRamFS/Distro/Ubuntu.pm
index 25d0b6f7..121ad030 100644
--- a/initramfs/OpenSLX/MakeInitRamFS/Distro/Ubuntu.pm
+++ b/initramfs/OpenSLX/MakeInitRamFS/Distro/Ubuntu.pm
@@ -8,15 +8,15 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
-# MakeInitRamFS::Ubuntu.pm
-# - provides Ubuntu-specific overrides of the OpenSLX MakeInitRamFS API.
+# MakeInitRamFS::Distro::Ubuntu.pm
+# - provides Ubuntu-specific overrides of the MakeInitRamFS::Distro API.
# -----------------------------------------------------------------------------
package OpenSLX::MakeInitRamFS::Distro::Ubuntu;
use strict;
use warnings;
-use base qw(OpenSLX::MakeInitRamFS::Distro::Debian);
+use base qw(OpenSLX::MakeInitRamFS::Distro::Base);
use OpenSLX::Basics;
@@ -32,4 +32,16 @@ sub new
return bless $self, $class;
}
+sub applyChanges
+{
+ my $self = shift;
+ my $engine = shift;
+
+ $engine->_addFilteredKernelModules( qw( unix ));
+
+ $engine->_addRequiredLib('/lib/libnss_compat.so.2');
+
+ return;
+}
+
1; \ No newline at end of file
diff --git a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
index cbd5ff5a..4624c7d7 100644
--- a/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
+++ b/initramfs/OpenSLX/MakeInitRamFS/Engine.pm
@@ -63,6 +63,7 @@ sub new
my %distroMap = (
'debian' => 'Debian',
+ 'suse' => 'SUSE',
'ubuntu' => 'Ubuntu',
);
my $distroModule = $distroMap{$self->{'distro-name'}} || 'Base';
@@ -73,7 +74,9 @@ sub new
$self->{'lib-scanner'}
= OpenSLX::LibScanner->new({ 'root-path' => $self->{'root-path'} });
- $self->{'required-libs'} = {};
+ $self->{'required-libs'} = {};
+ $self->{'suggested-kernel-modules'} = [];
+ $self->{'filtered-kernel-modules'} = [];
return bless $self, $class;
}
@@ -119,8 +122,6 @@ sub _collectCMDs
$self->_copyRequiredLayeredFSTools();
- $self->_copyKernelModules();
-
$self->_copyPreAndPostinitFiles();
if ($self->{'debug-level'}) {
@@ -131,6 +132,8 @@ sub _collectCMDs
$self->{distro}->applyChanges($self);
+ $self->_copyKernelModules();
+
$self->_copyRequiredLibs();
$self->_createInitRamFS();
@@ -505,6 +508,15 @@ sub _addRequiredLib
return;
}
+sub _addFilteredKernelModules
+{
+ my $self = shift;
+
+ push @{ $self->{'filtered-kernel-modules'} }, @_;
+
+ return;
+}
+
sub _copyKernelModules
{
my $self = shift;
@@ -536,6 +548,8 @@ sub _copyKernelModules
my @kernelModules = qw(
af_packet unix hid usbhid uhci-hcd ohci-hcd
);
+ push @kernelModules, @{ $self->{'suggested-kernel-modules'} };
+
push @kernelModules, split ' ', $self->{attrs}->{ramfs_fsmods};
push @kernelModules, split ' ', $self->{attrs}->{ramfs_miscmods};
push @kernelModules, split ' ', $self->{attrs}->{ramfs_nicmods};
@@ -555,9 +569,14 @@ sub _copyKernelModules
# required modules
foreach my $kernelModule (@kernelModules) {
if (!$modulePath{$kernelModule}) {
- warn _tr(
- 'kernel module "%s" not found (in modules.dep)', $kernelModule
- );
+ if (! grep { $_ eq $kernelModule }
+ @{ $self->{'filtered-kernel-modules'} }
+ ) {
+ warn _tr(
+ 'kernel module "%s" not found (in modules.dep)',
+ $kernelModule
+ );
+ }
}
foreach my $modulePath (@{$modulePath{$kernelModule}}) {
next if $modulesToBeCopied{$modulePath};
@@ -687,13 +706,29 @@ sub _handlePlugins
}
my $plugin = OpenSLX::OSPlugin::Roster->getPlugin($pluginName);
next if !$plugin;
+
my @suggestedKernelParams
= $plugin->suggestAdditionalKernelParams($self->{'kernel-params'});
if (@suggestedKernelParams) {
+ my $paramsList = join ' ', @suggestedKernelParams;
+ vlog(
+ 2,
+ "plugin $pluginName suggests these kernel params: $paramsList"
+ );
$self->{'kernel-params'}
- .= ($self->{'kernel-params'} ? ' ' : '')
- . join ' ', @suggestedKernelParams;
+ .= ($self->{'kernel-params'} ? ' ' : '') . $paramsList;
}
+
+ my @suggestedModules = $plugin->suggestAdditionalKernelModules($self);
+ if (@suggestedModules) {
+ vlog(
+ 2,
+ "plugin $pluginName suggests these kernel modules: "
+ . join(',', @suggestedModules)
+ );
+ push @{ $self->{'suggested-kernel-modules'} }, @suggestedModules;
+ }
+
$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 0f601704..51990912 100644
--- a/os-plugins/OpenSLX/OSPlugin/Base.pm
+++ b/os-plugins/OpenSLX/OSPlugin/Base.pm
@@ -39,6 +39,8 @@ sub initialize
# to installing stuff into the vendor-OS, like downloading functionality,
# access to meta-packager, ...
$self->{'os-plugin-engine'} = shift;
+
+ return;
}
sub getInfo
@@ -79,6 +81,8 @@ sub preInstallationPhase
# required by the corresponding stage3 runlevel script
my $pluginTempPath = shift;
# a temporary playground that will be cleaned up automatically
+
+ return;
}
sub installationPhase
@@ -89,6 +93,8 @@ sub installationPhase
# the repository folder, this time from inside the chroot
my $pluginTempPath = shift;
# the temporary folder, this time from inside the chroot
+
+ return;
}
sub postInstallationPhase
@@ -97,6 +103,8 @@ sub postInstallationPhase
my $self = shift;
my $pluginRepositoryPath = shift;
my $pluginTempPath = shift;
+
+ return;
}
sub preRemovalPhase
@@ -109,6 +117,8 @@ sub preRemovalPhase
# required by the corresponding stage3 runlevel script
my $pluginTempPath = shift;
# a temporary playground that will be cleaned up automatically
+
+ return;
}
sub removalPhase
@@ -119,6 +129,8 @@ sub removalPhase
# the repository folder, this time from inside the chroot
my $pluginTempPath = shift;
# the temporary folder, this time from inside the chroot
+
+ return;
}
sub postRemovalPhase
@@ -127,6 +139,8 @@ sub postRemovalPhase
my $self = shift;
my $pluginRepositoryPath = shift;
my $pluginTempPath = shift;
+
+ return;
}
sub suggestAdditionalKernelParams
@@ -137,6 +151,19 @@ sub suggestAdditionalKernelParams
# that it would like to see added.
my $self = shift;
my $kernelParams = shift;
+
+ return;
+}
+
+sub suggestAdditionalKernelModules
+{ # called by config-demuxer in order to give the plugin a chance to add
+ # any kernel modules it requires.
+ # In order to do so, the plugin should return the names of additional kernel
+ # modules that it would like to see added.
+ my $self = shift;
+ my $makeInitRamFSEngine = shift;
+
+ return;
}
sub copyRequiredFilesIntoInitramfs
@@ -149,4 +176,6 @@ sub copyRequiredFilesIntoInitramfs
my $targetPath = shift;
my $attrs = shift;
my $makeInitRamFSEngine = shift;
+
+ return;
}
diff --git a/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
index a00cd8a2..c2897eec 100644
--- a/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
+++ b/os-plugins/plugins/theme/OpenSLX/OSPlugin/theme.pm
@@ -133,6 +133,21 @@ sub suggestAdditionalKernelParams
return @suggestedParams;
}
+sub suggestAdditionalKernelModules
+{
+ my $self = shift;
+ my $makeInitRamFSEngine = shift;
+
+ my @suggestedModules;
+
+ # Ubuntu needs vesafb and fbcon (which drags along some others)
+ if ($makeInitRamFSEngine->{'distro-name'} =~ m{^ubuntu}i) {
+ push @suggestedModules, qw( vesafb fbcon )
+ }
+
+ return @suggestedModules;
+}
+
sub copyRequiredFilesIntoInitramfs
{
my $self = shift;
@@ -179,7 +194,7 @@ sub copyRequiredFilesIntoInitramfs
}
vlog(
- 0,
+ 1,
_tr(
"theme-plugin: bootsplash=%s displaymanager=%s",
$splashTheme, $displayManagerTheme
diff --git a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
index 69492160..b466dd17 100644
--- a/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
+++ b/os-plugins/plugins/vmware/OpenSLX/OSPlugin/vmware.pm
@@ -77,4 +77,15 @@ sub getAttrInfo
};
}
+sub suggestAdditionalKernelModules
+{
+ my $self = shift;
+ my $makeInitRamFSEngine = shift;
+
+ # simply suggest these and see where we go from there (what is vmblock?)
+ my @suggestedModules = qw( vmmon vmnet vmblock );
+
+ return @suggestedModules;
+}
+
1;