Comment 7 for bug 1582899

Revision history for this message
TJ (tj) wrote :

I added "set -x" to the start of /usr/share/initramfs-tools/hook-functions::dep_add_modules_mount() and after it failed I grabbed the output from /var/log/apt/term.log:

The link /initrd.img is a dangling linkto /boot/initrd.img-4.4.0-21-generic
vmlinuz(/boot/vmlinuz-4.4.0-21-generic
) points to /boot/vmlinuz-4.4.0-21-generic
 (/boot/vmlinuz-4.4.0-21-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.4.0-21-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-21-generic /boot/vmlinuz-4.4.0-21-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-21-generic
+ local dir dev_node FSTYPE
+ local modules=
+ dir=/
+ [ ! -d /sys/devices/ ]
+ read dev mp fs opts rest
+ [ / = / ]
+ [ ext4 != rootfs ]
+ printf dev_node=/dev/sda3\nFSTYPE=ext4
+ break
+ eval dev_node=/dev/sda3
FSTYPE=ext4
+ dev_node=/dev/sda3
+ FSTYPE=ext4
+ [ / != / ]
+ [ ext4 = ubifs ]
+ [ / = / ]
+ [ /dev/sda3 = /dev/root ]
+ [ -z /dev/sda3 ]
+ readlink -f /dev/sda3
+ dev_node=/dev/sda3
+ [ -b /dev/sda3 ]
+ echo mkinitramfs: failed to determine device for /
mkinitramfs: failed to determine device for /
+ echo mkinitramfs: workaround is MODULES=most, check:
mkinitramfs: workaround is MODULES=most, check:
+ echo grep -r MODULES /etc/initramfs-tools/
grep -r MODULES /etc/initramfs-tools/
+ echo

+ echo Error please report bug on initramfs-tools
Error please report bug on initramfs-tools
+ echo Include the output of 'mount' and 'cat /proc/mounts'
Include the output of 'mount' and 'cat /proc/mounts'
+ exit 1
update-initramfs: failed for /boot/initrd.img-4.4.0-21-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-21-generic.postinst line 1052.

The bug looks to be a missing $ symbol to denote the dev_node variable in the second test:

    # recheck device
    if [ -z "$dev_node" ] || ! dev_node="$(readlink -f ${dev_node})" \
        || ! [ -b "$dev_node" ]; then

! dev_node="$(readlink -f ${dev_node})"

should, I think, be:

! $dev_node="$(readlink -f ${dev_node})"