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

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



Package: linux-2.6
Version: 2.6.18-7, 2.6.18.dfsg.1-9
Severity: important

Attempting to install (ignore the fact that the .deb is from
www.backports.org: the problem is clearly present in the latest
versions in testing and unstable):

    # dpkg -i linux-image-2.6.18-3-k7_2.6.18-8~bpo.1_i386.deb
    Selecting previously deselected package linux-image-2.6.18-3-k7.
    (Reading database ... 118793 files and directories currently installed.)
    Unpacking linux-image-2.6.18-3-k7 (from .../linux-image-2.6.18-3-k7_2.6.18-8~bpo.1_i386.deb) ...
    Done.
    Setting up linux-image-2.6.18-3-k7 (2.6.18-8~bpo.1) ...

     Hmm. The package shipped with a symbolic link /lib/modules/2.6.18-3-k7/source
     However, I can not read the target: No such file or directory
     Therefore, I am deleting /lib/modules/2.6.18-3-k7/source

    Running depmod.
    Finding valid ramdisk creators.
    Using mkinitramfs-kpkg to build the ramdisk.
    initrd.img() points to  (/boot/initrd.img-2.6.16-2-k7) -- doing nothing at /var/lib/dpkg/info/linux-image-2.6.18-3-k7.postinst line 585.
    vmlinuz() points to  (/boot/vmlinuz-2.6.16-2-k7) -- doing nothing at /var/lib/dpkg/info/linux-image-2.6.18-3-k7.postinst line 585.

Huh?  I need symlinks properly updated, but they are not:

    # cat /etc/kernel-img.conf
    do_symlinks = yes
    link_in_boot = yes
    relative_links = yes
    do_boot_enable = no
    warn_initrd = no

    # ls -l /boot
    total 20891
    -rw-r--r--  1 root root  651764 May 23  2006 System.map-2.6.16-2-k7
    -rw-r--r--  1 root root  794349 Dec 16 03:08 System.map-2.6.18-3-k7
    -rw-r--r--  1 root root  843731 Aug 17  2005 System.map-2.6.8-2-k7
    -rw-r--r--  1 root root   67132 May 23  2006 config-2.6.16-2-k7
    -rw-r--r--  1 root root   71347 Dec 15 02:38 config-2.6.18-3-k7
    -rw-r--r--  1 root root   55437 Aug 17  2005 config-2.6.8-2-k7
    drwxr-xr-x  2 root root    1024 Jun 19  2006 grub
    lrwxrwxrwx  1 root root      22 Jun 19  2006 initrd.img -> initrd.img-2.6.16-2-k7
    -rw-r--r--  1 root root 4787460 Jun 19  2006 initrd.img-2.6.16-2-k7
    -rw-r--r--  1 root root 4951392 Feb  1 18:18 initrd.img-2.6.18-3-k7
    -rw-r--r--  1 root root 5361664 Jul  4  2006 initrd.img-2.6.8-2-k7
    lrwxrwxrwx  1 root root      21 Sep 28  2005 initrd.img.old -> initrd.img-2.6.8-2-k7
    drwx------  2 root root   12288 Jan 19  2004 lost+found
    -rw-r--r--  1 root root   94356 Feb  3  2005 memtest86.bin
    lrwxrwxrwx  1 root root      19 Jun 19  2006 vmlinuz -> vmlinuz-2.6.16-2-k7
    -rw-r--r--  1 root root 1152794 May 23  2006 vmlinuz-2.6.16-2-k7
    -rw-r--r--  1 root root 1289521 Dec 16 03:08 vmlinuz-2.6.18-3-k7
    -rw-r--r--  1 root root 1152888 Aug 17  2005 vmlinuz-2.6.8-2-k7
    lrwxrwxrwx  1 root root      18 Sep 28  2005 vmlinuz.old -> vmlinuz-2.6.8-2-k7

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.  Also, since the intended pathname is a real file and
not a symlink, readlink(1) returns an empty string.

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.

I had to fix the links by hand to move on, but the problem has
to be addressed properly.

Regards,

-- 
/Awesome Walrus <walrus@amur.ru>
             ...Но будет день, и ты поймёшь, что ты -- лишь пешка в их игре...



Reply to: