summaryrefslogtreecommitdiffstats
path: root/installer
diff options
context:
space:
mode:
authorOliver Tappe2007-07-20 19:08:15 +0200
committerOliver Tappe2007-07-20 19:08:15 +0200
commit28ff1e4fa1855bbedf5fd9ea9e44eb74ae32ccfc (patch)
treef6fc3c3881ef5da44dfaa246067e418a124df363 /installer
parentgit-svn-id: http://svn.openslx.org/svn/openslx/trunk@1264 95ad53e4-c205-0410-... (diff)
downloadcore-28ff1e4fa1855bbedf5fd9ea9e44eb74ae32ccfc.tar.gz
core-28ff1e4fa1855bbedf5fd9ea9e44eb74ae32ccfc.tar.xz
core-28ff1e4fa1855bbedf5fd9ea9e44eb74ae32ccfc.zip
* added support for automatic selection of most appropriate (newest) kernel
if the kernel file specified by DB (in most cases: vmlinuz) does not exist. A warning will be printed by slxconfig-demuxer if the kernel had to be picked this way. This should allow slxconfig-demuxer to work for ubuntu & debian, as those do not always provide a vmlinuz-link (and in general this change makes the system more robust). git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1265 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'installer')
-rw-r--r--installer/OpenSLX/OSSetup/Distro/Base.pm25
-rw-r--r--installer/OpenSLX/OSSetup/Engine.pm7
2 files changed, 32 insertions, 0 deletions
diff --git a/installer/OpenSLX/OSSetup/Distro/Base.pm b/installer/OpenSLX/OSSetup/Distro/Base.pm
index 09323b52..9b59a828 100644
--- a/installer/OpenSLX/OSSetup/Distro/Base.pm
+++ b/installer/OpenSLX/OSSetup/Distro/Base.pm
@@ -134,6 +134,31 @@ sub finishSession
{
}
+sub pickKernelFile
+{
+ my $self = shift;
+ my $kernelPath = shift;
+
+ my $newestKernelFile;
+ my $newestKernelFileSortKey = '';
+ foreach my $kernelFile (glob("$kernelPath/vmlinuz-*")) {
+ next unless $kernelFile =~ m{
+ vmlinuz-(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?-(\d+(?:\.\d+)?)
+ }x;
+ my $sortKey
+ = sprintf("%02d.%02d.%02d.%02d-%2.1f", $1, $2, $3, $4||0, $5);
+ if ($newestKernelFileSortKey lt $sortKey) {
+ $newestKernelFile = $kernelFile;
+ $newestKernelFileSortKey = $sortKey;
+ }
+ }
+
+ if (!defined $newestKernelFile) {
+ die _tr("unable to pick a kernel-file from path '%s'!", $kernelPath);
+ }
+ return $newestKernelFile;
+}
+
1;
################################################################################
diff --git a/installer/OpenSLX/OSSetup/Engine.pm b/installer/OpenSLX/OSSetup/Engine.pm
index 5737814b..233ba33c 100644
--- a/installer/OpenSLX/OSSetup/Engine.pm
+++ b/installer/OpenSLX/OSSetup/Engine.pm
@@ -596,6 +596,13 @@ sub removeVendorOSFromConfigDB
return;
}
+sub pickKernelFile
+{
+ my $self = shift;
+
+ return $self->{distro}->pickKernelFile(@_);
+}
+
################################################################################
### implementation methods
################################################################################