Comment 3 for bug 1020004

Revision history for this message
Bobby de Vos (devos-bobby) wrote :

It seems to me that the difference between the absolute symlink to the initrd.img-$version file and the relative symlink to the vmlinuz-$version file is created when the kernel post install script runs (currently linux-image-3.2.0-27-generic-pae.postinst on my system). This script, written in perl, has a subroutine called test_relative. At the end of this subroutine a return code is determined. For the initrd.img, the return code is 0, for vmlinuz the return code is 1. The code that calls test_relative() uses this return code to create an absolute or relative symlink.

As far as I can tell, the reason the return code for initrd.img is 0 is because the target of the symlink (/boot/initrd.img-$version) does not exist when the post install script is run. The target for the vmlinuz (/boot/vmlinuz-$version) does exist. The code at the end of test_relative() looks for the existence of the target in determining the return code.

The file /boot/initrd.img-$version is created after test_relative() is called. When the post install script starts running, one of the first messages is

update-initramfs: deferring update (hook will be called later)

which explains (to me at least) why the initrd.img target does not exist at first.