summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-12-10 18:27:06 +0000
committerFrancois Pons <fpons@mandriva.com>2001-12-10 18:27:06 +0000
commit694a9d322502ab5e9b91efd0bbf907de1f3506e0 (patch)
tree069b0ecc3567674ce75e256ffe6d26b2d4f37545 /perl-install
parent6ff8022a9fcd1a160bb1631f06b467a105620b41 (diff)
downloaddrakx-694a9d322502ab5e9b91efd0bbf907de1f3506e0.tar
drakx-694a9d322502ab5e9b91efd0bbf907de1f3506e0.tar.gz
drakx-694a9d322502ab5e9b91efd0bbf907de1f3506e0.tar.bz2
drakx-694a9d322502ab5e9b91efd0bbf907de1f3506e0.tar.xz
drakx-694a9d322502ab5e9b91efd0bbf907de1f3506e0.zip
added safe guard against looping symlink.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/bootloader.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 922cf0ac0..533e507b2 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -147,12 +147,15 @@ sub add_entry($$) {
sub add_kernel {
my ($prefix, $lilo, $version, $ext, $root, $v) = @_;
+ log::l("adding vmlinuz$ext as vmlinuz-$version");
-e "$prefix/boot/vmlinuz-$version" or log::l("unable to find kernel image $prefix/boot/vmlinuz-$version"), return;
- my $image = "/boot/vmlinuz" . (symlinkf("vmlinuz-$version", "$prefix/boot/vmlinuz$ext") ? $ext : "-$version");
+ my $image = "/boot/vmlinuz" . ($ext ne "-$version" &&
+ symlinkf("vmlinuz-$version", "$prefix/boot/vmlinuz$ext") ? $ext : "-$version");
my $initrd = eval {
mkinitrd($prefix, $version, "/boot/initrd-$version.img");
- "/boot/initrd" . (symlinkf("initrd-$version.img", "$prefix/boot/initrd$ext.img") ? $ext : "-$version") . ".img";
+ "/boot/initrd" . ($ext ne "-$version" &&
+ symlinkf("initrd-$version.img", "$prefix/boot/initrd$ext.img") ? $ext : "-$version") . ".img";
};
my $label = $ext =~ /-(default)/ ? $1 : "linux$ext";