Bug#738707: linux-image-3.12-1-amd64: Failed to symbolic-link /boot/initrd.img-3.12-1-amd64 to initrd.img.

2014-02-13 Thread Ben Hutchings
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


Bug#738707: linux-image-3.12-1-amd64: Failed to symbolic-link /boot/initrd.img-3.12-1-amd64 to initrd.img.

2014-02-12 Thread Ph. Marek
Package: src:linux
Version: 3.12.9-1
Severity: normal

I had the wrong /boot mounted.
After reboot I noticed that, got the correct filesystem on there, and did apt-
get install --reinstall - but that stopped with the error message above.

strace showed this:


  [pid  8236] 09:56:54.538994 symlink(/boot/initrd.img-3.12-1-amd64,
initrd.img) = -1 EEXIST (File exists)
  Failed to symbolic-link /boot/initrd.img-3.12-1-amd64 to initrd.img.

So I guess there might be some script that looks at the link, says it's
correct, no need to delete, but the symlink() call later on then gets the
error.





-- Package-specific info:
** Kernel log: boot messages should be attached


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.11-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages linux-image-3.12-1-amd64 depends on:
ii  debconf [debconf-2.0]   1.5.52
ii  initramfs-tools [linux-initramfs-tool]  0.115
ii  kmod16-2
ii  linux-base  3.5
ii  module-init-tools   16-2

Versions of packages linux-image-3.12-1-amd64 recommends:
ii  firmware-linux-free  3.2

Versions of packages linux-image-3.12-1-amd64 suggests:
pn  debian-kernel-handbook  none
ii  grub-pc 2.00-22
pn  linux-doc-3.12  none

Versions of packages linux-image-3.12-1-amd64 is related to:
pn  firmware-atherosnone
pn  firmware-bnx2   none
pn  firmware-bnx2x  none
ii  firmware-brcm80211  0.40
pn  firmware-intelwimax none
pn  firmware-ipw2x00none
pn  firmware-ivtv   none
pn  firmware-iwlwifinone
pn  firmware-libertas   none
ii  firmware-linux  0.40
ii  firmware-linux-nonfree  0.40
pn  firmware-myricomnone
pn  firmware-netxen none
pn  firmware-qlogic none
pn  firmware-ralink none
ii  firmware-realtek0.40
pn  xen-hypervisor  none

-- debconf information excluded


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#738707: linux-image-3.12-1-amd64: Failed to symbolic-link /boot/initrd.img-3.12-1-amd64 to initrd.img.

2014-02-12 Thread Ben Hutchings
Control: tag -1 moreinfo

On Wed, 2014-02-12 at 10:01 +0100, Ph. Marek wrote:
 Package: src:linux
 Version: 3.12.9-1
 Severity: normal
 
 I had the wrong /boot mounted.
 After reboot I noticed that, got the correct filesystem on there, and did 
 apt-
 get install --reinstall - but that stopped with the error message above.
 
 strace showed this:
 
 
   [pid  8236] 09:56:54.538994 symlink(/boot/initrd.img-3.12-1-amd64,
 initrd.img) = -1 EEXIST (File exists)
   Failed to symbolic-link /boot/initrd.img-3.12-1-amd64 to initrd.img.
 
 So I guess there might be some script that looks at the link, says it's
 correct, no need to delete, but the symlink() call later on then gets the
 error.
[...]

Can you provide the full strace output, and output of 'ls -l /boot'?

Ben.

-- 
Ben Hutchings
If more than one person is responsible for a bug, no one is at fault.


signature.asc
Description: This is a digitally signed message part