From 694a9d322502ab5e9b91efd0bbf907de1f3506e0 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Mon, 10 Dec 2001 18:27:06 +0000 Subject: added safe guard against looping symlink. --- perl-install/bootloader.pm | 7 +++++-- 1 file 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"; -- cgit v1.2.1