For anyone stumbling upon this thread like I did, here is the solution to this particular idiotic problem.
In /usr/share/initramfs-tools/scripts/zfs there are multiple occurrences of the following code, 2 of which are in the function import_pool():
Code:
ZFS_STDERR="$(${ZFS_CMD} 2>&1)
The problem is, this is a bash-ism that doesn't work as it should, in pretty much any other shell. If you look closely at the error
Code:
Message: /init: line 1: /sbin/zpool import -c /etc/zfs/zpool.cache -N : not found
what you really see is the shell complaining that it can't find a binary called "/sbin/zpool import -c /etc/zfs/zpool.cache -N", including spaces and all. After changing that code to
Code:
ZFS_STDERR="$(eval ${ZFS_CMD} 2>&1)
it works as expected. What this tells you is that not a single person on earth has tested this code in real usage. It also tells you NOT TO PROGRAM FOR BASH if you claim to use /bin/sh in your shebang. Yet again stupid coders using bash ruin it for everyone. Thanks for the waste of time to that particular individual.