Using mkinitcpio in a chroot (fails to detect ZFS root filesystem)

I have a build process that works except for building the initramfs image file. The process involves building into a temporary directory using 'pacstrap' and performing additional steps using 'arch-chroot', one of which involves configuring and building the initial ram filesystem.

The problem that I have is that the 'autodetect' hook fails to detect the root file system and, therefore, produces an incomplete initramfs. This happens because the hook calls 'findmnt -uno fstype -T /' to establish the root file system's type. That fails in my chroot.

I notice this happens when building on a ZFS host. I have tried using an ext4 build host and that detects the root file system as ext4. The system being built is for a ZFS root file system (so it's incorrectly reported on an ext4 build host).

What I need to do is to tell mkinitcpio that the root file system (of the chrooted build) is ZFS. How can I do this?

Re: Using mkinitcpio in a chroot (fails to detect ZFS root filesystem)

Sorry it took me a while to get around to checking it. Your suggestion of using stat does work correctly. is this something we might be able to get fixed in mkinitcpio? Should I raise a bug report for this?