You are not logged in.
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?
Offline
Hmm, why does findmnt report it as not zfs then?
Anyway, I wonder why this doesn't instead use
stat -f -c %T /
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
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?
Offline
Apparently, because for e.g. ext4 it returns "ext2/ext3".
What does `wipefs` return for you?
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Not sure if that was a joke
AFAIK wipefs requires a device rather than a path you'd need to get the device's underlying path.
Offline
If it's a joke, the authors of stat are the ones telling it! (But under the hood, ext2/3/4 are the same thing with different feature flags.)
As for wipefs, correct -- what's the problem there?
For that matter, what does findmnt return?
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
As for wipefs, correct -- what's the problem there?
Inside the chroot, I cannot determine the device (or don't know how to). Normally I would use findmnt to discover that.
For that matter, what does findmnt return?
When I run 'findmnt -uno fstype -T /' (or without the options) it just exits with a status code 1.
I modified my /usr/lib/initcpio/install/autodetect at line 33 to change from this:
# detect filesystem for root
if rootfstype=$(findmnt -uno fstype -T '/'); then
to this
# detect filesystem for root
if rootfstype=$(findmnt -uno fstype -T '/' || stat -f -c %T '/' ); then
Which works for me and should also work on any existing configuration where findmnt works as expected. Do you think that might make for a sensible compromise solution ?
(apologies for irratic responses, I guess time-zones are at play)
Offline