Control: tag -1 patch
On Thu, 2014-02-13 at 08:30 +0100, Philipp Marek wrote:
Can you provide the full strace output,
Last time I filtered by symlink, and now it doesn't happen anymore.
Oh, wait - after umount and apt-get --reinstall I get the message
again.
The symlinks are in the root directory, to files in the /boot directory.
So long as your /boot directory is not mounted, both symlinks are
broken. However, as soon the package is unpacked, the /vmlinuz link
works again.
The postinst script tries to repair the /vmlinuz and /initrd.img
symlinks if they don't exist. But it does so before calling the hook
scripts that will build the initramfs, and its test for existence
actually tests what the symlink *points to*. So it decides that
the /initrd.img symlink does not exist, and needs to be recreated.
I can easily reproduce this:
(sid:amd64)root:/# apt-get install linux-image-3.12-1-amd64
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
cpio initramfs-tools klibc-utils kmod libklibc libkmod2 libprocps3 libudev1
libuuid-perl linux-base procps udev
Suggested packages:
libarchive1 bash-completion linux-doc-3.12 debian-kernel-handbook grub-pc
extlinux lilo
Recommended packages:
busybox busybox-initramfs busybox-static firmware-linux-free psmisc
The following NEW packages will be installed:
cpio initramfs-tools klibc-utils kmod libklibc libkmod2 libprocps3 libudev1
libuuid-perl linux-base linux-image-3.12-1-amd64 procps udev
0 upgraded, 13 newly installed, 0 to remove and 30 not upgraded.
Need to get 30.4 MB/31.5 MB of archives.
After this operation, 148 MB of additional disk space will be used.
Do you want to continue? [Y/n]
[...]
Setting up initramfs-tools (0.115) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.12-1-amd64 (3.12.9-1) ...
/etc/kernel/postinst.d/initramfs-tools:
update-initramfs: Generating /boot/initrd.img-3.12-1-amd64
Processing triggers for libc-bin (2.17-97) ...
Processing triggers for initramfs-tools (0.115) ...
update-initramfs: Generating /boot/initrd.img-3.12-1-amd64
(sid:amd64)root:/# rm /boot/initrd.img-3.12-1-amd64
(sid:amd64)root:/# apt-get install --reinstall linux-image-3.12-1-amd64
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 30 not upgraded.
Need to get 0 B/29.6 MB of archives.
After this operation, 0 B of additional disk space will be used.
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 15359 files and directories currently installed.)
Preparing to unpack .../linux-image-3.12-1-amd64_3.12.9-1_amd64.deb ...
Unpacking linux-image-3.12-1-amd64 (3.12.9-1) over (3.12.9-1) ...
Setting up linux-image-3.12-1-amd64 (3.12.9-1) ...
Failed to symbolic-link /boot/initrd.img-3.12-1-amd64 to initrd.img.
dpkg: error processing package linux-image-3.12-1-amd64 (--configure):
subprocess installed post-installation script returned error exit status 17
Errors were encountered while processing:
linux-image-3.12-1-amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)
(sid:amd64)root:/#
This patch (applied in /var/lib/dpkg/info) fixed it for me:
--- linux-image-3.12-1-amd64.postinst
+++ linux-image-3.12-1-amd64.postinst
@@ -537,13 +537,17 @@
}
}
else {
- if (! -e $kimage) {
+ lstat($kimage);
+ if (! -e _) {
handle_missing_link($kimage, $image_dest, $kimage-$version,
$realimageloc);
}
- if ($initrd ! -e initrd.img) {
-handle_missing_link(initrd.img, $image_dest, initrd.img-$version,
- $realimageloc);
+ if ($initrd) {
+lstat(initrd.img);
+if (! -e _) {
+ handle_missing_link(initrd.img, $image_dest, initrd.img-$version,
+ $realimageloc);
+}
}
}
--- END --
I'll apply the corresponding patch to the source.
Ben.
--
Ben Hutchings
The world is coming to an end. Please log off.
signature.asc
Description: This is a digitally signed message part