[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#409240: Kernel and initrd image symlinks aren't updated properly



reassign 409240 kernel-package
thanks

Hi,

        Thanks for the report.  Part of the problems you encountered
 are fixed in the latest kernel-package, but there is at least
 one bug.


On Thu, 1 Feb 2007 18:54:04 +1300, Dennis Vshivkov <walrus@amur.ru> said: 

> Here's where the problem lies: the postinst, in sub move_p().  The
> Perl script does hops and skips and figures out intended and
> existing targets for the symlinks ($target and $vmlinuz_target,
> accordingly), and if they compare equal, outputs the message above,
> doing nothing else.  Debugging reveals that they do compare equal
> because they are both undefined/empty.

> Here's how $target gets empty:

>     my $target = `readlink -q "${realimageloc}${kimage-$version}"`;


> At the very least, interpolation of $kimage and $version is broken.

        This is the bug in the postinst.

> Also, since the intended pathname is a real file and not a symlink,
> readlink(1) returns an empty string.

        This part has been fixed by using readlink -q -m:
__> ls -als /bin/bash
672 -rwxr-xr-x 1 root root 677184 2006-12-11 15:20 /bin/bash
__> readlink -q -m /bin/bash
/bin/bash


> That alone wouldn't be enough, here's how $vmlinuz_target gets the
> same:

>     my $vmlinuz_target = readlink "$kimage";
>       ...
>     $vmlinuz_target = `readlink -q $vmlinuz_target`;

> The $kimage link target is resolved as a symlink once again, which
> fails, as it's a real file too.  The whole need for doing that
> second resolution, as well as mixing readlink() and `readlink` in
> the same code is not clear.

        The readlink -q -m bit is the correct one; the first
 invocation only works for links; the seconf one follows every link in
 the path, without requiring it to exist, or caring if it is a real
 file. 

        manoj
-- 
The sooner you fall behind, the more time you have to catch up.
Manoj Srivastava <srivasta@acm.org> <http://www.golden-gryphon.com/>
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C



Reply to: