Skip to content

genfstab: fix src of bind mounts

Mike Yuan requested to merge github/fork/YHNdnzj/genfstab-fix-bind-source into master

Sources of bind mounts in fstab should be relative to the target's root instead of the host one. And the check logic below ([[ $src -ef $target ]]) only works in this way, too.

Let's take the bind mount method of mounting the ESP (described in ArchWiki) as an example. After running mount --bind /mnt/efi/EFI/arch /mnt/boot in the installation medium, genfstab would generate an entry like this:

/mnt/efi/EFI/arch /boot none sth,bind 0 0

which won't work after booting into the installed system.

Merge request reports