diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-10-28 20:26:06 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-10-28 20:26:06 +0000 |
commit | 1c72da4b765932ad694ec1a3865eff3620cafb62 (patch) | |
tree | 801a75f173a5292092ee657d2b44a68eef361f77 /lib/MDV/Draklive/Live.pm | |
parent | 218b22da76f5ebc2d954813246c8822c38685ed4 (diff) | |
download | draklive-1c72da4b765932ad694ec1a3865eff3620cafb62.tar draklive-1c72da4b765932ad694ec1a3865eff3620cafb62.tar.gz draklive-1c72da4b765932ad694ec1a3865eff3620cafb62.tar.bz2 draklive-1c72da4b765932ad694ec1a3865eff3620cafb62.tar.xz draklive-1c72da4b765932ad694ec1a3865eff3620cafb62.zip |
move find_kernel as method in MDV::Draklive::Live object
Diffstat (limited to 'lib/MDV/Draklive/Live.pm')
-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; |