summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-11-09 11:14:11 +0000
committerOlivier Blin <oblin@mandriva.com>2009-11-09 11:14:11 +0000
commit6d816bb074a032f85fa7bb68f985684f500c67ef (patch)
treec113629a5f99ed570b5206c694a4f5491846c7d3 /lib
parentad78be110f7bc35b2b3bc92fb998c6c883a7b7f7 (diff)
downloaddraklive-6d816bb074a032f85fa7bb68f985684f500c67ef.tar
draklive-6d816bb074a032f85fa7bb68f985684f500c67ef.tar.gz
draklive-6d816bb074a032f85fa7bb68f985684f500c67ef.tar.bz2
draklive-6d816bb074a032f85fa7bb68f985684f500c67ef.tar.xz
draklive-6d816bb074a032f85fa7bb68f985684f500c67ef.zip
use bootloader module to find kernel (gdium friendly)
Diffstat (limited to 'lib')
-rw-r--r--lib/MDV/Draklive/Live.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/MDV/Draklive/Live.pm b/lib/MDV/Draklive/Live.pm
index 35fbf03..f356b33 100644
--- a/lib/MDV/Draklive/Live.pm
+++ b/lib/MDV/Draklive/Live.pm
@@ -30,13 +30,15 @@ sub get_media_prefix {
sub find_kernel {
my ($live) = @_;
- my $kernel = $live->{system}{kernel};
- unless ($kernel) {
- my $vmlinuz = readlink($live->get_system_root . '/boot/vmlinuz');
- $vmlinuz ||= find { -e $_ && ! -l $_ } glob_($live->get_system_root . '/boot/vmlinuz-*');
- ($kernel) = $vmlinuz =~ /\bvmlinuz-(.*)$/ or die "no kernel can be found\n";
+ require bootloader;
+ local $::prefix = $live->get_system_root;
+ my @kernels = bootloader::get_kernels_and_labels();
+ my $kernel;
+ if ($live->{system}{kernel}) {
+ $kernel = find { $_->{version} eq $live->{system}{kernel} } @kernels;
+ $kernel or die "kernel $live->{system}{kernel} can not be found\n";
}
- { version => $kernel };
+ $kernel ||= first(@kernels) or die "no kernel can be found\n";
}
sub get_lib_prefix {