diff options
Diffstat (limited to 'lib/MDV')
-rw-r--r-- | lib/MDV/Draklive/Live.pm | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/MDV/Draklive/Live.pm b/lib/MDV/Draklive/Live.pm index 25ec4c2..43b741e 100644 --- a/lib/MDV/Draklive/Live.pm +++ b/lib/MDV/Draklive/Live.pm @@ -22,4 +22,15 @@ sub get_system_root { $live->{settings}{chroot} . '/' . $live->get_name; } +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"; + } + $kernel; +} + 1; |