summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2009-11-09 11:11:42 +0000
committerOlivier Blin <oblin@mandriva.com>2009-11-09 11:11:42 +0000
commitad78be110f7bc35b2b3bc92fb998c6c883a7b7f7 (patch)
tree6df3e3f0db852fde100c4cc59f092158cddcb987
parent282845a0ac0af992144d2ba3b42d5ea5820d6c9f (diff)
downloaddraklive-ad78be110f7bc35b2b3bc92fb998c6c883a7b7f7.tar
draklive-ad78be110f7bc35b2b3bc92fb998c6c883a7b7f7.tar.gz
draklive-ad78be110f7bc35b2b3bc92fb998c6c883a7b7f7.tar.bz2
draklive-ad78be110f7bc35b2b3bc92fb998c6c883a7b7f7.tar.xz
draklive-ad78be110f7bc35b2b3bc92fb998c6c883a7b7f7.zip
make find_kernel return a hash like used in bootloader module
-rwxr-xr-xdraklive4
-rw-r--r--lib/MDV/Draklive/Initrd.pm4
-rw-r--r--lib/MDV/Draklive/Live.pm2
3 files changed, 5 insertions, 5 deletions
diff --git a/draklive b/draklive
index e131eb4..4ac770e 100755
--- a/draklive
+++ b/draklive
@@ -485,7 +485,7 @@ sub create_initrd {
sub create_bootloader {
my ($live) = @_;
- my $kernel = $live->find_kernel;
+ my $kernel = $live->find_kernel->{version};
my $vmlinuz_long = '/boot/vmlinuz-' . $kernel;
-e $live->get_system_root . $vmlinuz_long or die "can not find kernel $kernel\n";
@@ -588,7 +588,7 @@ $live->{media}{title} <kernel options>
sub create_media_bootloader {
my ($live) = @_;
- cp_f($live->get_system_root . '/boot/vmlinuz-' . $live->find_kernel, $live->get_builddir . $live->{prefix}{build}{boot} . '/vmlinuz');
+ cp_f($live->get_system_root . '/boot/vmlinuz-' . $live->find_kernel->{version}, $live->get_builddir . $live->{prefix}{build}{boot} . '/vmlinuz');
foreach my $boot ('', @{$live->{media}{extra_boot}}) {
my $opts = { boot => $boot };
output($live->get_builddir . $live->{prefix}{build}{boot} . get_syslinux_path($live->{media}, $opts),
diff --git a/lib/MDV/Draklive/Initrd.pm b/lib/MDV/Draklive/Initrd.pm
index 79e8ca3..3095fbf 100644
--- a/lib/MDV/Draklive/Initrd.pm
+++ b/lib/MDV/Draklive/Initrd.pm
@@ -69,7 +69,7 @@ sub inst_initrd_bin {
sub create_initrd_for_media {
my ($live, $media) = @_;
my $initrd = $live->get_builddir . $live->{prefix}{build}{boot} . $media->get_initrd_path;
- create_media_specific_initrd($live, $media, $live->get_system_root, $initrd, $live->find_kernel);
+ create_media_specific_initrd($live, $media, $live->get_system_root, $initrd, $live->find_kernel->{version});
}
sub create_media_specific_initrd {
@@ -296,7 +296,7 @@ sub add_splash {
sub create_classical_initrd {
my ($live) = @_;
my $root = $live->get_system_root;
- my $kernel = $live->find_kernel;
+ my $kernel = $live->find_kernel->{version};
#- FIXME: use bootloader-config and allow it not to require a bootloader?
print "using kernel $kernel\n";
diff --git a/lib/MDV/Draklive/Live.pm b/lib/MDV/Draklive/Live.pm
index 0242658..35fbf03 100644
--- a/lib/MDV/Draklive/Live.pm
+++ b/lib/MDV/Draklive/Live.pm
@@ -36,7 +36,7 @@ sub find_kernel {
$vmlinuz ||= find { -e $_ && ! -l $_ } glob_($live->get_system_root . '/boot/vmlinuz-*');
($kernel) = $vmlinuz =~ /\bvmlinuz-(.*)$/ or die "no kernel can be found\n";
}
- $kernel;
+ { version => $kernel };
}
sub get_lib_prefix {