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

Bug#730073: linux-image-3.11-2-amd64: postinst fails with no_symlinks=yes



Package: src:linux
Version: 3.11.8-1
Severity: normal

Dearest maintainer,

The latest kernel upgrade fails to complete its installation on my system. If
I remember correctly, the previous new kernel failed to install in the same
way but I chose to work around it instead of reporting it back then.

The symptom is a failing postinst script because initrd is missing:

murid:/var/admin# dpkg --configure --pending
Setting up linux-image-3.11-2-amd64 (3.11.8-1) ...
Running depmod.
cp: cannot stat ‘/boot/initrd.img-3.11-2-amd64’: No such file or directory
Failed to copy /boot/initrd.img-3.11-2-amd64 to /initrd.img .
dpkg: error processing linux-image-3.11-2-amd64 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of linux-image-amd64:
 linux-image-amd64 depends on linux-image-3.11-2-amd64; however:
  Package linux-image-3.11-2-amd64 is not configured yet.

dpkg: error processing linux-image-amd64 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 linux-image-3.11-2-amd64
 linux-image-amd64


This can be solved easily by running update-initramfs -c manually, after
which dpkg --configure completes without issue. But digging deeper, we get:

image_magic: kimage=vmlinuz, image_dest=/
         image_name=vmlinuz-3.11-2-amd64, src_dir=/boot/ at
			/var/lib/dpkg/info/linux-image-3.11-2-amd64.postinst line 444.
handle_non_link: kimage=vmlinuz, image_dest=/
         image_name=vmlinuz-3.11-2-amd64, src_dir=/boot/ at
			/var/lib/dpkg/info/linux-image-3.11-2-amd64.postinst line 371.
image_magic: kimage=initrd.img, image_dest=/
         image_name=initrd.img-3.11-2-amd64, src_dir=/boot/ at
			/var/lib/dpkg/info/linux-image-3.11-2-amd64.postinst line 444.
handle_missing_link: kimage=initrd.img, image_dest=/
         image_name=initrd.img-3.11-2-amd64, src_dir=/boot/ at
			/var/lib/dpkg/info/linux-image-3.11-2-amd64.postinst line 331.
cp: cannot stat ‘/boot/initrd.img-3.11-2-amd64’: No such file or directory
Failed to copy /boot/initrd.img-3.11-2-amd64 to /initrd.img .


If I'm reading the postinst script correctly, this error is from either
line 383 or line 422, which is called from image_magic() if the
destination path is neither missing nor a symlink. This is the case on
my system, because I have set both do_symlinks=no and no_symlinks=yes in
/etc/kernel-img.conf (what's the difference between them?). For new
kernels, the initrd has not been generated yet (that happens at the end
of the script) and cp doesn't handle that case as gracefully as ln does.

Even though the failure mode is created by no_symlinks in kernel-img.conf,
simply changing those settings does not allow the installation to
continue. That's because the /initrd.img file still exists, and
image_magic() is driven by the existing paths, not the config settings.
Conversely, simply setting no_symlinks=yes in the config does not prevent
a new kernel to be installed initially -- but as soon as a new initrd is
generated (and the /initrd symlink is replaced with a file), the next
kernel installation will fail regardless of the current config setting.


Regards,
Arno


-- Package-specific info:
(snip non-relevant machine configuration)


-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (900, 'stable'), (300, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-3-rt-amd64 (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages linux-image-3.11-2-amd64 depends on:
ii  debconf [debconf-2.0]                   1.5.52
ii  initramfs-tools [linux-initramfs-tool]  0.115
ii  kmod                                    9-3
ii  linux-base                              3.5
ii  module-init-tools                       9-3

Versions of packages linux-image-3.11-2-amd64 recommends:
ii  firmware-linux-free  3.2

Versions of packages linux-image-3.11-2-amd64 suggests:
pn  debian-kernel-handbook     <none>
pn  grub-pc | extlinux | lilo  <none>
pn  linux-doc-3.11             <none>

Versions of packages linux-image-3.11-2-amd64 is related to:
pn  firmware-atheros        <none>
pn  firmware-bnx2           <none>
pn  firmware-bnx2x          <none>
pn  firmware-brcm80211      <none>
pn  firmware-intelwimax     <none>
pn  firmware-ipw2x00        <none>
pn  firmware-ivtv           <none>
pn  firmware-iwlwifi        <none>
pn  firmware-libertas       <none>
ii  firmware-linux          0.40
ii  firmware-linux-nonfree  0.40
pn  firmware-myricom        <none>
pn  firmware-netxen         <none>
pn  firmware-qlogic         <none>
pn  firmware-ralink         <none>
ii  firmware-realtek        0.40
pn  xen-hypervisor          <none>

-- debconf information:
  linux-image-3.11-2-amd64/prerm/removing-running-kernel-3.11-2-amd64: true
  linux-image-3.11-2-amd64/postinst/depmod-error-initrd-3.11-2-amd64: false


Reply to: