I mis-read the code in the previous comment; the condition is fine. To figure it out I added some lines that do each test independently so as to identify which of the three fails. That reveals the problem is the block-device test:
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 ] + echo good dev_node good dev_node + readlink -f /dev/sda3 + dev_node2=/dev/sda3 + echo readlink returned 0 dev_node2=/dev/sda3 readlink returned 0 dev_node2=/dev/sda3 + [ -b /dev/sda3 ] + echo not a block device: /dev/sda3 not a block device: /dev/sda3 + [ -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
The problem is the /dev/sda* nodes do not exist in the /target, presumably because the host hasn't mounted devtmpfs to /target/dev.
That should be done by a call to hook-functions::setup_dev_linux() before dep_add_modules_mount()
There's a waypoint for it in debian/bootstrap-base.postinst before the install_kernel stage.
I mis-read the code in the previous comment; the condition is fine. To figure it out I added some lines that do each test independently so as to identify which of the three fails. That reveals the problem is the block-device test:
Examining /etc/kernel/ postinst. d. postinst. d/apt-auto- removal 4.4.0-21-generic /boot/vmlinuz- 4.4.0-21- generic postinst. d/initramfs- tools 4.4.0-21-generic /boot/vmlinuz- 4.4.0-21- generic img-4.4. 0-21-generic /dev/sda3\ nFSTYPE= ext4 tools/ tools/
run-parts: executing /etc/kernel/
run-parts: executing /etc/kernel/
update-initramfs: Generating /boot/initrd.
+ local dir dev_node FSTYPE
+ local modules=
+ dir=/
+ [ ! -d /sys/devices/ ]
+ read dev mp fs opts rest
+ [ / = / ]
+ [ ext4 != rootfs ]
+ printf dev_node=
+ break
+ eval dev_node=/dev/sda3
FSTYPE=ext4
+ dev_node=/dev/sda3
+ FSTYPE=ext4
+ [ / != / ]
+ [ ext4 = ubifs ]
+ [ / = / ]
+ [ /dev/sda3 = /dev/root ]
+ [ -z /dev/sda3 ]
+ echo good dev_node
good dev_node
+ readlink -f /dev/sda3
+ dev_node2=/dev/sda3
+ echo readlink returned 0 dev_node2=/dev/sda3
readlink returned 0 dev_node2=/dev/sda3
+ [ -b /dev/sda3 ]
+ echo not a block device: /dev/sda3
not a block device: /dev/sda3
+ [ -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-
grep -r MODULES /etc/initramfs-
+ echo
+ echo Error please report bug on initramfs-tools
The problem is the /dev/sda* nodes do not exist in the /target, presumably because the host hasn't mounted devtmpfs to /target/dev.
That should be done by a call to hook-functions: :setup_ dev_linux( ) before dep_add_ modules_ mount()
There's a waypoint for it in debian/ bootstrap- base.postinst before the install_kernel stage.