update-initramfs fails when cp encounters empty directory

Bug #1636922 reported by Haravikk
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I recently upgraded to UbuntuServer 16.04 but encountered the following problem:

    dpkg --configure linux-image-4.4.0-45-generic
    Setting up linux-image-4.4.0-45-generic (4.4.0-45.66) ...
    Running depmod.
    update-initramfs: deferring update (hook will be called later)
    The link /initrd.img is a dangling linkto /boot/initrd.img-4.4.0-45-generic
    vmlinuz(/boot/vmlinuz-4.4.0-45-generic
    ) points to /boot/vmlinuz-4.4.0-45-generic
     (/boot/vmlinuz-4.4.0-45-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-45-generic.postinst line 491.
    Examining /etc/kernel/postinst.d.
    run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
    run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-45-generic /boot/vmlinuz-4.4.0-45-generic
    update-initramfs: Generating /boot/initrd.img-4.4.0-45-generic
    cp: omitting directory '/etc/udev/rules.d/70-persistent-net.rules'
    E: /usr/share/initramfs-tools/hooks/udev failed with return 1.
    update-initramfs: failed for /boot/initrd.img-4.4.0-45-generic with 1.
    run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
    Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-4.4.0-45-generic.postinst line 1052.
    dpkg: error processing package linux-image-4.4.0-45-generic (--configure):
     subprocess installed post-installation script returned error exit status 2
    Errors were encountered while processing:
     linux-image-4.4.0-45-generic

With a bit of digging I determined the issue was with this line (after initially disregarding it):

    cp: omitting directory '/etc/udev/rules.d/70-persistent-net.rules'

The path specified turned out to be an empty directory, hence why cp omitted it, so I simply deleted it and tried again, this time successfully.

It seems that update-initramfs, or some other component of it, is treating a cp omission as a failure and erroring out, rather than continuing, while looking into the problem I found a few variations of the problem (directories other than udev) so it seems like this behaviour could do with being changed to prevent this issue in future.

Version information:
    lsb_release -rd
    Description: Ubuntu 16.04.1 LTS
    Release: 16.04

    initramfs-tools:
      Installed: 0.122ubuntu8.5
      Candidate: 0.122ubuntu8.5
      Version table:
     *** 0.122ubuntu8.5 500
            500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
            500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages
            100 /var/lib/dpkg/status
         0.122ubuntu8 500
            500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
            500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in initramfs-tools (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.