diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-06-23 14:49:02 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-06-23 14:49:02 +0000 |
commit | 9a615268219f0fc6c52c5e7695f2ef6ae42c6dd0 (patch) | |
tree | a98e9e9e79ad73eef921be5f254d2f1ca074b4c1 /perl-install/bootloader.pm | |
parent | 4e71dfe52d04197a2e9de02351809b350a301e11 (diff) | |
download | drakx-9a615268219f0fc6c52c5e7695f2ef6ae42c6dd0.tar drakx-9a615268219f0fc6c52c5e7695f2ef6ae42c6dd0.tar.gz drakx-9a615268219f0fc6c52c5e7695f2ef6ae42c6dd0.tar.bz2 drakx-9a615268219f0fc6c52c5e7695f2ef6ae42c6dd0.tar.xz drakx-9a615268219f0fc6c52c5e7695f2ef6ae42c6dd0.zip |
- bootloader-config:
o fix handling xen kernels: it should not replace an existing 'linux'
entry (#40865)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r-- | perl-install/bootloader.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index c85a9271b..2988d3e20 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -50,6 +50,11 @@ sub vmlinuz2kernel_str { }; } +sub kernel_str2short_name { + my ($kernel) = @_; + $kernel->{ext} =~ /^xen/ ? 'xen' : $kernel->{basename}; +} + sub basename2initrd_basename { my ($basename) = @_; $basename =~ s!vmlinuz-?!!; #- here we do not use $vmlinuz_regexp since we explictly want to keep all that is not "vmlinuz" @@ -61,14 +66,14 @@ sub kernel_str2vmlinuz_long { } sub kernel_str2initrd_long { my ($kernel) = @_; - basename2initrd_basename($kernel->{basename}) . '-' . $kernel->{version} . '.img'; + basename2initrd_basename(kernel_str2short_name($kernel)) . '-' . $kernel->{version} . '.img'; } sub kernel_str2vmlinuz_short { my ($kernel) = @_; if ($kernel->{use_long_name}) { kernel_str2vmlinuz_long($kernel); } else { - $kernel->{basename}; + kernel_str2short_name($kernel); } } sub kernel_str2initrd_short { @@ -76,7 +81,7 @@ sub kernel_str2initrd_short { if ($kernel->{use_long_name}) { kernel_str2initrd_long($kernel); } else { - basename2initrd_basename($kernel->{basename}) . '.img'; + basename2initrd_basename(kernel_str2short_name($kernel)) . '.img'; } } @@ -85,8 +90,8 @@ sub kernel_str2label { if ($o_use_long_name || $kernel->{use_long_name}) { _sanitize_ver($kernel); } else { - $kernel->{basename} eq 'vmlinuz' ? ($kernel->{ext} eq 'xen' ? $kernel->{ext} : 'linux') : - $kernel->{basename}; + my $short_name = kernel_str2short_name($kernel); + $short_name eq 'vmlinuz' ? 'linux' : $short_name; } } |