update-initramfs fails when cp encounters empty directory
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-
Setting up linux-image-
Running depmod.
update-
The link /initrd.img is a dangling linkto /boot/initrd.
vmlinuz(
) points to /boot/vmlinuz-
(/
Examining /etc/kernel/
run-parts: executing /etc/kernel/
run-parts: executing /etc/kernel/
update-
cp: omitting directory '/etc/udev/
E: /usr/share/
update-
run-parts: /etc/kernel/
Failed to process /etc/kernel/
dpkg: error processing package linux-image-
subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
linux-
With a bit of digging I determined the issue was with this line (after initially disregarding it):
cp: omitting directory '/etc/udev/
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-
Installed: 0.122ubuntu8.5
Candidate: 0.122ubuntu8.5
Version table:
*** 0.122ubuntu8.5 500
500 http://
500 http://
100 /var/lib/
500 http://
500 http://
Status changed to 'Confirmed' because the bug affects multiple users.