RFE: fips-mode-setup compatibility with chroot environment
When executed in chroot
environment the script is unable to detect the boot partition correctly:
boot_device="$(df -P /boot | tail -1)"
echo "$boot_device" | grep -q ' /$' && boot_device='/' || boot_device=$(echo "$boot_device" | cut -d ' ' -f 1)
Proposal is to switch (or have an option) to use /etc/fstab
as the source for boot partition UUID. Like:
findmnt --noheadings --output uuid --fstab --target /boot
It could be optional (--with-fstab-boot
) if current behavior is important (although, I would recommend switching from df
to findmnt
in any case).
An option to provide correct UUID could also help (--with-boot-uuid=XXX
), but would be less convenient.
I'm ready to provide a PR once we settle on the approach.