diff options
author | Olivier Blin <oblin@mandriva.com> | 2009-11-09 11:14:11 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2009-11-09 11:14:11 +0000 |
commit | 6d816bb074a032f85fa7bb68f985684f500c67ef (patch) | |
tree | c113629a5f99ed570b5206c694a4f5491846c7d3 /lib/MDV/Draklive | |
parent | ad78be110f7bc35b2b3bc92fb998c6c883a7b7f7 (diff) | |
download | drakiso-6d816bb074a032f85fa7bb68f985684f500c67ef.tar drakiso-6d816bb074a032f85fa7bb68f985684f500c67ef.tar.gz drakiso-6d816bb074a032f85fa7bb68f985684f500c67ef.tar.bz2 drakiso-6d816bb074a032f85fa7bb68f985684f500c67ef.tar.xz drakiso-6d816bb074a032f85fa7bb68f985684f500c67ef.zip |
use bootloader module to find kernel (gdium friendly)
Diffstat (limited to 'lib/MDV/Draklive')
-rw-r--r-- | lib/MDV/Draklive/Live.pm | 14 |
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 { |